DIGITS: can't find hdf5.h when build caffe
I want to install digits on my debian jessie.
When I build caffe(NVIDIA's fork)
, I got errors complaining that hdf5.h
could not be found.
I’m sure I had installed libhdf5-serial-dev
and libhdf5-dev
, and I found the header file in /usr/include/hdf5/serial
and its libs in /usr/lib/x86_64-linux-gnu
.
So, what’s wrong? Some one help me?
The build error message show below:
(venv)➜ caffe make all --jobs=4
CXX src/caffe/layer_factory.cpp
CXX src/caffe/util/insert_splits.cpp
CXX src/caffe/util/db.cpp
CXX src/caffe/util/upgrade_proto.cpp
In file included from src/caffe/util/upgrade_proto.cpp:10:0:
./include/caffe/util/io.hpp:8:18: fatal error: hdf5.h: no such file or directory
#include "hdf5.h"
^
compilation terminated.
Makefile:512: recipe for target '.build_release/src/caffe/util/upgrade_proto.o' failed
make: *** [.build_release/src/caffe/util/upgrade_proto.o] Error 1
make: *** 正在等待未完成的任务....
In file included from ./include/caffe/common_layers.hpp:10:0,
from ./include/caffe/vision_layers.hpp:10,
from src/caffe/layer_factory.cpp:6:
./include/caffe/data_layers.hpp:9:18: fatal error: hdf5.h: no such file or directory
#include "hdf5.h"
^
compilation terminated.
Makefile:512: recipe for target '.build_release/src/caffe/layer_factory.o' failed
make: *** [.build_release/src/caffe/layer_factory.o] Error 1
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 14
- Comments: 26
Commits related to this issue
- Patched Makefile.config.example. - See https://github.com/NVIDIA/DIGITS/issues/156 — committed to kinsolresearch/caffe by dacox 7 years ago
- Patched Makefile.config.example. - See https://github.com/NVIDIA/DIGITS/issues/156 — committed to kinsolresearch/caffe by dacox 7 years ago
after do the two steps @tangshi mentioned, I continued to add the following lines in MakeFile.config
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
andLIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/
Lucky! I solved the second problem!
The lib names of hdf5 on debian have a postfix “serial”, therefore
-lhdf5
and-lhdf5_hl
cannot be found.To solve it, I created two symbolics:
It did not work for me on
Ubuntu16.04 LTS
.So I had to
https://ahmedibrahimvt.wordpress.com/2017/02/19/fatal-error-hdf5-h-no-such-file-or-directory/ The most perfect answer I have seen
the lbhdf5 you actually have will determine what symlink to do - so after ls /usr/lib/x86_64-linux-gnu to see what version you have, do the symlink taking that into account. (.e.g i had v10 not v8 as in post above)
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10 /usr/lib/x86_64-linux-gnu/libhdf5.so $ sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10 /usr/lib/x86_64-linux-gnu/libhdf5_hl.so
I solved the header file problem according to here.
But there is another problem:
so sad…
ubuntu 16.04 diff --git a/Makefile b/Makefile index 65d08f7…6c6c9f3 100644 — a/Makefile +++ b/Makefile @@ -178,7 +178,8 @@ ifneq ($(CPU_ONLY), 1) LIBRARIES := cudart cublas curand endif
-LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5 +LIBRARIES += glog gflags protobuf boost_system boost_filesystem m +LIBRARIES += hdf5_serial hdf5_serial_hl
Thanks @loretoparisi this worked for me!
Thank you! This worked for me
Worked on ubuntu 18.04, thanks
Note - I had to change:
to
install opencv:
apt-get install libopencv-dev
And had to remove the following lines from the makefile since I am on cuda 9.0:
Thanks a lot… worked in Ubuntu 16…