【问题标题】:Error building caffe - cannot find -lhdf5_hl构建 caffe 时出错 - 找不到 -lhdf5_hl
【发布时间】:2018-11-08 16:03:53
【问题描述】:

我按照本指南安装 caffe。我正在使用 ubuntu 16.04 并仅为 cpu 安装 caffe(我没有 Nvidia gpu)。 https://chunml.github.io/ChunML.github.io/project/Installing-Caffe-CPU-Only/
但是遇到如下错误:

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

有人可以帮我弄清楚如何克服这个问题吗?谢谢

【问题讨论】:

标签: linux ubuntu build caffe


【解决方案1】:

/usr/bin/ld: 找不到 -lhdf5_hl

-lhdf5_hl 表示libhdf5_hl.so

sudo apt install apt-file
sudo apt-file update
apt-file search libhdf5_hl.so
libhdf5-dev: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.so
libhdf5-mpich-dev: /usr/lib/x86_64-linux-gnu/hdf5/mpich/libhdf5_hl.so
libhdf5-openmpi-dev: /usr/lib/x86_64-linux-gnu/hdf5/openmp/libhdf5_hl.so

或者使用在线Debian搜索https://packages.debian.org/search?suite=buster&section=all&arch=any&searchon=contents&keywords=libhdf5_hl.so

【讨论】:

  • 这并不能解决错误。我相信这可能是因为该文件在系统中以某些后缀命名,因此需要对该文件进行链接。
【解决方案2】:

这为我解决了它

sudo ln -sf libhdf5_serial.so libhdf5.so
sudo ln -sf libhdf5_serial_hl.so libhdf5_hl.so

如何在 linux 中符号链接文件 - https://stackoverflow.com/a/1951752/6612871

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-15
    • 1970-01-01
    • 1970-01-01
    • 2017-05-04
    • 2020-06-22
    • 2014-06-04
    • 2017-05-03
    • 1970-01-01
    相关资源
    最近更新 更多