Open minzak opened 4 years ago
You have told it to use the gcc-8 as host compiler where CUDA 9.2 only supports gcc-7 maximum
Try:
cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON\
-DCUDA_VERBOSE_BUILD=ON\
-DCUDA_LIB=/usr/lib/x86_64-linux-gnu/nvidia/current/libcuda.so\
-DCUDA_TOOLKIT_ROOT_DIR=/usr/lib/x86_64-linux-gnu/nvidia/current\
-DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7
make -j$(nproc)
Or much more simply:
CC=/usr/bin/gcc-7 CXX=/usr/bin/g++-7 cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON\
-DCUDA_VERBOSE_BUILD=ON\
-DCUDA_TOOLKIT_ROOT_DIR=/usr/lib/x86_64-linux-gnu/nvidia/current
make -j$(nproc)
this will help you change versions of gcc and g++ easily https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa
I have Debian 10, with nvidia driver and libs.
And typical gcc 7 & 8
I build with:
And result is:
What is wrong?