I have a compiler issue under nsight, which seemed to be related to a symbolic link.
The name of my project is myProject, and under its src directory, there are two folders: "cpp" and "share", each containing some .cpp, .h and .cu files. The only difference between cpp and share, as far as I can tell, is that share is a symbolic link to some other directory. The first source file in share is Buffer.cpp. During compilation, nvcc seems to generate Buffer.d fine. But when it tries to generate Buffer.o, it does not pass the --compile flag, and causes an error.
The console output looks like this:
Building file: …/src/share/Buffer.cpp
Invoking: NVCC Compiler
nvcc -I/usr/local/cuda/include -G -g -O0 -Xcompiler -gencode arch=compute_11,code=sm_11 -gencode arch=compute_13,code=sm_13 -odir "src/share" -M -o "src/share/Buffer.d" "…/src/share/Buffer.cpp"
nvcc -I/usr/local/cuda/include -G -g -O0 -Xcompiler "src/share/Buffer.o" "…/src/share/Buffer.cpp"
g++: src/share/Buffer.o: No such file or directory
make: *** [src/share/Buffer.o] Error 1
I found two workarounds: either 1) delete the symbolic link, and copy the share folder under myProject/src, or 2) change the toolchain for share from CUDA Toolkit 5.0 to Linux GCC.
I assume this is an nsight problem, because nvcc works fine at command line with --compile between -Xcompiler and "src/share/Buffer.o".
Can anyone shine some light on this issue? It is quite annoying.