错误:ld在安装期间返回1退出状态

时间:2016-05-08 06:53:52

标签: deep-learning caffe

我仍在进行 Caffe安装,但现在我遇到了一个新问题。当我运行make命令时,会出现一个新的错误按摩:

LD -o .build_release/lib/libcaffe.so.1.0.0-rc3

/usr/bin/ld: cannot find -lhdf5_hl

/usr/bin/ld: cannot find -lhdf5

/usr/bin/ld: cannot find -lopencv_imgcodecs

collect2: error: ld returned 1 exit status

Makefile:563: 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

我很确定我已经拥有了所有依赖项。 希望可以有人帮帮我。谢谢。

2 个答案:

答案 0 :(得分:1)

无法找到到达文件的方式。我的意思是这里的文件是libhdf5_hl.solibhdf5.solibopencv_imgcodecs.so

打开Makefile.config文件,您将找到以下内容:

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

这意味着我在默认LIBRARY_DIRS中找不到上面提到的3个文件。搜索usr个子目录。 如果您找到了该位置,例如/usr/local/hdf5/lib,则将其添加到LIBRARY_DIRS

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/hdf5/lib

答案 1 :(得分:0)

您需要创建指向缺少的库文件的符号链接。对于hdf5,您可以这样做:

ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10.0.1 /usr/lib/x86_64-linux-gnu/libhdf5.so
ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10.0.1 /usr/lib/x86_64-linux-gnu/libhdf5_hl.so

在创建符号链接之前,请检查库文件和操作系统的版本。对我来说它是10.0.1而我的操作系统是Ubuntu 15.10。

相关问题