CUDA as a language not working with CUDA 7
CUDA as a language will not work with CUDA 7. (7-9.1 is currently supported on CentOS 7 by NVidia) Switching to FindCUDA solves the problem (assuming you currently support both methods).
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /usr/local/cuda-7.0/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda-7.0/bin/nvcc -- broken
CMake Error at /opt/cmake-3.11.0-Linux-x86_64/share/cmake-3.11/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler
"/usr/local/cuda-7.0/bin/nvcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/schreihf/git/fitting/goofit/build-cuda7/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_84520/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_84520.dir/build.make CMakeFiles/cmTC_84520.dir/build
gmake[1]: Entering directory `/home/schreihf/git/fitting/goofit/build-cuda7/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_84520.dir/main.cu.o
/usr/local/cuda-7.0/bin/nvcc -x cu -c /home/schreihf/git/fitting/goofit/build-cuda7/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_84520.dir/main.cu.o
Linking CUDA device code CMakeFiles/cmTC_84520.dir/cmake_device_link.o
/opt/cmake-3.11.0-Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84520.dir/dlink.txt --verbose=1
/usr/local/cuda-7.0/bin/nvcc -shared -dlink CMakeFiles/cmTC_84520.dir/main.cu.o -o CMakeFiles/cmTC_84520.dir/cmake_device_link.o
Linking CUDA executable cmTC_84520
/opt/cmake-3.11.0-Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84520.dir/link.txt --verbose=1
"" CMakeFiles/cmTC_84520.dir/main.cu.o CMakeFiles/cmTC_84520.dir/cmake_device_link.o -o cmTC_84520
Error running link command: No such file or directory
gmake[1]: *** [cmTC_84520] Error 2
gmake[1]: Leaving directory `/home/schreihf/git/fitting/goofit/build-cuda7/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_84520/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:325 (enable_language)
-- Configuring incomplete, errors occurred!
It looks like a problem with it picking up the correct linker (which I've also seen once before, in an NVidia docker container, I think; maybe also with CUDA 7).