Thrust error with thrust::copy during linking with CUDA 10.0

Hi,

I get an error when I copy a thrust::device_vector to a thrust::device_vector.

std::vector to thrust::device_vector works fine.
I have the feeling, It’s something with CUDA 10. I just made the jump from 7.5 to 10…

with thrust::device_vector val;

Matrix::Matrix(Matrix* M){

thrust::copy(M->val.begin(),M->val.end(),val.begin());

}

I get in the link stage:

Building target: eqstatic
Invoking: NVCC Linker
/usr/local/cuda-10.0/bin/nvcc --cudart static -L/usr/local/cuda-10.0/lib64 --relocatable-device-code=false -gencode arch=compute_30,code=compute_30 -gencode arch=compute_30,code=sm_30 -m64 -link -o “eqstatic” ./src/tools/Log.o ./src/linsolver/CsrMatrix.o ./src/linsolver/Cusparse.o ./src/eqstatic.o ./src/data/DataHandler.o ./src/data/Materials.o ./src/data/Matrices.o ./src/data/Matrix.o ./src/data/Mesh.o ./src/data/ProblemFiles.o ./src/data/readMeshAbaqus.o ./src/assembler/Assembler.o -lcusparse -lcudart -lcudadevrt -lcuda
./src/data/Matrix.o: In function thrust::detail::normal_iterator<thrust::device_ptr<int> > thrust::copy<thrust::cuda_cub::tag, thrust::detail::normal_iterator<thrust::device_ptr<int> >, thrust::detail::normal_iterator<thrust::device_ptr<int> > >(thrust::detail::execution_policy_base<thrust::cuda_cub::tag> const&, thrust::detail::normal_iterator<thrust::device_ptr<int> >, thrust::detail::normal_iterator<thrust::device_ptr<int> >, thrust::detail::normal_iterator<thrust::device_ptr<int> >)': /usr/local/cuda-10.0/bin/../targets/x86_64-linux/include/thrust/detail/copy.inl:37: undefined reference to thrust::detail::normal_iterator<thrust::device_ptr > thrust::cuda_cub::copy<thrust::cuda_cub::tag, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr > >(thrust::cuda_cub::execution_policythrust::cuda_cub::tag&, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >)’
makefile:63: recipe for target ‘eqstatic’ failed

I would really appreciate some help…

I don’t seem to have any trouble:

$ cat t309.cu
#include <thrust/device_vector.h>
#include <thrust/copy.h>

int main(){

  thrust::device_vector<int> v1(10);
  thrust::device_vector<int> v2(10);

  thrust::copy(v1.begin(), v1.end(), v2.begin());
}
$ nvcc -o t309 t309.cu
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
$

You may want to provide a short, complete code/example that demonstrates the issue.