Caffe: Issue with make all matcaffe

Created on 16 Mar 2016  ·  6Comments  ·  Source: BVLC/caffe

Hi! I'm trying to get caffe running for Matlab. When I did simply make all it threw some warnings but didn't terminate in an error.

However on doing make all matcaffe it is throwing the following error:

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
/bin/sh: line 0: [: -gt: unary operator expected
make: Nothing to be done for `all'.
MEX matlab/+caffe/private/caffe_.cpp
No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2015b/maci64.html.
make: *** [matlab/+caffe/private/caffe_.mexmaci64] Error 255

Please advice me on how to solve this issue! :(

All 6 comments

I solved this problem: my mex files weren't configured so I followed the solution provided here: http://www.mathworks.com/matlabcentral/answers/246507-why-can-t-mex-find-a-supported-compiler-in-matlab-r2015b-after-i-upgraded-to-xcode-7-0 and it worked.

But now I am getting this error which I have no idea how to make any sense of:

MEX matlab/+caffe/private/caffe_.cpp
Building with 'Xcode Clang++'.
In file included from /Users/shiladitya/Documents/Codex/Glasses/caffe-master/matlab/+caffe/private/caffe_.cpp:18:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/usr/local/include/glog/logging.h:917:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
/usr/local/include/glog/logging.h:912:73: note: expanded from macro 'GOOGLE_GLOG_COMPILE_ASSERT'
  typedef google::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
                                                                        ^
1 warning generated.

Undefined symbols for architecture x86_64:
  "_mxArrayToString", referenced from:
      get_solver(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_restore(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_net(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_copy_from(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_save(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      read_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      write_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      ...
  "_mxCreateCellMatrix_700", referenced from:
      str_vec_to_mx_strcell(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in caffe_.o
  "_mxCreateDoubleMatrix_700", referenced from:
      net_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      blob_get_shape(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
  "_mxCreateDoubleScalar", referenced from:
      get_solver(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_get_iter(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_net(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_init_key(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      mxArray_tag* ptr_vec_to_handle_vec<caffe::Blob<float> >(std::__1::vector<boost::shared_ptr<caffe::Blob<float> >, std::__1::allocator<boost::shared_ptr<caffe::Blob<float> > > > const&) in caffe_.o
      ...
  "_mxCreateNumericArray_700", referenced from:
      blob_to_mx_mat(caffe::Blob<float> const*, WhichMemory) in caffe_.o
  "_mxCreateNumericMatrix_700", referenced from:
      get_solver(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_net(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      mxArray_tag* ptr_vec_to_handle_vec<caffe::Blob<float> >(std::__1::vector<boost::shared_ptr<caffe::Blob<float> >, std::__1::allocator<boost::shared_ptr<caffe::Blob<float> > > > const&) in caffe_.o
  "_mxCreateString", referenced from:
      layer_get_type(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      version(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      str_vec_to_mx_strcell(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in caffe_.o
  "_mxCreateStructMatrix_700", referenced from:
      get_solver(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_net(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      layer_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      mxArray_tag* ptr_vec_to_handle_vec<caffe::Blob<float> >(std::__1::vector<boost::shared_ptr<caffe::Blob<float> >, std::__1::allocator<boost::shared_ptr<caffe::Blob<float> > > > const&) in caffe_.o
  "_mxFree", referenced from:
      get_solver(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_restore(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_net(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_copy_from(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_save(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      read_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      write_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      ...
  "_mxGetData", referenced from:
      get_solver(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_net(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      caffe::Solver<float>* handle_to_ptr<caffe::Solver<float> >(mxArray_tag const*) in caffe_.o
      caffe::Net<float>* handle_to_ptr<caffe::Net<float> >(mxArray_tag const*) in caffe_.o
      mxArray_tag* ptr_vec_to_handle_vec<caffe::Blob<float> >(std::__1::vector<boost::shared_ptr<caffe::Blob<float> >, std::__1::allocator<boost::shared_ptr<caffe::Blob<float> > > > const&) in caffe_.o
      ...
  "_mxGetDimensions_700", referenced from:
      write_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
  "_mxGetField_700", referenced from:
      caffe::Solver<float>* handle_to_ptr<caffe::Solver<float> >(mxArray_tag const*) in caffe_.o
      caffe::Net<float>* handle_to_ptr<caffe::Net<float> >(mxArray_tag const*) in caffe_.o
      caffe::Layer<float>* handle_to_ptr<caffe::Layer<float> >(mxArray_tag const*) in caffe_.o
      caffe::Blob<float>* handle_to_ptr<caffe::Blob<float> >(mxArray_tag const*) in caffe_.o
  "_mxGetNumberOfDimensions_700", referenced from:
      write_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
  "_mxGetNumberOfElements", referenced from:
      blob_reshape(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      mx_mat_to_blob(mxArray_tag const*, caffe::Blob<float>*, WhichMemory) in caffe_.o
  "_mxGetPr", referenced from:
      net_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      blob_get_shape(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      blob_reshape(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
  "_mxGetScalar", referenced from:
      solver_step(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      set_device(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      caffe::Solver<float>* handle_to_ptr<caffe::Solver<float> >(mxArray_tag const*) in caffe_.o
      caffe::Net<float>* handle_to_ptr<caffe::Net<float> >(mxArray_tag const*) in caffe_.o
      caffe::Layer<float>* handle_to_ptr<caffe::Layer<float> >(mxArray_tag const*) in caffe_.o
      caffe::Blob<float>* handle_to_ptr<caffe::Blob<float> >(mxArray_tag const*) in caffe_.o
  "_mxIsChar", referenced from:
      get_solver(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_restore(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_net(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_copy_from(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_save(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      read_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      write_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      ...
  "_mxIsDouble", referenced from:
      solver_step(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      blob_reshape(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      set_device(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
  "_mxIsSingle", referenced from:
      blob_set_data(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      blob_set_diff(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      write_mean(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
  "_mxIsStruct", referenced from:
      solver_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_get_iter(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_restore(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_solve(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_step(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_forward(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      ...
  "_mxIsUint64", referenced from:
      caffe::Solver<float>* handle_to_ptr<caffe::Solver<float> >(mxArray_tag const*) in caffe_.o
      caffe::Net<float>* handle_to_ptr<caffe::Net<float> >(mxArray_tag const*) in caffe_.o
      caffe::Layer<float>* handle_to_ptr<caffe::Layer<float> >(mxArray_tag const*) in caffe_.o
      caffe::Blob<float>* handle_to_ptr<caffe::Blob<float> >(mxArray_tag const*) in caffe_.o
  "_mxSetCell_700", referenced from:
      str_vec_to_mx_strcell(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in caffe_.o
  "_mxSetField_700", referenced from:
      get_solver(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      solver_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      get_net(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      net_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      layer_get_attr(int, mxArray_tag**, int, mxArray_tag const**) in caffe_.o
      mxArray_tag* ptr_vec_to_handle_vec<caffe::Blob<float> >(std::__1::vector<boost::shared_ptr<caffe::Blob<float> >, std::__1::allocator<boost::shared_ptr<caffe::Blob<float> > > > const&) in caffe_.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: *** [matlab/+caffe/private/caffe_.mexmaci64] Error 255

Please help!

I got it working!
It appears the Makefile.config needs to be altered after doing make all before doing make matcaffe as:
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib $(MATLAB_DIR)/bin/maci64 /usr/lib

I came across the solution here: http://ylzhao.blogspot.com/2016/03/build-caffe-rc3-with-mac-os-x-10113.html

Now I am facing some issues in doing make mattest:

Library not loaded: /usr/local/opt/libtiff/lib/libtiff.5.dylib
  Referenced from: /usr/local/opt/opencv/lib/libopencv_highgui.2.4.dylib
  Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 8.0.0 or later, but
  libtiff.5.dylib provides version 6.0.0

Error in caffe.set_mode_cpu (line 5)
caffe_('set_mode_cpu');

Error in caffe.run_tests (line 6)
caffe.set_mode_cpu();

Any advice would be appreciated :)

It works now!

All I had to do was to go to $MATLAB_ROOT and

rm libtiff.5.dylib
rm libprotobuf.8.dylib

make mattest runs with 7 tests passed, 0 failed

I have the exaaaaact same problems and I could not be able to fix it without your sharing. Thank you sooooooo much!!!

But actually I don't have $(MATLAB_DIR)/bin/maci64 in the directory
Here is my $(MATLAB_DIR)/bin/ directory:

MATLAB/R2015a/bin$ ll
total 480K
drwxrwxr-x  6 yerong yerong 4.0K Jan  5 03:22 ./
drwxrwxr-x 21 yerong yerong 4.0K Jan  5 03:24 ../
-r-xr-xr-x  1 yerong yerong  25K Dec 29  2014 activate_matlab.sh*
-r-xr-xr-x  1 yerong yerong  26K Dec 29  2014 deactivate_matlab.sh*
-rwxr-xr-x  1 yerong yerong  19K Jul  5  2013 deploytool*
-r-xr-xr-x  1 yerong yerong 6.7K Dec 29  2014 engopts.sh*
drwxrwxr-x 10 yerong yerong  68K Jan  5 03:24 glnxa64/
-r--r--r--  1 yerong yerong  23K Sep 12  2012 lcdata_utf8.xml
-r--r--r--  1 yerong yerong  23K Sep 12  2012 lcdata.xml
-r-xr-xr-x  1 yerong yerong 3.6K Feb 18  2010 lcdata.xsd*
-r-xr-xr-x  1 yerong yerong  14K Dec 29  2014 ldd*
drwxrwxr-x  2 yerong yerong 4.0K Jan  5 03:17 m3iregistry/
-rwxr-xr-x  1 yerong yerong  58K Dec 29  2014 matlab*
-r-xr-xr-x  1 yerong yerong 7.0K Aug  9  2013 .matlab7rc.sh*
-r-xr-xr-x  1 yerong yerong 6.7K Dec 29  2014 matopts.sh*
-rwxr-xr-x  1 yerong yerong  11K Dec 29  2014 mbuild*
-rwxr-xr-x  1 yerong yerong  27K Dec 29  2014 mcc*
-rwxr-xr-x  1 yerong yerong  10K Dec 29  2014 mex*
-r-xr-xr-x  1 yerong yerong  12K Dec 29  2014 mexext*
-r-xr-xr-x  1 yerong yerong 8.1K Dec 29  2014 mexopts.sh*
-r-xr-xr-x  1 yerong yerong  53K Dec 29  2014 mexsh*
-r-xr-xr-x  1 yerong yerong  704 Jul  5  2013 mw_mpiexec*
-r-xr-xr-x  1 yerong yerong  513 Jul  5  2013 mw_smpd*
-r-xr-xr-x  1 yerong yerong 6.3K Dec 29  2014 optsetup.sh*
drwxrwxr-x  2 yerong yerong  12K Jan  5 03:24 registry/
drwxrwxr-x  3 yerong yerong 4.0K Jan  5 03:17 util/
-r-xr-xr-x  1 yerong yerong  477 Jul  5  2013 worker*

YerongLi, your version seems Linux. Above instruction is for MacOS X

Was this page helpful?
0 / 5 - 0 ratings