编译Caffe:未定义的符号_H5LTfind_dataset

时间:2016-08-02 19:07:14

标签: macos caffe

我最近在我的Mac OS X El Capitan 10.11.4中编译了一些问题。它有AMD gpu。所以我使用的是CPU_ONLY模式。

这是caffe配置摘要:

-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   <TODO> (Caffe doesn't declare its version in headers)
--   Git               :   unknown
--   System            :   Darwin
--   C++ compiler      :   /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
--   Release CXX flags :   -O3 -DNDEBUG -I/usr/local/opt/openblas/include -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Debug CXX flags   :   -g -I/usr/local/opt/openblas/include -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Build type        :   Release
-- 
--   BUILD_SHARED_LIBS :   ON
--   BUILD_python      :   ON
--   BUILD_matlab      :   OFF
--   BUILD_docs        :   ON
--   CPU_ONLY          :   ON
-- 
-- Dependencies:
--   BLAS              :   Yes (vecLib)
--   Boost             :   Yes (ver. 1.57)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 2.6.1)
--   lmdb              :   Yes (ver. 0.9.14)
--   Snappy            :   Yes (ver. 1.1.3)
--   LevelDB           :   Yes (ver. 1.18)
--   OpenCV            :   Yes (ver. 2.4.13)
--   CUDA              :   No
-- 
-- Python:
--   Interpreter       :   /usr/local/bin/python2.7 (ver. 2.7.12)
--   Libraries         :   /usr/lib/libpython2.7.dylib (ver 2.7.10)
--   NumPy             :   /usr/local/lib/python2.7/site-packages/numpy/core/include (ver 1.11.1)
-- 
-- Documentaion:
--   Doxygen           :   No
--   config_file       :   
-- 
-- Install:
--   Install path      :   /Users/dipanshaw/Desktop/caffe-test/install
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/dipanshaw/Desktop/caffe-test

运行make all后,它会遇到以下错误:

[  1%] Built target proto
[  3%] Linking CXX shared library ../../lib/libcaffe.dylib

    Undefined symbols for architecture x86_64:
      "_H5LTfind_dataset", referenced from:
          void caffe::hdf5_load_nd_dataset_helper<float>(int, char const*, int, int, caffe::Blob<float>*) in io.cpp.o
          void caffe::hdf5_load_nd_dataset_helper<double>(int, char const*, int, int, caffe::Blob<double>*) in io.cpp.o
      "_H5LTget_dataset_info", referenced from:
          void caffe::hdf5_load_nd_dataset_helper<float>(int, char const*, int, int, caffe::Blob<float>*) in io.cpp.o
          void caffe::hdf5_load_nd_dataset_helper<double>(int, char const*, int, int, caffe::Blob<double>*) in io.cpp.o
      "_H5LTget_dataset_ndims", referenced from:
          void caffe::hdf5_load_nd_dataset_helper<float>(int, char const*, int, int, caffe::Blob<float>*) in io.cpp.o
          void caffe::hdf5_load_nd_dataset_helper<double>(int, char const*, int, int, caffe::Blob<double>*) in io.cpp.o
      "_H5LTmake_dataset_double", referenced from:
          void caffe::hdf5_save_nd_dataset<double>(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, caffe::Blob<double> const&) in io.cpp.o
      "_H5LTmake_dataset_float", referenced from:
          void caffe::hdf5_save_nd_dataset<float>(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, caffe::Blob<float> const&) in io.cpp.o
      "_H5LTread_dataset_double", referenced from:
          void caffe::hdf5_load_nd_dataset<double>(int, char const*, int, int, caffe::Blob<double>*) in io.cpp.o
      "_H5LTread_dataset_float", referenced from:
          void caffe::hdf5_load_nd_dataset<float>(int, char const*, int, int, caffe::Blob<float>*) in io.cpp.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [lib/libcaffe.dylib] Error 1
    make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
    make: *** [all] Error 2

还有其他人遇到同样的问题吗?

1 个答案:

答案 0 :(得分:0)

看起来您需要安装hdf5库。我会更密切地遵循OS X指令:http://caffe.berkeleyvision.org/install_osx.html