Cannot compile caffe on Ubuntu 18 with RTX 2080ti with error - cannot find -lhdf5. Please help!

264 views
Skip to first unread message

Wandering Turtle

unread,
Oct 10, 2018, 7:34:38 AM10/10/18
to Caffe Users
Hi there,

I am trying to compile caffe from source on ubuntu 18.04 with cuda 10, cudnn 7.3 but i am getting this error when i run the make all command:

AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:582: recipe for target '.build_release/lib/libcaffe.so.1.0.0' failed

i have tried the command to make symbolic links with this:

cd /usr/lib/x86_64-linux-gnu

sudo ln -s libhdf5_serial.so.10.1.0 libhdf5.so

sudo ln -s libhdf5_serial_hl.so.10.0.2 libhdf5_hl.so 

and added this to the makefile.config

# Whatever else you find you need goes here.
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 /usr/lib/x86_64-linux-gnu/hdf5/serial

when i try locate hdf5.h i get:


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


someone please help! thanks

Wandering Turtle

unread,
Oct 10, 2018, 7:46:03 AM10/10/18
to Caffe Users
Turns out repeating those steps seems to have sorted it not sure what happened there...

Yacine Benahmed

unread,
Nov 7, 2018, 10:27:19 PM11/7/18
to Caffe Users
Hi,

I know you already solved the problem but it might still help others...
For me what resolved it was using 

NVCCFLAGS="-I/usr/include/hdf5/serial" CXXFLAGS="-I/usr/include/hdf5/serial -I/usr/include/pythonx.x" make all
Reply all
Reply to author
Forward
0 new messages