Platform: Windows 10
Arch: x64
Tools: Visual Studio 2019 + Cuda 10.2 + Xmake 2.9.9(If you dont know it, it does not matter. Just take it as a Cmake)
Error: nvcc link failed while compiling code
What causes error: I have a lot of .cu files and Xmake will put all .obj files generated by nvcc into a directory with a long path length. It will result in a very very very long cmd line (looks like this
“”"
“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc” -o build.objs\DLL1\windows\x64\release\rules\cuda\devlink\DLL1_gpucode.cu.obj [ a lot of .obj file paths, nearly 17000 characters ] “-LC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib\x64” cublas.lib -lcudadevrt -lcudart_static -m64 -dlink -shared
“”"
), which is more than the 8191 characters upper limits of windows cmd line.
Way tried but failed: put all command options into a response file and use command options -optf to read it. Still failed because of long cmd line.
Question: Does nvcc support getting command options through response file like cl(I mean in a way that can overcome the cmd line upper limits of windows)? If yes, how can I use it? If no, what else can I do instead of put all .obj files in a short directory path by myself?