Search code examples
pythonboostcaffe

Build caffe with Python ( cannot find -lboost_python3 )


I'm trying to build caffe with python but it keep saying this

CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
/usr/bin/ld: cannot find -lboost_python3
collect2: error: ld returned 1 exit status
make: *** [python/caffe/_caffe.so] Error 1

This is what I get when I try to locate boost_python

$ sudo locate boost_python
/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.55.0
/usr/lib/x86_64-linux-gnu/libboost_python-py33.a
/usr/lib/x86_64-linux-gnu/libboost_python-py33.so
/usr/lib/x86_64-linux-gnu/libboost_python-py33.so.1.55.0
/usr/lib/x86_64-linux-gnu/libboost_python-py34.a
/usr/lib/x86_64-linux-gnu/libboost_python-py34.so
/usr/lib/x86_64-linux-gnu/libboost_python-py34.so.1.55.0
/usr/lib/x86_64-linux-gnu/libboost_python.a
/usr/lib/x86_64-linux-gnu/libboost_python.so

I've add this path also

## .bashrc
export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu":$LD_LIBRARY_PATH

Any idea why is that happing?


Solution

  • I've found the problem. it turned out that it tries to look for something with that name of libboost_python3.so after changing the name in Makefile.config from boost_python3 to boost_python-py34, it worked just fine!