【问题标题】:Errors during make of Cuda-5.0 SDK(Ubuntu 64), undefined reference to 'dlsym'制作 Cuda-5.0 SDK(Ubuntu 64)时出错,未定义对“dlsym”的引用
【发布时间】:2012-11-24 05:37:11
【问题描述】:
The toolkit and items 1-6 of the NVIDIA_CUDA SDK have been installed and compiled , but when it gets to '6_Advanced/cdpLUDecomposition' the following error message appears.

  /usr/local/cuda-5.0/bin/nvcc -m64 -Xcompiler -fopenmp -gencode arch=compute_35,code=sm_35  -o cdpLUDecomposition dlaswp.o dgetf2.o dgetrf.o cdp_lu.o cdp_lu_main.o -L/usr/local/cuda-5.0/lib64 -lcublas -lcublas_device -lcudadevrt -lgomp 
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlsym'
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlopen'
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlclose'
collect2: ld returned 1 exit status
make[1]: *** [cdpLUDecomposition] Error 1

我是 Ubuntu 和 Cuda 的新手,但尝试在 make 之前添加 LD_FLAGS=-ldl 没有帮助,并将 PATH 和 LD_LIBRARY_PATH 设置为 Nvidia 建议。我还更新了所有驱动程序,并且能够从 SDK deviceQuery Program 获得有效结果。

任何帮助将不胜感激,因为我尝试过的所有其他方法都没有奏效。

【问题讨论】:

  • 您使用的是哪个版本的 Ubuntu?
  • 它不是受支持的操作系统。您可以在安装程序release notes 中查看支持的操作系统。如果您不关心 cdpLUDecomposition 示例,您可以使用make -k 而不是常规的 make,它会构建它可以构建的所有目标。这是某种库命名或安装位置问题,其他人在尝试在 ubuntu 12.xx 上运行时遇到类似问题,例如 this one。
  • 谢谢罗伯特。我确实看到 12.04 不在受支持的列表中,但没有与该问题建立联系。
  • 使用 make -k 确实像你说的那样工作,我认为这是唯一产生错误的例子。希望对 12.04 的全面支持很快就会到来。
  • @user582184:我在新的 Ubuntu 上遇到了类似的问题,但与 CUDA 无关。您可以尝试将“-ldl”链接器标志放在链接器命令的最后。希望这会有所帮助

标签: ubuntu cuda nvidia


【解决方案1】:

添加-ldl 就足够了。进入示例目录(cd 6_Advanced/cdpLUDecomposition),检查构建命令make。在我的机器上是

/usr/local/cuda-5.0/bin/nvcc -m64 -Xcompiler -fopenmp -gencode arch=compute_35,code=sm_35 -o cdpLUDecomposition dlaswp.o dgetf2.o dgetrf.o cdp_lu.o cdp_lu_main.o -L /usr/local/cuda-5.0/lib64 -lcublas -lcublas_device -lcudadevrt -lgomp

你可以

  • 运行构建命令手动附加-ldl,或
  • 通过将 -ldl 附加到正确的 LDFLAGS(第 89 行)来修复目录中的 Makefile,这对于下一次重建来说更清洁、更安全

ldd cdpLUDecomposition 然后显示它链接到 /lib/x86_64-linux-gnu/libdl.so.2。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-20
    • 2015-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-14
    • 2017-05-14
    相关资源
    最近更新 更多