nvcc fatal:当指定outputfile时,非链接阶段需要单个输入文件 [英] nvcc fatal: A single input file is required for a non-link phase when an outputfile is specified

查看:2898
本文介绍了nvcc fatal:当指定outputfile时,非链接阶段需要单个输入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个问题与Nsight Eclipse。我刚刚安装了我的Cuda工具包5.0我有一个项目,它使用几个C文件和一个Cuda文件。

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.

我读了有时问题出现,当你使用C文件沿Cuda文件在Nsight所以我改变了所有的文件.cu和.cuh扩展在我的项目。同样,它说有时问题来自于一个黑色空间的文件的路径,我确信这不是这种情况。

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.

错误出现,当它试图编译第一个文件Calcular.cu

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

这是编译输出

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

这是我的编译选项

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

编译不会在文件中给出其他错误。需要编译的文件是Calcular.cu,Calcular.cuh,Preprocesamiento.cu,Preprocesamiento.cuh,Principal.cu,Principal.cuh。

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

推荐答案

您在这里的破折号:

–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

您需要使用include开关前面使用的相同类型的破折号替换这些破折号。如果您手动输入这些编译器选项,您需要修复这些字符。

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.

此破折号:

不正确。

使用此破折号:

-

这篇关于nvcc fatal:当指定outputfile时,非链接阶段需要单个输入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆