【问题标题】:Can't find lhdf5 while installing caffe安装caffe时找不到lhdf5
【发布时间】:2017-03-01 17:56:24
【问题描述】:

我在尝试运行 caffe 的 make 文件时收到此错误消息。

LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:567: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1

我已经尝试按照这些instructions 进行符号链接,但无济于事。我已经阅读了关于 hdf5 的其他帖子并查看了 /usr/lib/x86_64-linux-gnu 中的符号链接。

drwxr-xr-x  3 root root     4096 Aug 29 16:43 hdf5
-rw-r--r--  1 root root  6075302 Apr  5  2016 libhdf5_cpp.a
lrwxrwxrwx  1 root root       21 Apr  5  2016 libhdf5_cpp.so -> libhdf5_cpp.so.11.0.0
lrwxrwxrwx  1 root root       21 Apr  5  2016 libhdf5_cpp.so.11 -> libhdf5_cpp.so.11.0.0
-rw-r--r--  1 root root   402080 Apr  5  2016 libhdf5_cpp.so.11.0.0
-rw-r--r--  1 root root    40108 Apr  5  2016 libhdf5_hl_cpp.a
lrwxrwxrwx  1 root root       24 Apr  5  2016 libhdf5_hl_cpp.so -> libhdf5_hl_cpp.so.11.0.0
lrwxrwxrwx  1 root root       24 Apr  5  2016 libhdf5_hl_cpp.so.11 -> libhdf5_hl_cpp.so.11.0.0
-rw-r--r--  1 root root    14688 Apr  5  2016 libhdf5_hl_cpp.so.11.0.0
lrwxrwxrwx  1 root root       27 Oct 19 08:59 libhdf5_hl.so -> libhdf5_serial_hl.so.10.0.2
-rw-r--r--  1 root root 19953086 Apr  5  2016 libhdf5_serial.a
-rw-r--r--  1 root root  1659560 Apr  5  2016 libhdf5_serial_fortran.a
lrwxrwxrwx  1 root root       32 Apr  5  2016 libhdf5_serial_fortran.so -> libhdf5_serial_fortran.so.10.0.2
lrwxrwxrwx  1 root root       32 Apr  5  2016 libhdf5_serial_fortran.so.10 -> libhdf5_serial_fortran.so.10.0.2
-rw-r--r--  1 root root   238408 Apr  5  2016 libhdf5_serial_fortran.so.10.0.2
-rw-r--r--  1 root root   878832 Apr  5  2016 libhdf5_serial_hl.a
-rw-r--r--  1 root root   515320 Apr  5  2016 libhdf5_serialhl_fortran.a
lrwxrwxrwx  1 root root       34 Apr  5  2016 libhdf5_serialhl_fortran.so -> libhdf5_serialhl_fortran.so.10.0.2
lrwxrwxrwx  1 root root       34 Apr  5  2016 libhdf5_serialhl_fortran.so.10 -> libhdf5_serialhl_fortran.so.10.0.2
-rw-r--r--  1 root root    80520 Apr  5  2016 libhdf5_serialhl_fortran.so.10.0.2
lrwxrwxrwx  1 root root       27 Apr  5  2016 libhdf5_serial_hl.so.10 -> libhdf5_serial_hl.so.10.0.2
-rw-r--r--  1 root root   126232 Apr  5  2016 libhdf5_serial_hl.so.10.0.2
-rw-r--r--  1 root root     3859 Apr  5  2016 libhdf5_serial.settings
lrwxrwxrwx  1 root root       24 Oct 19 08:57 libhdf5.so -> libhdf5_serial.so.10.1.0

我没有发现任何问题。我将如何重新安装 hdf5?

【问题讨论】:

  • 这适用于 hdf5 吗?
  • 你是从源代码还是通过 apt-get 安装 hdf5?
  • 我按照 caffe 的说明用 apt-get 安装了 libhdf5-serial-dev。
  • 试试这个命令find . -type f -exec sed -i -e 's^"hdf5.h"^"hdf5/serial/hdf5.h"^g' -e 's^"hdf5_hl.h"^"hdf5/serial/hdf5_hl.h"^g' '{}' \; cd /usr/lib/x86_64-linux-gnu sudo ln -s libhdf5_serial.so.10.1.0 libhdf5.so sudo ln -s libhdf5_serial_hl.so.10.0.2 libhdf5_hl.so

标签: ubuntu caffe hdf5


【解决方案1】:

问题是链接器正在寻找libhdf5_cpp.so,但你只有libhdf5_cpp.so.11.0.0

快速破解是将libhdf5_cpp.so.11.0.0 符号链接到libhdf5_cpp.so

【讨论】:

  • lrwxrwxrwx 1 root root 21 Oct 20 12:35 libhdf5_cpp.so -> libhdf5_cpp.so.11.0.0 我已经按照您的建议创建了一个符号链接,但我仍然收到错误消息。有任何想法吗? AR -o .build_release/lib/libcaffe.a LD -o .build_release/lib/libcaffe.so.1.0.0-rc3 /usr/bin/ld: cannot find -lhdf5 collect2: error: ld returned 1 exit status Makefile:567: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
  • fileName.so 也是fileName.so.11.0.0 的符号链接。这样,您可以在系统中拥有多个版本的库,如果应用程序需要特定版本,它可以链接到它,而通常,最新的版本由符号链接选择。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-19
  • 1970-01-01
  • 2020-07-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多