这个解决方案对我有用 Ubuntu16.04LTS
Ubuntu16.04LTS
sudo apt-get install libhdf5-10 sudo apt-get install libhdf5-serial-dev sudo apt-get install libhdf5-dev sudo apt-get install libhdf5-cpp-11 find /usr -iname "*hdf5.h*" /usr/include/hdf5/serial/hdf5.h export CPATH="/usr/include/hdf5/serial/"
我经历过的另一个案例:
我正在使用Ubuntu 14.04并进行安装 的 hdf5-1.10.0 强> 。
我发现 hdf5.h 位于 /usr/local/hdf5/include 。因此,我修改了 Makefile.config 通过将该位置添加到文件 INCLUDE_DIRS 。
hdf5.h
/usr/local/hdf5/include
Makefile.config
INCLUDE_DIRS
# Whatever else you find you need goes here. INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include \ /usr/local/hdf5/include
我没有重命名 Makefile 。它工作正常。
Makefile
你的Ubuntu安装版本是什么?试试这个。在你的 Makefile.config 试着追加 /usr/include/hdf5/serial/ 至 INCLUDE_DIRS :
/usr/include/hdf5/serial/
--- INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include +++ INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
并重命名 hdf5_hl 和 hdf5 至 hdf5_serial_hl 和 hdf5_serial 在里面 Makefile :
hdf5_hl
hdf5
hdf5_serial_hl
hdf5_serial
--- 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
有关错误修复的更多信息 这里 。