gpt4 book ai didi

python - 构建pycaffe时找不到hdf5库

转载 作者:行者123 更新时间:2023-12-04 19:16:32 27 4
gpt4 key购买 nike

运行时

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 库不是核心问题。

更新 回应@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

最佳答案

运行 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 中的 LIBRARY_DIRS

关于python - 构建pycaffe时找不到hdf5库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35738297/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com