Ubuntu Can';安装caffe时找不到lhdf5

Ubuntu Can';安装caffe时找不到lhdf5,ubuntu,caffe,hdf5,Ubuntu,Caffe,Hdf5,当我尝试运行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_

当我尝试运行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
我试过按照这些符号链接,但没有用。我阅读了其他关于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?

问题是链接器正在查找
libhdf5\u cpp.so
但您只有
libhdf5\u cpp.so.11.0.0


一个快速的破解方法是将
libhdf5_cpp.so.11.0.0
符号链接到
libhdf5_cpp.so

这是否适用于hdf5?您是从源代码安装了hdf5还是使用apt-get?我根据caffe指令使用apt-get安装了libhdf5串行开发程序。请尝试以下命令
find-键入f-exec sed-i-e的^“hdf5.h”^“hdf5/serial/hdf5.h”^g'-e的^“hdf5\u hl.h”^“hdf5/serial/hdf5\u 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
lrwxrwx rwx 1根目录20年10月21日12:35 libhdf5_cpp.so->libhdf5_cpp.so。有什么想法吗<代码>AR-o.build\u release/lib/libcaffe.a LD-o.build\u release/lib/libcaffe.so.1.0.0-rc3/usr/bin/LD:找不到-lhdf5 collect2:error:LD返回1退出状态Makefile:567:recipe for target'.build\u release/libcaffe.so.1.0.0-rc3'生成失败:**[.build\u release/libcaffe/libcaffe.so.0.0-rc3]错误1
文件名。因此是指向文件名的符号链接。so.11.0.0。这样,您的系统中可以有多个版本的库,如果应用程序需要特定的库,它可以链接到该库,而通常情况下,symlink会选择最新的库。