【问题标题】:Error when compiling CUDA on Ubuntu 12.04. redefinition of variables在 Ubuntu 12.04 上编译 CUDA 时出错。重新定义变量
【发布时间】:2012-11-30 02:31:26
【问题描述】:

我正在尝试编译一个以前在其他平台上运行过的 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 示例,因此我认为我的环境设置正确。

【问题讨论】:

标签: ubuntu cuda ubuntu-12.04 nvcc


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2013-01-17
    • 1970-01-01
    • 2014-12-05
    • 2012-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多