caffe+anaconda2编译hdf5报错问题

来源:互联网 发布:人民网数据新闻 编辑:程序博客网 时间:2024/06/05 00:38

关于不同版本动态链接

http://blog.csdn.net/dodomouse/article/details/39138493

今天在编译caffe的时候,报出以下错误

 error while loading shared libraries: libhdf5_hl.so.10: cannot open shared object file: No such file

提示是找不到动态链接库。于是找到hdf5的动态链接库位置,我的是在/usr/local/hdf5/lib/下:

发现目录结构是这样的:

-rwxrwxrwx 1 root     root     6001668  7月 12  2015 libhdf5.a*
-rwxrwxrwx 1 root     root      217024  7月 12  2015 libhdf5_hl.a*
-rwxrwxrwx 1 root     root        1093  7月 12  2015 libhdf5_hl.la*
lrwxrwxrwx 1 root     root          19  7月 12  2015 libhdf5_hl.so -> libhdf5_hl.so.9.0.0*
lrwxrwxrwx 1 root     root          19  7月 12  2015 libhdf5_hl.so.9 -> libhdf5_hl.so.9.0.0*
-rwxrwxrwx 1 root     root      148127  7月 12  2015 libhdf5_hl.so.9.0.0*
-rwxrwxrwx 1 root     root        1013  7月 12  2015 libhdf5.la*
-rwxrwxrwx 1 root     root        3201  7月 12  2015 libhdf5.settings*
lrwxrwxrwx 1 root     root          16  7月 12  2015 libhdf5.so -> libhdf5.so.9.0.0*
lrwxrwxrwx 1 root     root          16  7月 12  2015 libhdf5.so.9 -> libhdf5.so.9.0.0*
-rwxrwxrwx 1 root     root     3242545  7月 12  2015 libhdf5.so.9.0.0*

即:并没有libhdf5_hl.so.10的存在。

开始尝试使用软链接来生成,编译通过但是在后面运行程序时会提示找不到动态库。

尝试过:将软链接后的库文件路径添加至LD_LIBRARY_PATH可以解决问题。

经过看这两个帖子:

https://github.com/BVLC/caffe/issues/1463

http://blog.csdn.net/donatellobzero/article/details/51304162

发现原因是因为我使用了anaconda来编译python,而anaconda中使用的则是libhdf5_hl.so.10,但是我并没有把ananconda的lib路径添加因此报错。

于是把anacnoda的lib下的libhdf5_hl.so.10文件拷贝至/usr/local/hdf5/lib下也可以解决问题

0 0
原创粉丝点击