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

Atirag picture Atirag · May 13, 2013 · Viewed 8.2k times · Source

I'm getting this problem with Nsight Eclipse. I just installed my Cuda Toolkit 5.0 I have a project which uses several C files and one Cuda file.

I read that sometimes the problem arises when you use C files along Cuda files in Nsight so I changed all files to .cu and .cuh extensions in my project. Likewise it said that sometimes the problem comes from having a path for the files with black spaces which I made sure it's not this case.

The error arises when it tries compiling the first file Calcular.cu

This is the compilation output

make all 
Building file: ../Calcular.cu
Invoking: NVCC Compiler
nvcc -I/usr/include/ImageMagick -G -g -O0 -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -gencode arch=compute_13,code=sm_13 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_20,code=sm_21 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -odir "" -M -o "Calcular.d" "../Calcular.cu"
nvcc –Xcompiler –fopenmp --compile -G -I/usr/include/ImageMagick -O0 -g -gencode arch=compute_11,code=compute_11 -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=compute_12 -gencode arch=compute_12,code=sm_12 -gencode arch=compute_13,code=compute_13 -gencode arch=compute_13,code=sm_13 -gencode arch=compute_20,code=compute_20 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_20,code=sm_21 -gencode arch=compute_30,code=compute_30 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=compute_35 -gencode arch=compute_35,code=sm_35  -x cu -o  "Calcular.o" "../Calcular.cu"
nvcc fatal   : A single input file is required for a non-link phase when an outputfile is specified
make: *** [Calcular.o] Error 255

This are my compile options

–Xcompiler –fopenmp -I/usr/include/ImageMagick -G -g -O0

The compilation gives no other errors within the files. The files it needs to compile are Calcular.cu, Calcular.cuh, Preprocesamiento.cu, Preprocesamiento.cuh, Principal.cu, Principal.cuh.

Do someone knows how to fix this? Thanks

Answer

Robert Crovella picture Robert Crovella · May 13, 2013

The dashes you have here:

–Xcompiler –fopenmp

Are not the right kind of dashes. If you look closely at your question posting, you will see they are a slightly different character than the correct one which precedes this:

-I/usr/include/ImageMagick

for example.

You need to replace those dashes with the same kind of dash used in front of the include switch. If you manually entered those compiler options, you need to fix those characters.

This dash:

is not correct.

Use this dash:

-

instead.