0

I was following this guide to install caffe. I am using ubuntu 16.04 and installing caffe for cpu only(i don't have Nvidia gpu). https://chunml.github.io/ChunML.github.io/project/Installing-Caffe-CPU-Only/
But encountered the following error :

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

Can someone please help me figure out how to get past this? Thanks

Harshit Nagar
  • 368
  • 3
  • 16
  • Possible duplicate of [usr/bin/ld: cannot find -l](https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary) – Max Vollmer May 29 '18 at 23:20

2 Answers2

0

/usr/bin/ld: cannot find -lhdf5_hl

-lhdf5_hl means libhdf5_hl.so

sudo apt install apt-file
sudo apt-file update
apt-file search libhdf5_hl.so
libhdf5-dev: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.so
libhdf5-mpich-dev: /usr/lib/x86_64-linux-gnu/hdf5/mpich/libhdf5_hl.so
libhdf5-openmpi-dev: /usr/lib/x86_64-linux-gnu/hdf5/openmp/libhdf5_hl.so

Or use the on-line Debian search https://packages.debian.org/search?suite=buster&section=all&arch=any&searchon=contents&keywords=libhdf5_hl.so

Knud Larsen
  • 5,753
  • 2
  • 14
  • 19
  • This does not solve the error. I believe it might be because the file is named with some postfix in the system so a link needs to be made to that file. – Harshit Nagar Jun 01 '18 at 09:20
0

This solved it for me

sudo ln -sf libhdf5_serial.so libhdf5.so
sudo ln -sf libhdf5_serial_hl.so libhdf5_hl.so

how to symlink a file in linux - https://stackoverflow.com/a/1951752/6612871

Harshit Nagar
  • 368
  • 3
  • 16