每次sudo make all时都会出现这样的问题:
CXX src/caffe/solver.cpp
In file included from src/caffe/solver.cpp:9:0:
./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: 没有那个文件或目录
compilation terminated.
Makefile:581: recipe for target ‘.build_release/src/caffe/solver.o’ failed
make: *** [.build_release/src/caffe/solver.o] Error 1
此问题困扰了我一整个晚上,尝试了网上所有的方法依旧无济于事,如添加依赖,还有流传最多的方法:
在Makefile.config文件中,将:INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
改为:INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
在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
我自以为是按上述所说的修改的,可是一直不见效,直到今天早上忽然发现似乎所有的解决方法中
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
在/include /usr/之中有一个空格,切记一定要加空格!一定要加空格!一定要加空格!我就是在加上空格之后才顺利完成了编译