Search code examples
caffecaffe2

Hdf5 error while installing the caffe on Ubuntu 16.04?


I am trying to install the caffe in Ubuntu 16.04. I followed the steps as mentioned in the docs. Everything is fine, but my Machine is installed with CUDA toolkit 9, but doc says ver 8 - Hopefully this is not a problem(I guess). But when I try to compile it caffe repo I am getting the below error -

usr1@ubox:~/SDK/caffe$ cp Makefile.config.example Makefile.config
usr1@ubox:~/SDK/caffe$ 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: No such file or directory
compilation terminated.
Makefile:581: recipe for target '.build_release/src/caffe/solver.o' failed
make: *** [.build_release/src/caffe/solver.o] Error 1

Solution

  • I solved this by installing libhdf5 but I think that is not mentioned in docs. However, below command saved my day. enter link description here

    sudo apt-get install libhdf5-10
    sudo apt-get install libhdf5-serial-dev
    sudo apt-get install libhdf5-dev
    sudo apt-get install libhdf5-cpp-11
    find /usr -iname "*hdf5.h*"
    /usr/include/hdf5/serial/hdf5.h
    /usr/include/opencv2/flann/hdf5.h
    export CPATH="/usr/include/hdf5/serial/"