1. 程式人生 > >配F-RCN遇到的問題(hdf5.h: 沒有那個檔案或目錄)及解決

配F-RCN遇到的問題(hdf5.h: 沒有那個檔案或目錄)及解決

問題:

src/caffe/net.cpp:8:18: fatal error: hdf5.h: 沒有那個檔案或目錄

compilation terminated.
Makefile:575: recipe for target '.build_release/src/caffe/net.o' failed

make: *** [.build_release/src/caffe/net.o] Error 1

解決方案:

Step 1

Makefile.config檔案的第85行,新增/usr/include/hdf5/serial/ 到 INCLUDE_DIRS,也就是把下面第一行程式碼改為第二行程式碼。

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

Step 2

Makefile檔案的第173行,把 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

如果還沒解決,則:

find /usr-iname"*hdf5.h*"

/usr/include/hdf5/serial/hdf5.h

export CPATH="/usr/include/hdf5/serial/"

然後 make clean

make -j8