make matcaffe fails on Mac OS X 10.8.x matlab 2014a

632 views
Skip to first unread message

Steven Lobo

unread,
Aug 24, 2014, 2:22:54 PM8/24/14
to caffe...@googlegroups.com
I am newbie to caffe. I followed http://caffe.berkeleyvision.org/installation.html to install all necessary tools using brew. I did make all , make test, make runtest. 
But I am not able to create matalab library using make matcaffe. I am getting following error. I followed the steps mentioned in https://github.com/BVLC/caffe/issues/915 and changed
LIB_DIR. But then too I am getting below error. Anybody suggest how to fix this.

Steven

/Applications/MATLAB_R2014a.app/bin/mex matlab/caffe/matcaffe.cpp \
CXX="/usr/bin/clang++" \
CXXFLAGS="\$CXXFLAGS -pthread -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/cuda/include -I/System/Library/Frameworks/vecLib.framework/Versions/Current/Headers/ -Wall -Wno-sign-compare -Wno-unneeded-internal-declaration -Wno-uninitialized" \
CXXLIBS="\$CXXLIBS .build_release/lib/libcaffe.a -framework vecLib -L/usr/lib -L/Applications/MATLAB_R2014a.app/bin/maci64 -L/usr/local/lib -L/usr/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -lcudart -lcublas -lcurand -lglog -lgflags -lpthread -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc -lcblas" -output matlab/caffe/caffe.mexmaci64
Building with 'Xcode Clang++'.
ld: warning: directory not found for option '-L/usr/local/cuda/lib64'
Undefined symbols for architecture x86_64:
  "_mxArrayToString", referenced from:
      init(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
      read_mean(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
      _mexFunction in matcaffe.o
  "_mxCreateCellArray_700", referenced from:
      get_weights(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
  "_mxCreateCellMatrix_700", referenced from:
      forward(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
      backward(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
  "_mxCreateDoubleScalar", referenced from:
      init(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
      is_initialized(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
      get_init_key(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
  "_mxCreateNumericArray_700", referenced from:
      forward(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
      backward(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
      get_weights(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
      read_mean(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
  "_mxCreateString", referenced from:
      get_weights(int, mxArray_tag**, int, mxArray_tag const**) in matcaffe.o
  …

Sergio Guadarrama

unread,
Aug 29, 2014, 11:27:09 AM8/29/14
to caffe...@googlegroups.com
Have you exported the Dir?

Julie Dequaire

unread,
Jan 21, 2015, 6:16:05 AM1/21/15
to caffe...@googlegroups.com
hey Steven,

Have you been able to figure out the problem in your build ? I'm getting a similar issue that I haven't been able to fix ( I have built the boost library and all other ones mentioned in the Caffe Install with libstdc++ so I don't get why I'm having that undefined symbol error):


➜  src  make matcaffe
/Applications/MATLAB_R2014a.app/bin/mex matlab/caffe/matcaffe.cpp \
CXX="/usr/bin/clang++" \
CXXFLAGS="\$CXXFLAGS -stdlib=libstdc++ -pthread -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/local/Cellar/numpy/1.9.1/lib/python2.7/site-packages/numpy/core/include/numpy -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/cuda/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/ -Wall -Wno-sign-compare -Wno-unneeded-internal-declaration -Wno-uninitialized" \
CXXLIBS="\$CXXLIBS .build_release/lib/libcaffe.a -framework Accelerate -L/usr/lib -L/usr/local/lib -L/Applications/MATLAB_R2014a.app/bin/maci64 -L/usr/lib -L/usr/local/cuda/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc -lpthread -lboost_thread-mt -lcblas" -output matlab/caffe/caffe.mexmaci64
Building with 'Xcode Clang++'.
Undefined symbols for architecture x86_64:
  "std::string::find(char, unsigned long) const", referenced from:
      boost::basic_format<char, std::char_traits<char>, std::allocator<char> >::parse(std::string const&) in libcaffe.a(math_functions.o)
      int boost::io::detail::upper_bound_from_fstring<std::string, std::ctype<char> >(std::string const&, std::string::value_type, std::ctype<char> const&, unsigned char) in libcaffe.a(math_functions.o)
  "std::string::compare(char const*) const", referenced from:
      _mexFunction in matcaffe.o
      caffe::UpgradeV0PaddingLayers(caffe::NetParameter const&, caffe::NetParameter*) in libcaffe.a(upgrade_proto.o)
      caffe::UpgradeLayerParameter(caffe::LayerParameter const&, caffe::LayerParameter*) in libcaffe.a(upgrade_proto.o)
      caffe::UpgradeV0LayerType(std::string const&) in libcaffe.a(upgrade_proto.o)
      caffe::Filler<float>* caffe::GetFiller<float>(caffe::FillerParameter const&) in libcaffe.a(dummy_data_layer.o)
      caffe::Filler<double>* caffe::GetFiller<double>(caffe::FillerParameter const&) in libcaffe.a(dummy_data_layer.o)
      caffe::WindowDataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(window_data_layer.o)
      ...
  "std::__basic_file<char>::is_open() const", referenced from:
      caffe::HDF5DataLayer<float>::LayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(hdf5_data_layer.o)
      caffe::HDF5DataLayer<double>::LayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> >*) in libcaffe.a(hdf5_data_layer.o)
  "std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const", referenced from:
      caffe::Net<float>::AppendParam(caffe::NetParameter const&, int, int) in libcaffe.a(net.o)
      caffe::Net<double>::AppendParam(caffe::NetParameter const&, int, int) in libcaffe.a(net.o)
      caffe::SplitBlobName(std::string const&, std::string const&, int, int) in libcaffe.a(insert_splits.o)
      caffe::SplitLayerName(std::string const&, std::string const&, int) in libcaffe.a(insert_splits.o)
  "std::basic_ios<char, std::char_traits<char> >::widen(char) const", referenced from:
      void boost::io::detail::put<char, std::char_traits<char>, std::allocator<char>, char const* const&>(char const* const&, boost::io::detail::format_item<char, std::char_traits<char>, std::allocator<char> > const&, boost::basic_format<char, std::char_traits<char>, std::allocator<char> >::string_type&, boost::basic_format<char, std::char_traits<char>, std::allocator<char> >::internal_streambuf_t&, std::locale*) in libcaffe.a(math_functions.o)
      boost::io::detail::stream_format_state<char, std::char_traits<char> >::apply_on(std::basic_ios<char, std::char_traits<char> >&, std::locale*) const in libcaffe.a(math_functions.o)
      void boost::io::detail::put<char, std::char_traits<char>, std::allocator<char>, boost::io::detail::group1<boost::io::detail::group2<std::_Setprecision, double const&> > const&>(boost::io::detail::group1<boost::io::detail::group2<std::_Setprecision, double const&> > const&, boost::io::detail::format_item<char, std::char_traits<char>, std::allocator<char> > const&, boost::basic_format<char, std::char_traits<char>, std::allocator<char> >::string_type&, boost::basic_format<char, std::char_traits<char>, std::allocator<char> >::internal_streambuf_t&, std::locale*) in libcaffe.a(math_functions.o)
      void boost::io::detail::put<char, std::char_traits<char>, std::allocator<char>, boost::io::detail::group1<boost::io::detail::group2<std::_Setprecision, float const&> > const&>(boost::io::detail::group1<boost::io::detail::group2<std::_Setprecision, float const&> > const&, boost::io::detail::format_item<char, std::char_traits<char>, std::allocator<char> > const&, boost::basic_format<char, std::char_traits<char>, std::allocator<char> >::string_type&, boost::basic_format<char, std::char_traits<char>, std::allocator<char> >::internal_streambuf_t&, std::locale*) in libcaffe.a(math_functions.o)
      caffe::Net<float>::Init(caffe::NetParameter const&) in libcaffe.a(net.o)
      caffe::Net<double>::Init(caffe::NetParameter const&) in libcaffe.a(net.o)
      caffe::WindowDataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(window_data_layer.o)
      ...
  "std::istream& std::istream::_M_extract<float>(float&)", referenced from:
      caffe::WindowDataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(window_data_layer.o)
      caffe::WindowDataLayer<double>::DataLayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> >*) in libcaffe.a(window_data_layer.o)
  "std::istream::operator>>(int&)", referenced from:
      caffe::ImageDataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(image_data_layer.o)
      caffe::ImageDataLayer<double>::DataLayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> >*) in libcaffe.a(image_data_layer.o)
      caffe::WindowDataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(window_data_layer.o)
      caffe::WindowDataLayer<double>::DataLayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> >*) in libcaffe.a(window_data_layer.o)
  "std::ostream::put(char)", referenced from:
      caffe::Net<float>::Init(caffe::NetParameter const&) in libcaffe.a(net.o)
      caffe::Net<double>::Init(caffe::NetParameter const&) in libcaffe.a(net.o)
      caffe::WindowDataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(window_data_layer.o)
      caffe::WindowDataLayer<double>::DataLayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> >*) in libcaffe.a(window_data_layer.o)
      caffe::DataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(data_layer.o)
      caffe::DataLayer<double>::DataLayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> >*) in libcaffe.a(data_layer.o)
  "std::ostream::flush()", referenced from:
      caffe::Net<float>::Init(caffe::NetParameter const&) in libcaffe.a(net.o)
      caffe::Net<double>::Init(caffe::NetParameter const&) in libcaffe.a(net.o)
      caffe::WindowDataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(window_data_layer.o)
      caffe::WindowDataLayer<double>::DataLayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> >*) in libcaffe.a(window_data_layer.o)
      caffe::DataLayer<float>::DataLayerSetUp(std::vector
make: *** [matlab/caffe/caffe.mexmaci64] Error 255

梁超

unread,
Aug 27, 2017, 4:42:16 AM8/27/17
to Caffe Users
hi @Steven Lobo  , Have you been able to figure out the problem ? I got the same problem...

在 2014年8月25日星期一 UTC+8上午2:22:54,Steven Lobo写道:
Reply all
Reply to author
Forward
0 new messages