I install boost using brew install --build-from-source --with-python --fresh -vd boost
. Yet when I run make pycaffe
in the Caffe project, I get this error: ld: library not found for -lboost_python
. How can I install that library? find / -name libboost_python*
turns up nothing.
Run the command brew install boost-python
This will download, compile, and install the boost package with boost-python support. boost-python is required for the graphicsmagick-engine pip package and I ran into the same issue. To give you an idea of what happens, this is the output from the command:
==> Downloading https://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2
######################################################################## 100.0%
==> ./bootstrap.sh --prefix=/usr/local/Cellar/boost-python/1.57.0 --libdir=/usr/local/Cellar/boost-python/1.57.0/lib --with-libraries=python --with-python=python --with-python-root=/System/Library/Frameworks/Python.framework/Versions/2.7
==> ./b2 --build-dir=build-python --stagedir=stage-python python=2.7 --prefix=/usr/local/Cellar/boost-python/1.57.0 --libdir=/usr/local/Cellar/boost-python/1.57.0/lib -d2 -j8 --layout=tagged --user-config=user-config.jam threading=multi,s
You could alternatively download, compile, and symlink the boost package (which is what I did originally) but this is a whole lot simpler if the default paths work for you.
-lboost_python3 not found
? How to fix it, I came across this issue. –
Softcover brew install boost-python3
– the syntax may have changed. –
Weakness It turns out boost 1.56 seems to have issues with NVCC, so the boost_python lib files don't get installed. Installing using boost 1.55 works. I used:
git checkout a252214 /usr/local/Library/Formula/boost.rb
brew install --build-from-source --with-python --fresh -vd boost
Thanks to this thread
brew edit
step. Follow the Caffe instructions closely. I installed OpenBLAS. –
Whipping Fatal Python error: PyThreadState_Get: no current thread
when I try to run Caffe. Please let me know if you do too! Homebrew's advice on this problem doesn't seem helpful: github.com/Homebrew/homebrew/wiki/Common-Issues. I'm working through brew doctor
issues before posting an issue. –
Whipping For me, there is no such libboost_python37.dylib
in boost-python lib path
$ ls /usr/local/Cellar/boost-python3/1.67.0_1/lib
libboost_numpy37-mt.a libboost_numpy37.a libboost_python37-mt.dylib libboost_python37.dylib
libboost_numpy37-mt.dylib libboost_numpy37.dylib libboost_python37-mt.a libboost_python37.a
So create a soft link
$ sudo ln -s libboost_python37.dylib libboost_python3.dylib
This problem is fixed.
Similar question: ld: library not found for -lboost_python on MacOS
© 2022 - 2024 — McMap. All rights reserved.
brew install boost-python --with-python3
, and then build using-lboost_python3
– Acarid