4

Nsight Eclipse でこの問題が発生しています。Cuda Toolkit 5.0 をインストールしました。複数の C ファイルと 1 つの Cuda ファイルを使用するプロジェクトがあります。

Nsight で Cuda ファイルと一緒に C ファイルを使用すると問題が発生することがあると読んだので、プロジェクトですべてのファイルを .cu および .cuh 拡張子に変更しました。同様に、黒いスペースを含むファイルのパスが原因で問題が発生する場合があるとのことでしたが、この場合ではないことを確認しました。

最初のファイル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 です。

誰かがこれを修正する方法を知っていますか? ありがとう

4

1 に答える 1

21

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.

于 2013-05-13T18:21:56.510 に答える