FindCUDA.cmake and nvcc failure
Hi, I'm having this failure message from nvcc
nvcc fatal : Don't know what to do with ''
which is originated by the fact that the command line contains two ""
, here is part of it
--default-stream per-thread -DSM_ARCH=100 -DSM=100 -DCUB_CDP -O3 -DNDEBUG "" "" -m64 -ccbin /usr/bin/cc -dlink
If i remove manually the two ""
everything builds fine.
With a bit of debugging I see that at this point of FindCUDA.cmake https://github.com/Kitware/CMake/blob/master/Modules/FindCUDA.cmake#L1687 the nvcc_flags
has the following value:
nvcc_flags --std=c++11;-gencode=arch=compute_52,code=sm_52;-gencode=arch=compute_52,code=compute_52;--default-stream;per-thread;-DSM_ARCH=100;-DSM=100;-DCUB_CDP;$<$<CONFIG:Release>:-O3>;$<$<CONFIG:Release>:-DNDEBUG>;$<$<CONFIG:Debug>:-G>;$<$<CONFIG:Debug>:-g>;-m64;-ccbin;/usr/bin/ccs
Since I'm building in Release mode (DNDEBUG) I think that the two ""
might be coming from the resolution of $<$<CONFIG:Debug>:-G>
and $<$<CONFIG:Debug>:-g>
, which are empty in Release mode.
In my CMakeLists.txt
i have
set(CUDA_NVCC_FLAGS_DEBUG "${CUDA_NVCC_FLAGS_DEBUG};-G;-g")
set(CUDA_NVCC_FLAGS_RELEASE "${CUDA_NVCC_FLAGS_RELEASE};-O3;-DNDEBUG")
If I remove those two lines, the generator expressions are gone and everything build fine (but without the flags that i need)
Anyone has ever experienced this problem? It happens for me indifferently on Linux (Ubuntu 14.04) and MacOSX, with cmake >= 3.4.
Thanks!
S.
PS For the record this happens with CUDA 7.0