2014-09-10 61 views
0

我在opensuse 13.1上安裝了cuda toolkit 6.5,並且在編譯cuda示例時遇到問題。編譯cuda示例的opensuse 13.1'

輸出使之後的命令是:

〜#使

make[1]: Entering directory `/home/user/NVIDIA_CUDA-6.5_Samples/0_Simple/simpleStreams 
/usr/local/cuda-6.5/bin/nvcc -ccbin g++ -I../../common/inc -m64  -gencode arch=compute_11,code=sm_11 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_50,code=compute_50 -o simpleStreams.o -c simpleStreams.cu 
nvcc warning : The 'compute_11', 'compute_12', 'compute_13', 'sm_11', 'sm_12', and 'sm_13' architectures are deprecated, and may be removed in a future release. 
g++: No such file or directory 
make[1]: *** [simpleStreams.o] Error 1 
make[1]: Leaving directory `/home/user/NVIDIA_CUDA-6.5_Samples/0_Simple/simpleStreams 
make: *** [0_Simple/simpleStreams/Makefile.ph_build] Error 2 
我NVCC和gcc的

版本:

NVCC:NVIDIA(R)Cuda的編譯器驅動程序 版權所有(C )2005-2014 NVIDIA Corporation 構建於Thu_Jul_17_21:41:27_CDT_2014 Cuda彙編工具,版本6.5,V6.5.12

gcc version 4.8.1 20130909 [gcc-4_8-branch revision 202388](SUSE Linux)

有人能幫我解決這個問題嗎?

回答

1

nvcc不喜歡compute_1X標誌,其中X1,2,3。只需刪除該代碼:-gencode arch=compute_11,code=sm_11 來自Makefile的代碼,您應該正確編譯。儘管這只是一個警告,但建議您修復所有警告以避免麻煩。根據nvcc配置,發生警告時也可能會失敗。

這個問題可能是由於它沒有找到g++編譯器。有可能你沒有安裝gcc編譯器c++這是最可能的原因。或者它可能發生,你已經手動安裝它,並且不在PATH上,這是不太可能的原因。

要安裝gcc編譯器爲c++請按照此link。如果不起作用,則問題與計算機無關。