NVCC 10.2.19 doesn't support -forward-unknown-to-host-compiler
I'm using CUDA ARM64 cross-compiler whose version is 10.2.19. I've compiled CMake from master 3.16.20191223-git
, but it seems that CMake 3.17 has a regression with an unknown option being passed to the CUDA compiler.
It seems the check here should be VERSION_LESS_EQUAL 10.2.19
.
Error:
-- The CUDA compiler identification is NVIDIA 10.2.19
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - broken
-- Configuring incomplete, errors occurred!
See also "/opt/build/CMakeFiles/CMakeOutput.log".
See also "/opt/build/CMakeFiles/CMakeError.log".
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler
"/usr/local/cuda/bin/nvcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /opt/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_322ab && [1/2] Building CUDA object CMakeFiles/cmTC_322ab.dir/main.cu.o
FAILED: CMakeFiles/cmTC_322ab.dir/main.cu.o
/usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler -Xcompiler=-fPIE -MD -MT CMakeFiles/cmTC_322ab.dir/main.cu.o -MF CMakeFiles/cmTC_322ab.dir/main.cu.o.d -x cu -c main.cu -o CMakeFiles/cmTC_322ab.dir/main.cu.o
nvcc fatal : Unknown option 'forward-unknown-to-host-compiler'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
NVCC version:
# ./nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Thu_May__2_11:47:14_PDT_2019
Cuda compilation tools, release 10.2, V10.2.19