在Ubuntu 12.04上编译CUDA时出错。重新定义变量

时间:2012-12-12 11:36:03

标签: ubuntu cuda ubuntu-12.04 nvcc

我正在尝试编译之前在其他平台上运行的CUDA程序,但我现在收到以下错误:

In file included from /usr/local/cuda-5.0/bin/crt/link.stub:79:0:
/tmp/tmpxft_00006ff5_00000000-1_align_dlink.reg.c:2:1: error: redefinition of 'const unsigned char def_module_id_str__NV_MODULE_ID []'
/tmp/tmpxft_00006ff5_00000000-1_align_dlink.reg.c:1:1: error: 'const unsigned char def_module_id_str__NV_MODULE_ID [19]' previously defined here
/tmp/tmpxft_00006ff5_00000000-1_align_dlink.reg.c: In function 'void __cudaRegisterLinkedBinary__NV_MODULE_ID(void (*)(void**), void*, void*)':

以及其他一些变量。

我有:

$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Fri_Sep_21_17:28:58_PDT_2012
Cuda compilation tools, release 5.0, V0.2.1221

gcc版本4.6.3,Tesla M2090和64位Ubuntu 12.04。

我已成功构建并运行CUDA示例,因此我认为我的环境已正确设置。

1 个答案:

答案 0 :(得分:0)

nvcc版本5中的链接器与版本4的链接器的工作方式不同。我的make文件中的编译过程与版本5不兼容。我安装了CUDA版本4并使其全部正常工作。

相关问题