- /usr/bin/ld: 找不到 -lgflahs 和 -lhdf5_serial_h1

- /usr/bin/ld: 找不到 -lgflahs 和 -lhdf5_serial_h1

此错误是什么意思?咖啡编译?我该如何修复它?

命令:

cd /home/aegono/CTPN/caffe
sudo make

输出:

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

我已经安装了模块,但我不知道如何链接它们,应该链接哪些文件以及在哪里可以找到它们。我尝试了下面的命令,但没有成功。我做对了吗?

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/caffecaffe是我的包的存放位置。/usr/lib/x86_64-linux-gnu/当我搜索单词时gflahs,我找不到任何东西,但是当我gflags使用命令搜索单词时ls -l | grep 'gflags',结果如下:

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

hdf5当我使用命令查找时ls -l | grep 'hdf5_serial',结果如下:

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

在 caffe 编译期间,这个错误是什么意思?我该如何修复它?

这意味着有人在编辑时输入了错误的库名称Makefile.config

Hs” 应该是“gflaGs”

“hdf5_serial_h1“实际上是”hdf5_serial_h“(这是小写的L,不是数字)。

我已经安装了模块,但我不知道如何链接它们,应该链接哪些文件以及在哪里可以找到它们。我尝试了下面的命令,但没有成功。我做对了吗?

否。无论何时使用,加载程序-lfoo已经知道它应该寻找。libfoo.so

相关内容