Caffe make all command ld: library not found for -lboost_python3 error.

82 views
Skip to first unread message

Katya

unread,
Jul 19, 2020, 1:02:18 PM7/19/20
to Caffe Users
Hello 

How can I resolve caffe make all error below? I can actually see boost_python3 folder in my files, I don't know where and how to set this for caffe compilation to be successful?

ld: library not found for -lboost_python3

Tamas Nemes

unread,
Jul 19, 2020, 4:47:17 PM7/19/20
to Caffe Users
The most here compile on Linux, so I can't give definitive information about MacOS. In your Makefile, it should be written as boost_python, in your Makefile.config as boost_python3. Make sure the folder which holds boost_python3 is included in your PYTHON_INCLUDE variable

Katya

unread,
Jul 19, 2020, 5:07:10 PM7/19/20
to Caffe Users
Thank you for attempting to help. I have been all day at this.

I have tried including the path as but it makes no difference:

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/Cellar/boost_python3/1.72.0_1/share/doc

I have also tried it as underneath boost command, again makes not difference:

# Uncomment to use Python 3 (default is Python 2)
PYTHON_LIBRARIES := boost_python3 python3.7m
PYTHON_INCLUDE := /usr/local/include /usr/local/Cellar/boost_python3/1.72.0_1/share/doc

Am I meant to use make clean first after making each config change? All the other debugging I did, didn't seem to need me to do that.
I think I am not setting the path correctly?

Tamas Nemes

unread,
Jul 19, 2020, 5:09:34 PM7/19/20
to Caffe Users
Yes, why does your path point to the doc folder? Provide the path that contains the whole boost folder.

Tamas Nemes

unread,
Jul 19, 2020, 5:12:19 PM7/19/20
to Caffe Users
And doing make clean definitely helps, although it might be time consuming if you have not enough power. I suggest that if you manage to first get a successful build, you so make clean and run make all again. The changes you do during debugging otherwise don't apply to the already built object.

Katya

unread,
Jul 19, 2020, 5:36:01 PM7/19/20
to Caffe Users
It is my first time working with a Makefile.config and I am not sure at all how to set these correct paths. Am I doing anything right with the command
PYTHON_INCLUDE := /usr/local/include /usr/local/Cellar/boost_python3/1.72.0_1/share/doc

When I search for 'boost' folder in Finder, I actually see boost inside anaconda3 and inside Cellar. The one inside Cellar actually contains boost_python3, so that is why I assume I need to give the Cellar path. Do you mean that I should just give the command up to 
PYTHON_INCLUDE := /usr/local/include /usr/local/Cellar
I do not know what you mean by 'provide path that contains whole boost folder'.

After performing command make clean I now have errors that I thought I resolved:

src/caffe/data_transformer.cpp:2:10: fatal error: 'opencv2/core/core.hpp' file not found

I thought that this resolved it:
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/Cellar/opencv/4.3.0_5/include/opencv4
Because inside folder opencv4, that is where I have opencv2 folder.
But it is not working. How do I provide correct paths to Makefile.config?

Reply all
Reply to author
Forward
0 new messages