修复孤立的 libhdf5.so 和 libhdf5_hl.so 库导致 Caffe 编译错误
repair orphaned libhdf5.so and libhdf5_hl.so libraries leads to Caffe compilation errors
在我的 /usr/lib/x86_64-linux-gnu 目录中有两个红色的库,
libhdf5.so and libhdf5_hl.so
我的理解是这些是孤立的 symlinks.I 删除了它们但现在需要创建新的。
我确实找到了这些文件
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
所以我创建了新的符号链接,现在它们是蓝绿色的。
但是我在编译 CAFFE 时遇到了这些错误
src/caffe/net.cpp:774:7: error: there are no arguments to ‘H5Fis_hdf5’ that depend on a template parameter, so a declaration of ‘H5Fis_hdf5’ must be available [-fpermissive]
if (H5Fis_hdf5(trained_filename.c_str())) {
^~~~~~~~~~
src/caffe/net.cpp:774:7: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
src/caffe/net.cpp: In instantiation of ‘void caffe::Net<Dtype>::CopyTrainedLayersFrom(const string&) [with Dtype = float; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
src/caffe/net.cpp:992:1: required from here
src/caffe/net.cpp:774:17: error: ‘H5Fis_hdf5’ was not declared in this scope
if (H5Fis_hdf5(trained_filename.c_str())) {
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
src/caffe/net.cpp: In instantiation of ‘void caffe::Net<Dtype>::CopyTrainedLayersFrom(const string&) [with Dtype = double; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
src/caffe/net.cpp:992:1: required from here
src/caffe/net.cpp:774:17: error: ‘H5Fis_hdf5’ was not declared in this scope
Makefile:611: recipe for target '.build_release/src/caffe/net.o' failed
make: *** [.build_release/src/caffe/net.o] Error 1
make: *** Waiting for unfinished jobs....
我是不是链接错了文件?
不,它与库无关,因为您还没有进入链接阶段。你的错误是由于编译失败。参见 this issue,也许会有帮助。
在我的 /usr/lib/x86_64-linux-gnu 目录中有两个红色的库,
libhdf5.so and libhdf5_hl.so
我的理解是这些是孤立的 symlinks.I 删除了它们但现在需要创建新的。 我确实找到了这些文件
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
所以我创建了新的符号链接,现在它们是蓝绿色的。
但是我在编译 CAFFE 时遇到了这些错误
src/caffe/net.cpp:774:7: error: there are no arguments to ‘H5Fis_hdf5’ that depend on a template parameter, so a declaration of ‘H5Fis_hdf5’ must be available [-fpermissive]
if (H5Fis_hdf5(trained_filename.c_str())) {
^~~~~~~~~~
src/caffe/net.cpp:774:7: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
src/caffe/net.cpp: In instantiation of ‘void caffe::Net<Dtype>::CopyTrainedLayersFrom(const string&) [with Dtype = float; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
src/caffe/net.cpp:992:1: required from here
src/caffe/net.cpp:774:17: error: ‘H5Fis_hdf5’ was not declared in this scope
if (H5Fis_hdf5(trained_filename.c_str())) {
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
src/caffe/net.cpp: In instantiation of ‘void caffe::Net<Dtype>::CopyTrainedLayersFrom(const string&) [with Dtype = double; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
src/caffe/net.cpp:992:1: required from here
src/caffe/net.cpp:774:17: error: ‘H5Fis_hdf5’ was not declared in this scope
Makefile:611: recipe for target '.build_release/src/caffe/net.o' failed
make: *** [.build_release/src/caffe/net.o] Error 1
make: *** Waiting for unfinished jobs....
我是不是链接错了文件?
不,它与库无关,因为您还没有进入链接阶段。你的错误是由于编译失败。参见 this issue,也许会有帮助。