在构建pycaffe

时间:2016-03-02 04:04:02

标签: python ubuntu hdf5 caffe pycaffe

运行时

make pycaffe

我们最终错过了hdf5个库。

CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:502: recipe for target 'python/caffe/_caffe.so' failed
make: *** [python/caffe/_caffe.so] Error 1

请注意,这个库的每个可以想到的组合都已安装在此ubuntu 15.10系统上。

$ dpkg --get-selections | grep hdf5
hdf5-helpers                    install
libhdf5-10:amd64                install
libhdf5-cpp-10:amd64                install
libhdf5-dev                 install
libhdf5-mpi-dev                 install
libhdf5-mpich-10:amd64              install
libhdf5-mpich-dev               install
libhdf5-openmpi-10:amd64            install
libhdf5-openmpi-dev             install
libhdf5-serial-dev              install

现在我意识到这太过分了......但是他们一次只添加了一个 - 然后我们在添加另一个之前重试make pycaffe我们只是想确保缺少hdf5 libs 不是核心问题。

更新响应@jon提供的答案

 dpkg -L libhdf5-dev | grep so
/usr/lib/x86_64-linux-gnu/libhdf5_cpp.so
/usr/lib/x86_64-linux-gnu/libhdf5_serial.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_fortran.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl_cpp.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5hl_fortran.so
/usr/lib/x86_64-linux-gnu/libhdf5_hl_cpp.so
/usr/lib/x86_64-linux-gnu/libhdf5_serial_fortran.so
/usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so
/usr/lib/x86_64-linux-gnu/libhdf5_serialhl_fortran.so

Makefile.config

LIBRARY_DIRS := /usr/opt/libsr $(PYTHON_LIB) 
   /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu

1 个答案:

答案 0 :(得分:1)

运行dpkg -L libhdf5-dev | grep so应输出:

/usr/lib/x86_64-linux-gnu/libhdf5_hl.so
/usr/lib/x86_64-linux-gnu/libhdf5hl_fortran.so
/usr/lib/x86_64-linux-gnu/libhdf5_fortran.so
/usr/lib/x86_64-linux-gnu/libhdf5_hl_cpp.so
/usr/lib/x86_64-linux-gnu/libhdf5_cpp.so
/usr/lib/x86_64-linux-gnu/libhdf5.so

确保路径/usr/lib/x86_64-linux-gnu(包含libhdf5.solibhdf5_hl.so)位于Makefile.config的{​​{1}}