Hallo,
my application is compiled and linked with a makefile. Now I am integrating the CUDA library, so I want to handle the ‘nvcc’ compilation step with the same makefile system.
The problem is that if I use the Micros0ft ‘nmake’ tool, the nvcc compilation gives an error (I presume, because he is not able to initialize the HERE variable), but the same makefile does not give problems if processed by the GNU ‘make’ tool, which is very similar to nmake.
Here is a part of my makefile, which launches nvcc to do the compilation:
…
.cu.obj:
nvcc --verbose -deviceemu -c $<
-Xcompiler /EHsc,/W3,/Wp64,/O2,/Zi,/MD $(CH_INCLUDES)
-I$(CH_CUDA_SDK_INC) -I$(CH_CUDA_INC) -o "$*.obj"
…
This will give two outcomes, depending if it is processed by ‘nmake’ or the Gnu ‘make’ (mingw32-make for windows), despite both build tools expand the command in the same identical way!
Here 's what happens with nmake:
> nvcc -deviceemu -c lcp/CHlcpIterativeCuda.cu -Xcompiler /EHsc,/W3,/Wp64,/O2,/Zi,/MD
-I"C:\tasora\code\Argonne\CODE\ChronoEngine\source" -I"c:\tasora\code\js/src"
-I"C:\tasora\code\Argonne\CODE\ChronoEngine\source/collision/bullet"
-I"C:\tasora\code\Argonne\CODE\ChronoEngine\source/collision/gimpact"
-I"c:\engine_demo\irrlicht-1.4\include"
-I"C:\Programmi\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc"
-I"C:\CUDA\include"
-o "lcp/CHlcpIterativeCuda.obj"
>#$ _SPACE_=
>#$ _MODE_=EMULATE
>#$ _HERE_=(null)
> Internal error
> NMAKE : fatal error U1077: 'c:\cuda\bin\nvcc.EXE' : return code '0xc0000005'
… and here’s what happens with the GNU make ‘mingw32-make’ :
> nvcc -deviceemu -c lcp/CHlcpIterativeCuda.cu ..etc.. [... same as above!!...]
>#$ _SPACE_=
>#$ _MODE_=EMULATE
>#$ _HERE_=c:\cuda\bin
>#$ _THERE_=c:\cuda\bin
>#$ TOP=c:\cuda\bin/..
>#$ PATH=c:\cuda\bin/../extools/bin; [....and many other paths here...]
>#$ INCLUDES="-Ic:\cuda\bin/../include" "-Ic:\cuda\bin/../include/cudart"
>#$ LIBRARIES= "/LIBPATH:c:\cuda\bin/../lib" cudart.lib
>#$ CUDAFE_FLAGS=
>#$ OPENCC_FLAGS=
>#$ PTXAS_FLAGS=
>#$ VSINSTALLDIR=C:\Programmi\Microsoft Visual Studio 8\VC\BIN/../..
>#$ VCINSTALLDIR=C:\Programmi\Microsoft Visual Studio 8\VC\BIN/../..
>#$ C:\Programmi\Microsoft Visual Studio 8\VC\BIN/../../common7/Tools/vsvars32.bat
OK! ALL IS COMPILED SUCCESFULLY!
Does this depend on the way nmake launches commands?
Is there a way to avoid this? (I cannot rely on GNU make only - I must
support also nmake)
I tried playing a bit with the .profile file, but without success…
regards,