解决办法是依据出现错误的顺序而给出的,为了方便,可以直接先执行所有解决办法后再安装caffe。
1. ./include/caffe/common.hpp:5:27: fatal error: gflags/gflags.h: No such file or directory
解决办法:sudo apt-get install libgflags-dev
2. ./include/caffe/util/mkl_alternate.hpp:14:19: fatal error: cblas.h: No such file or directory
解决办法:sudo apt-get install libblas-dev
3. ./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory
解决办法:在Makefile.config找到以下行并添加蓝色部分
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/hdf5/serial
4. ./include/caffe/util/db_lmdb.hpp:8:18: fatal error: lmdb.h: No such file or directory
解决办法:sudo apt install liblmdb-dev