/usr/bin/ld: cannot find -lhdf5_hl

5,816 views
Skip to first unread message

Stuart Kerr

unread,
May 3, 2015, 2:53:42 AM5/3/15
to caffe...@googlegroups.com
I am running Ubuntu 15.04.  During 'make all' I get:

/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:502: recipe for target '.build_release/lib/libcaffe.so' failed
make: *** [.build_release/lib/libcaffe.so] Error 1


I've been fixing things as they come up, but am stumped on this one. Sincerely appreciate any help with this.

- stu

Boaz

unread,
May 3, 2015, 4:35:59 PM5/3/15
to caffe...@googlegroups.com
Make sure you have the hdf5 libraries installed.

Stuart Kerr

unread,
May 3, 2015, 7:12:59 PM5/3/15
to Boaz, caffe...@googlegroups.com
Boaz:  Thanks for responding. I have ensured the latest hdf5 libraries are installed (I think the below apt-get tells me that):

$ sudo apt-get install libhdf5-serial-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libhdf5-serial-dev is already the newest version.

Dumb Question: Is this part of the make file compiing libcaffe.a into libcaffe.so? If not, i do note that libcaffe.so is not within the ./build_release/lib directory. 

I sincerely welcome any other ideas that you may have...

- Stu

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/gOLL29NmTwA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/392e507f-ebe8-4205-b37d-9a2566b472d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Boaz

unread,
May 4, 2015, 9:37:51 AM5/4/15
to caffe...@googlegroups.com, boaz....@gmail.com
It seems the hdf5 libraries are indeed installed.
You can try running ldconfig, other than that i've no idea why the linker cannot find the hdf5 libraries. Can you locate them manually or with something like: dpkg -L libhdf5-serial-dev ?

And no, it is not compiling a .a into a .so. A .a file is usually a static library and a .so a dynamic library. It is also not strange that there is no libcaffe.a/.so built in that directory yet because of the above linker error.

Stuart Kerr

unread,
May 4, 2015, 11:59:49 AM5/4/15
to Boaz, caffe...@googlegroups.com
Hi Boaz:

Following up here. Finally successfully made it through the caffe make process. I think the issue was:

I am running Ubuntu 15.04 In the Makefile.config, appended to LIBRARY_DIRS:

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial

Thank you for your assistance.

-stu

Chris Davis

unread,
May 14, 2015, 3:19:21 AM5/14/15
to caffe...@googlegroups.com, boaz....@gmail.com
I've run into the same issue on Ubuntu 15.04, and also ran into a problem with it not being able to find the hdf5 headers which were already installed.  To get everything to compile after a fresh clone from github, I just changed the following in 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

Chris

Samuel Goodell

unread,
Jun 28, 2015, 11:50:18 PM6/28/15
to caffe...@googlegroups.com, boaz....@gmail.com
I have the same issue and have tried this solution (I believe it was also necessary earlier on as well).  Still, adding this doesn't affect my compilation and I still get the error.

My /usr/include/hdf5/serial directory does contain hdf5.h and hdf5_hl.h header files, but the linker doesn't seem to recognize them.  I did run cp Makefile.config.example Makefile.config after updating it...

Any ideas?

ranju mandal

unread,
Oct 1, 2015, 7:49:07 AM10/1/15
to Caffe Users
Hi Stuart,

Please append your Library dir in Makefile.Config and change it to the following line. I hope the problem will be solved.

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/i386-linux-gnu/hdf5/serial
Reply all
Reply to author
Forward
0 new messages