Caffe学习笔记11:Ubuntu 16.04 中 caffe 编译出现的错误——fatal error: hdf5.h: 没有那个文件或目录

step 1:

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libhdf5_serial.so.8.0.2 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so

step 2:

change Makefile.config
//打开Makefile.config将下面的
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
//修改为:
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial
//这是因为ubuntu16.04的文件包含位置发生了变化,尤其是需要用到的hdf5的位置,所以需要更改这一路径

step 3:

change Makefile
//打开Makefile将下面的
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
//修改为:
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

猜你喜欢

转载自blog.csdn.net/weixin_41774576/article/details/82389733
今日推荐