Caffe: Could NOT find Boost

Created on 4 Jan 2019  路  4Comments  路  Source: BVLC/caffe

I build caffe on MAC, and successfully build all and build test.
But I can't build pycaffe, it reads
"The dependency target "pycaffe" of target "pytest" does not exist."

the whole cmake is
-- OpenCV found (/usr/local/share/OpenCV)
-- Found vecLib as part of Accelerate.framework
-- NumPy ver. 1.15.4 found (include: /usr/local/lib/python2.7/site-packages/numpy/core/include)
-- Could NOT find Boost
-- Python interface is disabled or not all required dependencies found. Building without it...
-- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/

I don't know why it can't find Boost, it already says
-- Dependencies:
-- BLAS : Yes (vecLib)
-- Boost : Yes (ver. 1.68)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 3.6.1)
-- lmdb : Yes (ver. 0.9.23)
-- LevelDB : Yes (ver. 1.20)
-- Snappy : Yes (ver. 1.1.7)
-- OpenCV : Yes (ver. 3.4.5)
-- CUDA : No

Any suggestions?

Most helpful comment

I solved it by configuring cmake correctly...
When looking at "Advanced" View of CCmake (or cake gui), there you can specify the right location to Boost_PYTHON_LIBRARY ... also had to set the CMAKE_CXX_FLAGS in order to build successfully...

in ccmake (on MacOS Mojave, installed boost-python via homebrew):

...
Boost_PYTHON_LIBRARY_DEBUG       /usr/local/Cellar/boost-python/1.68.0/lib/libboost_python27-mt.dylib
Boost_PYTHON_LIBRARY_RELEASE     /usr/local/Cellar/boost-python/1.68.0/lib/libboost_python27-mt.dylib
...
CMAKE_CXX_FLAGS                  -std=c++14 -stdlib=libc++
...

All 4 comments

Same problem here.
I installed it via brew according to the documentation

brew install --build-from-source -vd boost boost-python
and i tried
brew install --with-python boost

same error as mentioned above ...

Same problem here.
I installed it via brew according to the documentation

brew install --build-from-source -vd boost boost-python
and i tried
brew install --with-python boost

same error as mentioned above ...

I did a workaround. Use parallels desktop and install ubuntu 18.04, and it's only a simple line
install caffe-cpu

I solved it by configuring cmake correctly...
When looking at "Advanced" View of CCmake (or cake gui), there you can specify the right location to Boost_PYTHON_LIBRARY ... also had to set the CMAKE_CXX_FLAGS in order to build successfully...

in ccmake (on MacOS Mojave, installed boost-python via homebrew):

...
Boost_PYTHON_LIBRARY_DEBUG       /usr/local/Cellar/boost-python/1.68.0/lib/libboost_python27-mt.dylib
Boost_PYTHON_LIBRARY_RELEASE     /usr/local/Cellar/boost-python/1.68.0/lib/libboost_python27-mt.dylib
...
CMAKE_CXX_FLAGS                  -std=c++14 -stdlib=libc++
...

To add to @khuesmann comment, you need to add above flags to CMakeCache.txt file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sdemyanov picture sdemyanov  路  3Comments

shiorioxy picture shiorioxy  路  3Comments

greatgao picture greatgao  路  3Comments

prathmeshrmadhu picture prathmeshrmadhu  路  3Comments

serimp picture serimp  路  3Comments