Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in compiling Matlab wrapper #3340

Closed
ssahu opened this issue Nov 17, 2015 · 3 comments
Closed

Issue in compiling Matlab wrapper #3340

ssahu opened this issue Nov 17, 2015 · 3 comments

Comments

@ssahu
Copy link

ssahu commented Nov 17, 2015

Compiling with R2015b and Apple LLVM version 7.0.0 (clang-700.1.76) gives the following error during linking, anyone else facing the same issue?

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
      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
@UsamaShafiq91
Copy link

Do anybody resolve this issue. I also come across this problem on MacOs.

@ssahu
Copy link
Author

ssahu commented Nov 20, 2015

also needed to add /usr/local/lib /Applications/MATLAB_R2015b.app/bin/maci64 in LIBRARY_DIRS in Makefile.config

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /Applications/MATLAB_R2015b.app/bin/maci64 /usr/lib

thanks @ronghanghu for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants