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

libcaffe.so is missing #6667

Open
triple-tam opened this issue Jan 9, 2019 · 3 comments
Open

libcaffe.so is missing #6667

triple-tam opened this issue Jan 9, 2019 · 3 comments

Comments

@triple-tam
Copy link

Hello all, I think I have correctly installed/compiled caffe already, and now I am trying to make pycaffe. But then I get this error, and it seems that it can't find libcaffe.so. libcaffe.so also doesn't seem to exist on my system... so does this mean that my caffe installation wasn't correct?

Since libcaffe.so is missing, but the caffe compilation did not display any errors, how can I obtain the libcaffe.so file?

Error for reference:

Tams-MacBook-Pro:caffe tamtran$ make pycaffe
LD -o .build_release/lib/libcaffe.so.1.0.0
ld: warning: directory not found for option '-L/lib'
Undefined symbols for architecture x86_64:
  "cv::imread(cv::String const&, int)", referenced from:
      caffe::WindowDataLayer<float>::load_batch(caffe::Batch<float>*) in window_data_layer.o
      caffe::WindowDataLayer<double>::load_batch(caffe::Batch<double>*) in window_data_layer.o
      caffe::ReadImageToCVMat(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, bool) in io.o
  "cv::imdecode(cv::_InputArray const&, int)", referenced from:
      caffe::DecodeDatumToCVMatNative(caffe::Datum const&) in io.o
      caffe::DecodeDatumToCVMat(caffe::Datum const&, bool) in io.o
  "cv::imencode(cv::String const&, cv::_InputArray const&, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >&, std::__1::vector<int, std::__1::allocator<int> > const&)", referenced from:
      caffe::ReadImageToDatum(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, int, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, caffe::Datum*) in io.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: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1

  • Operating system: MacOS X 10.12 Sierra
  • Compiler: C+11
  • CUDA version (if applicable): No
  • CUDNN version (if applicable): No
  • BLAS: Open, installed via Brew
  • Python version (if using pycaffe): 2.7
  • MATLAB version (if using matcaffe): No
@BigBookPlus
Copy link

try export your path to libcaffe.so to LD_LIBRARY_PATH and sudo ldconfig

@svuki
Copy link

svuki commented Jan 10, 2019

When you compile caffe it'll create a directory .build_release under caffe root. Then it'll symlink the directory build to that directory. libcaffe.so should be in caffe/.build_release/lib/. If you don't see it there, then something has gone wrong with the compilation of caffe.

In the output you posted above, the line
LD -o .build_release/lib/libcaffe.so.1.0.0 tells you were it's looking for the .so lib.
(note that directories that start with a . like .build_release are hidden by deafult, but you can see them with ls -a which shows all the directories.). Also, the command expects you to run make pycaffe in the caffe root directory because the path is relative (ie, it expectes the directory .build_release to be in the working directory where make pycaffe is run.

Note: I see that you are on a mac. I have only ever installed caffe on ubuntu, so things may be different , but based on the output you've pasted, what I've written above should apply in helping you figure out what went wrong.

@mrbjkk
Copy link

mrbjkk commented Mar 12, 2019

@svuki What if I installed caffe just bysudo apt install caffe-cuda on ubuntu 18.04. Where can I find the include directory and the libcaffe.so file? Thank you.

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

4 participants