CUDA: library paths with spaces not passed properly to nvlink
I have a project that uses JOM to build a library that depends on the CUDA library cuBLAS. In 3.11.4 the following works and does not work in 3.12.1:
target_link_libraries(${MY_TARGET}
PRIVATE
${CUDA_cublas_LIBRARY}
)
In 3.12.1 I get the following error, I assume because the path to cublas is not being converted to a windows short path or the spaces are not being escaped properly:
C:\PROGRA~1\NVIDIA~2\CUDA\v9.1\bin\nvcc.exe -arch=sm_30 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61 -D_WINDOWS -Xcompiler="/W3 /GR /EHsc" -Xcompiler="-MD -Zi -O2 -Ob1" -DNDEBUG -Wno-deprecated-gpu-targets -shared -dlink "CMakeFiles\my_redacted_object_files.cu.o" -o CMakeFiles\redacted.dir\cmake_device_link.obj -LIBPATH:C:\PROGRA~2\INTELS~1\COMPIL~2\windows\mkl\lib\intel64 -LIBPATH:C:\PROGRA~1\NVIDIA~2\CUDA\v9.1\lib\x64 -Xnvlink ..\RelWithDebInfo\lib\redacted.lib -Xnvlink ..\RelWithDebInfo\lib\redacted.lib -Xnvlink "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\lib\intel64\mkl_core.lib" -Xnvlink "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\lib\intel64\mkl_intel_lp64.lib" -Xnvlink "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\lib\intel64\mkl_sequential.lib" -Xnvlink "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64\cublas.lib" -Xnvlink ..\RelWithDebInfo\lib\g3logger.lib dbghelp.lib cudadevrt.lib cudart_static.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib -Xcompiler=-FdC:\Users\redacted\CMakeFiles\redacted.dir\,-FS
nvlink fatal : Could not open input file 'C:\Program' (target: sm_30)