Hello, I’m trying to compile the code
#include <thrust/host_vector.h>
int main(void){ return 0xabacab; }
with (taken from thrust cpp_integration repository)
g++ -O2 -c test.cpp -I/usr/local/cuda-12.5/targets/x86_64-linux/include/
and the following compile errors show:
In file included from /usr/local/cuda-12.5/targets/x86_64-linux/include/cuda/std/detail/libcxx/include/__cccl_config:17,
from /usr/local/cuda-12.5/targets/x86_64-linux/include/cuda/__cccl_config:14,
from /usr/local/cuda-12.5/targets/x86_64-linux/include/thrust/detail/config/config.h:24,
from /usr/local/cuda-12.5/targets/x86_64-linux/include/thrust/version.h:31,
from /usr/local/cuda-12.5/targets/x86_64-linux/include/thrust/detail/config.h:22,
from /usr/local/cuda-12.5/targets/x86_64-linux/include/thrust/host_vector.h:25,
from test.cpp:1:
/usr/local/cuda-12.5/targets/x86_64-linux/include/thrust/detail/execution_policy.h:55:11: error: ‘__host__’ does not name a type
55 | constexpr _CCCL_HOST_DEVICE
| ^~~~~~~~~~~~~~~~~
plus many other errors like it. I’ve no idea whats happening. Also tried compiling with nvcc. In case of nvcc, if I rename test.cpp to test.cu, it compiles fine.