Currently, I am trying to get caffe (this one: http://caffe.berkeleyvision.org/installation.html) running on my Ubuntu 16.04 machine. The error am getting when I try to call make is:
CXX src/caffe/layers/conv_layer.cpp
In file included from ./include/caffe/vision_layers.hpp:11:0,
from src/caffe/layers/conv_layer.cpp:3:
./include/caffe/data_layers.hpp:7:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
Makefile:552: recipe for target '.build_release/src/caffe/layers/conv_layer.o' failed
make: *** [.build_release/src/caffe/layers/conv_layer.o] Error 1
I found this thread as a solution to this for some people:
https://stackoverflow.com/questions/24744969/installing-h5py-on-an-ubuntu-server
So I tried in my terminal:
$ sudo apt-get install cython
$ sudo apt-get install libhdf5-dev
$ sudo apt-get install python-h5py
$ HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py
$ pip install h5py
However the error remained. I did find that I had the file here:
/usr/include/hdf5/serial/hdf5.h
How do I make c++ automatically find the file here? It can for example find glog without problem after I installed it using apt-get, but hdf5 seems different. Does anyone know why?
cmake
or autoconf (i.e../configure
)? This is a known issue with the packaging of hdf5 development libraries on recent Debian-based distributions I think.make
: there is likely either acmake
variable that you can define (something likeWITH_HDF5_INCLUDE_DIR
) or an equivalent./configure
variable (something like--with-hdf5-include
). Ultimately, you need to set an appropriate compile flag likeCXXFLAGS=-I/usr/include/hdf5/serial
.