1 /uer/local/cuda-11.4/include/thrust/detail/type_traits.h(62): error:this declaration has no storage class or type specifier
解决办法: 更改cuda的编译其版本。在cuda10之后,由于需要使用c++11,便不再支持gcc6以下的版本。
步骤: 输入指令cmake-gui,打开cmake图形页面,将CUDA_HOST_COMPILER编辑为gcc6以上的编译器所在的位置,默认为/usr/bin/gcc-6若没有则使用以下指令安装。
sudo apt-get install gcc-6
点击configure,然后generate后,在build文件夹下输入make -j4即可。
2 error: calling a constexpr __host__ function("abs") from a __device__ function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
由于opencv3.2.0版本不支持c++11,所以报错。
解决办法:在build文件夹下,输入以下指令可以解决:
cmake -DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr ..
3 /usr/bin/ld: cannot find -ltrue
输入以下指令可以解决
cmake -D CUDA_nppicom_LIBRARY=stdc++ ..