Skip to content

caffe make all error, /usr/bin/ld: cannot find -lboost_python3 #6063

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

Closed
Sam813 opened this issue Nov 21, 2017 · 10 comments
Closed

caffe make all error, /usr/bin/ld: cannot find -lboost_python3 #6063

Sam813 opened this issue Nov 21, 2017 · 10 comments

Comments

@Sam813
Copy link

Sam813 commented Nov 21, 2017

Dear All,

During the compilation of caffe from source i got this error:

AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/ld: cannot find -lboost_python3
collect2: error: ld returned 1 exit status
Makefile:572: recipe for target '.build_release/lib/libcaffe.so.1.0.0' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1

Any one can help how to solve it?

@cicido
Copy link

cicido commented Nov 21, 2017

MacOS?

@storylike
Copy link

storylike commented Nov 21, 2017

You need to create symbolic links to redirect "libboost_python3.so" to "libboost_python-py35.so", in /usr/lib/x86_64-linux-gnu.
Please refer to this article for more details:
#4843

@Sam813
Copy link
Author

Sam813 commented Nov 22, 2017

@cicido its Ubuntu 17.10

@Sam813
Copy link
Author

Sam813 commented Nov 22, 2017

@storylike
I followed the steps mentioned in that article and seems that issue is solved but it hit to another error
it seems never ending..
Can I have the sample of your makefile.config so i follow the way you set the paths. i guess there should be a problem in that part. it doesn't make sense to have this much errors.

@storylike
Copy link

What kind of errors are you encountering?
Have you set INCLUDE_DIRS and LIBRARY_DIRS correctly?
In fact, I followed the steps form this link:
https://chunml.github.io/ChunML.github.io/project/Installing-Caffe-CPU-Only/
This article reveals several common obstacles during caffe build, and provides solutions, thanks to @ChunML.
The Makefile.config may vary, according different personalized settings, anyway, I post my settings here, hope it help. And good luck with you.
Makefile.config.log

@Sam813
Copy link
Author

Sam813 commented Nov 27, 2017

@storylike
thanks for the make file and the link. my make.config is almost same except im trying to compile it on anaconda and python3.
The recent issue is:
libpng16.so.16, needed by /home/Sam/anaconda3/lib/libopencv_imgcodecs.so, not found (try using -rpath or -rpath-link)
seems some of the opencv libraries are missing

@Noiredd
Copy link
Member

Noiredd commented Nov 28, 2017

This is not an issue with Caffe itself but an installation problem. When compiling from source, please make sure you've got all dependencies installed.

Please do not post usage, installation, or modeling questions, or other requests for help to Issues. Use the caffe-users list instead. This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe. Please read the guidelines for contributing before submitting an issue or a pull request.

@Noiredd Noiredd closed this as completed Nov 28, 2017
@JFishLover
Copy link

thanks, your method is right for me @storylike

@cpp2016
Copy link

cpp2016 commented Jun 26, 2019

You need to create symbolic links to redirect "libboost_python3.so" to "libboost_python-py35.so", in /usr/lib/x86_64-linux-gnu.
Please refer to this article for more details:
#4843

i just can not find files whose name contains "python3.so" or "python-py35.so". I use

find / -name "*_python*.so"

and got

/usr/lib64/libboost_python-mt.so
/usr/lib64/libboost_python.so

None of them seem to be the right one. But I have python3.5.0 in my ubuntu 16.04 well.

@amoazeni75
Copy link

I wanted to build Caffe and faced the same issue. Unfortunately, none of the answers work in my case. I checked the location of lboost_python by the following command:


find /usr/lib -name libboost_python-py

I found the lboost_python libraries and here are some of them:

  • libboost_python37.a
  • libboost_python37-mt.a
  • libboost_python37-mt.so
  • libboost_python37-mt.so.1.68.0

Then in the Makefile.config file I changed the following line:

PYTHON_LIBRARIES := boost_python python3.7m
to

PYTHON_LIBRARIES := boost_python37-mt python3.7m

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

7 participants