Thrust compilation error

I couldn’t compile a program that uses thrust host vector. nvcc version is V11.4.48, and thrust version is 101201 (from thrust/version.h). Basically I am using what comes with the CUDA Toolkit 11.4 installation. My program does something as trivial as defining a host vector, but compilation says:

error: ‘host_vector’ is not a member of ‘thrust’
   thrust::host_vector<int3> test_vector;

I tried both g++ 6.5.0 and 4.8.5, arguably quite old but are what’s available on my machine. Could it be that the g++ version is too old? From the verbose output make, this doesn’t look like an nvcc issue.

Moving this to the CUDA Programming and Performance sub-forum.

using CUDA 11.4, be sure to follow the recommended machine configuration

nowadays thrust generally expects you to compile with -std=c++14 (or higher).

beyond that reduce it to a minimal example. If what you say is true, it should require roughly 10 lines to write a complete code to demonstrate the issue. And verify the issue using ordinary command-line tools, e.g.

nvcc -std=c++14 -o test test.cu

If the issue is not reproducible there, and you are using another method like cmake, then suspect your cmake usage.