我正在为 tensorflow 构建一个自定义的 debian 包。在某个时候,当我运行
dpkg-buildpackage -us -uc
我得到:
dpkg-shlibdeps: error: no dependency information found for /usr/local/cuda-9.1/lib64/libcurand.so.9.1 (used by debian/libhal-tensorflow-cc/usr/lib/libtensorflow_framework.so)
Hint: check if the library actually comes from a package.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/libhal-tensorflow-cc.substvars debian/libhal-tensorflow-cc/usr/lib/libtensorflow_cc.so debian/libhal-tensorflow-cc/usr/lib/libtensorflow_framework.so returned exit code 2
debian/rules:9: recipe for target 'binary' failed
我查看了这个页面:https://manpages.debian.org/jessie/dpkg-dev/dpkg-shlibdeps.1.en.html 并尝试按照此工具执行的步骤获取依赖项信息:
$ dpkg -S libcurand.so.9.1
cuda-curand-9-1: /usr/local/cuda-9.1/targets/x86_64-linux/lib/libcurand.so.9.1
cuda-curand-9-1: /usr/local/cuda-9.1/targets/x86_64-linux/lib/libcurand.so.9.1.85
实际上,这个包有一个对应的.shlibs文件:
$ cat /var/lib/dpkg/info/cuda-curand-9-1.shlibs
libcurand 9.1 cuda-curand-9-1
我检查了该包是否确实已安装,并且是:
$ apt list | grep cuda-curand-9-1
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
cuda-curand-9-1/unknown,now 9.1.85-1 amd64 [installed,automatic]
所以我不知道它抱怨什么
答案1
事实证明我链接了一个错误的 so。该库libtensorflow_framework.so
正在使用:
/usr/local/cuda-9.1/lib64/libcurand.so.9.1
当我安装
/usr/local/cuda-9.1/targets/x86_64-linux/lib/libcurand.so.9.1
这是因为该库libtensorflow_framework.so
是在不同的机器上构建的,而 CUDA 安装在不同的位置。