Ernest_Galbrun
Ernest_Galbrun

Reputation: 2654

nvcc failed to compile in debug mode : Single file required

I have a problem trying to compile my program with nvcc for cuda. I use Visual studio 2012 and cuda 5.0.

When I launch the build in release mode, everything goes fine.

In debug mode I get the following error message at compile time for my first .cu file:

nvcc : fatal error : A single input file is required for a non-link phase when an outputfile is specified

My command lines are, for release mode:

C:\Users\Ernest\Documents\Matlab\icem\icem_cpp\cudaicem>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe" -gencode=arch=compute_13,code=\"sm_13,compute_13\" --use-local-env --cl-version 2010 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" --keep-dir "x64\Release" -maxrregcount=0 --ptxas-options=-v --machine 64 --compile -D_WINDLL -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MD " -o "x64\Release\Icem.cu.obj" "C:\Users\Ernest\Documents\Matlab\icem\icem_cpp\cudaicem\Icem.cu"

and for debug mode:

C:\Users\Ernest\Documents\Matlab\icem\icem_cpp\cudaicem>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe" -gencode=arch=compute_13,code=\"sm_13,compute_13\" --use-local-env --cl-version 2010 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -G --keep-dir "x64\Debug" -maxrregcount=0 --machine 64 --compile -g -D_CUDACC_ 1 -D_WINDLL -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o "x64\Debug\Icem.cu.obj" "C:\Users\Ernest\Documents\Matlab\icem\icem_cpp\cudaicem\Icem.cu"

Do you see anything wrong with the second one? I dont see multiple input files! Any idea what I could test ?

Upvotes: 0

Views: 2195

Answers (1)

BenC
BenC

Reputation: 8976

The answer was in the preprocessor options. -D_CUDACC_ 1 was the problem.

Upvotes: 2

Related Questions