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

'python setup.py develop' error (ld: library not found for -lboost_python) #194

Open
braunchris opened this issue Aug 2, 2018 · 3 comments

Comments

@braunchris
Copy link

This is similar to #131 but the missing library is different.

Mapnik seems to be installed properly:
'mapnik-config -v' outputs '3.0.20'
'clang --version' : 'Apple LLVM version 9.1.0 (clang-902.0.39.2)'
Mac OS X: 10.13.6 (High Sierra)
Python 3.7.0

When executing python setup.py develop I get:

ld: library not found for -lboost_python
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'c++' failed with exit status 1

I have XCode installed, and following other posts I also added the following in my bash_profile:

export BOOST_PYTHON_LIB=boost_python
export BOOST_THREAD_LIB=boost_thread
export BOOST_SYSTEM_LIB=boost_system

However it didn't help. Any idea how to solve this problem?

@talaj
Copy link
Member

talaj commented Aug 2, 2018

Where do you have boost-python libs installed?

I don't have OS X, but on Debian, for example, I see these files:

$ ls -1 /usr/lib/x86_64-linux-gnu/libboost_python*
/usr/lib/x86_64-linux-gnu/libboost_python.a
/usr/lib/x86_64-linux-gnu/libboost_python-py27.a
/usr/lib/x86_64-linux-gnu/libboost_python-py27.so
/usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.62.0
/usr/lib/x86_64-linux-gnu/libboost_python-py35.a
/usr/lib/x86_64-linux-gnu/libboost_python-py35.so
/usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.62.0
/usr/lib/x86_64-linux-gnu/libboost_python.so

So I can link with -lboost_python:

$ ld -o /dev/null -lboost_python --verbose 2>/dev/null | grep succeeded
attempt to open //usr/lib/x86_64-linux-gnu/libboost_python.so succeeded

However, on my Gentoo system, I see these files:

$ ls -1 /usr/lib/libboost_python-*
/usr/lib/libboost_python-2.7.a
/usr/lib/libboost_python-2.7-mt.so
/usr/lib/libboost_python-2.7.so
/usr/lib/libboost_python-2.7.so.1.65.0
/usr/lib/libboost_python-3.6.a
/usr/lib/libboost_python-3.6-mt.so
/usr/lib/libboost_python-3.6.so
/usr/lib/libboost_python-3.6.so.1.65.0

And cannot link -lboost_python:

$ ld -o /dev/null -lboost_python --verbose 2>/dev/null  | grep succeeded
FAIL

I have to link -lboost_python-2.7:

$ ld -o /dev/null -lboost_python-2.7 --verbose 2>/dev/null  | grep succeeded
attempt to open /usr/lib64/libboost_python-2.7.so succeeded

Therefore this export should work for me:

export BOOST_PYTHON_LIB=boost_python-2.7

@jbonhag
Copy link

jbonhag commented Dec 6, 2018

Thanks, this was very helpful. I installed Mapnik and boost-python3 on macOS Mojave with Homebrew:

brew install mapnik boost-python3

This symlinked the libs into /usr/local/lib:

/usr/local/lib/libboost_python37.a
/usr/local/lib/libboost_python37.dylib
/usr/local/lib/libboost_python37-mt.a
/usr/local/lib/libboost_python37-mt.dylib

And this export worked:

export BOOST_PYTHON_LIB=boost_python37

@am2222
Copy link

am2222 commented Feb 22, 2019

@talaj Hi,
Should we build mapnik with the same boost_python version? Does export BOOST_PYTHON_LIB=boost_python3 works when we are building mapnik's main library? or we have to set python path too?

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