安裝caffe過程中遇到的hdf5問題
每次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/之中有一個空格,切記一定要加空格!一定要加空格!一定要加空格!我就是在加上空格之後才順利完成了編譯