0

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 ?

Ernest_Galbrun
  • 2,514
  • 3
  • 21
  • 33
  • 3
    `-D_CUDACC_ 1` isn't this because of this? Try without the `1`. By the way, why do you need this? Normally this is handled by `nvcc`. – BenC Apr 18 '13 at 11:47
  • You nailed it, it was in my preprocessor options, I have no clue why I added it, thank you! – Ernest_Galbrun Apr 19 '13 at 07:41
  • Yeah, reading Boost errors with `gcc` is a good training to spot random errors in a pool of obfuscated text. Glad I could help :o) – BenC Apr 19 '13 at 08:41

1 Answers1

2

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

BenC
  • 8,729
  • 3
  • 49
  • 68