- /usr/bin/ld: cannot find -lgflahs and -lhdf5_serial_h1

What does this error mean, during caffe compilation ? How shall I fix it?

Commands:

cd /home/aegono/CTPN/caffe
sudo make

Output:

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

I already installed the modules but I do not know how to link them and what files shall be linked and where shall I find them. I tried the command below with no luck. Am I doing the right thing?

sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100.0.0 /usr/lib/x86_64-linux-gnu/hdf5_serial_h1

/home/aegono/CTPN/caffe is the location of my caffe package. In /usr/lib/x86_64-linux-gnu/ when I look for the word gflahs, I could not find anything but when I look for the word gflags using the command ls -l | grep 'gflags' , below are the results :

root@ubuntu_18-04-4_live_server:/usr/lib/x86_64-linux-gnu# ls -l | grep "gflags"
-rw-r--r-- 1 root root 258068 Aug 6 2017 libgflags.a
-rw-r--r-- 1 root root 256002 Aug 6 2017 libgflags_nothreads.a
lrwxrwxrwx 1 root root 26 Aug 6 2017 libgflags_nothreads.so ->
libgflags_nothreads.so.2.2
lrwxrwxrwx 1 root root 28 Aug 6 2017 libgflags_nothreads.so.2.2 ->
libgflags_nothreads.so.2.2.1
-rw-r--r-- 1 root root 146096 Aug 6 2017 libgflags_nothreads.so.2.2.1
lrwxrwxrwx 1 root root 16 Aug 6 2017 libgflags.so ->
libgflags.so.2.2
lrwxrwxrwx 1 root root 18 Aug 6 2017 libgflags.so.2.2 ->
libgflags.so.2.2.1
-rw-r--r-- 1 root root 150248 Aug 6 2017 libgflags.so.2.2.1

And when I look for hdf5 using the command ls -l | grep 'hdf5_serial', below are the result:

root@ubuntu_18-04-4_live_server:/usr/lib/x86_64-linux-gnu# ls -l | grep "hdf5_serial"
lrwxrwxrwx 1 root root 54 Mar 24 06:01 hdf5_serial_h1 -> /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100.0.0
lrwxrwxrwx 1 root root 54 Mar 24 06:22 hdf5_serial_h1.so -> /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100.0.0
lrwxrwxrwx 1 root root 54 Mar 23 19:22 lhdf5_serial_h1 -> /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100.0.0
-rw-r--r-- 1 root root 8028880 Aug 13 2017 libhdf5_serial.a
-rw-r--r-- 1 root root 398412 Aug 13 2017 libhdf5_serial_fortran.a
lrwxrwxrwx 1 root root 33 Aug 13 2017 libhdf5_serial_fortran.so -> libhdf5_serial_fortran.so.100.0.1
lrwxrwxrwx 1 root root 33 Aug 13 2017 libhdf5_serial_fortran.so.100 -> libhdf5_serial_fortran.so.100.0.1
-rw-r--r-- 1 root root 250760 Aug 13 2017 libhdf5_serial_fortran.so.100.0.1
-rw-r--r-- 1 root root 245840 Aug 13 2017 libhdf5_serial_hl.a
-rw-r--r-- 1 root root 187354 Aug 13 2017 libhdf5_serialhl_fortran.a
lrwxrwxrwx 1 root root 35 Aug 13 2017 libhdf5_serialhl_fortran.so -> libhdf5_serialhl_fortran.so.100.0.0
lrwxrwxrwx 1 root root 35 Aug 13 2017 libhdf5_serialhl_fortran.so.100 -> libhdf5_serialhl_fortran.so.100.0.0
-rw-r--r-- 1 root root 121400 Aug 13 2017 libhdf5_serialhl_fortran.so.100.0.0
lrwxrwxrwx 1 root root 28 Aug 13 2017 libhdf5_serial_hl.so -> libhdf5_serial_hl.so.100.0.0
lrwxrwxrwx 1 root root 28 Aug 13 2017 libhdf5_serial_hl.so.100 -> libhdf5_serial_hl.so.100.0.0
-rw-r--r-- 1 root root 138576 Aug 13 2017 libhdf5_serial_hl.so.100.0.0
-rw-r--r-- 1 root root 4084 Aug 13 2017 libhdf5_serial.settings
lrwxrwxrwx 1 root root 25 Aug 13 2017 libhdf5_serial.so -> libhdf5_serial.so.100.0.1
lrwxrwxrwx 1 root root 25 Aug 13 2017 libhdf5_serial.so.100 -> libhdf5_serial.so.100.0.1
-rw-r--r-- 1 root root 3495976 Aug 13 2017 libhdf5_serial.so.100.0.1
lrwxrwxrwx 1 root root 51 Mar 23 19:17 libhdf5.so -> /usr/lib/x86_64-linux-gnu/libhd

1 Answer

What does this error mean, during caffe compilation ? How shall I fix it?

It means someone mistyped the library names, perhaps when editing Makefile.config.

"gflahs" is supposed to be "gflags"

"hdf5_serial_h1" is actually "hdf5_serial_hl" (that's a lowercase L, not a number).

I already installed the modules but I do not know how to link them and what files shall be linked and where shall I find them. I tried the command below with no luck. Am I doing the right thing?

No. Whenever you use -lfoo, the loader already knows that it should look for libfoo.so.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like