BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.11k stars 18.7k forks source link

Compiler Problems #6150

Open YangBain opened 6 years ago

YangBain commented 6 years ago

Please use the caffe-users list for usage, installation, or modeling questions, or other requests for help. Do not post such requests to Issues. Doing so interferes with the development of Caffe.

Please read the guidelines for contributing before submitting this issue.

Issue summary

When build the caffe, I got the following errors. Who knows how to solve this problem. Thank you very much.

CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_InternFromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyModule_Create2'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `_Py_fopen'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_AsString'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_Size'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsWideChar'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromEncodedObject'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8String'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromFormat'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromStringAndSize'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/get_image_size.bin] Error 1
make: *** Waiting for unfinished jobs....
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_InternFromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyModule_Create2'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `_Py_fopen'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_AsString'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_Size'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsWideChar'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromEncodedObject'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8String'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromFormat'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromStringAndSize'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_solver_proto_text.bin] Error 1
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_InternFromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to /home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_InternFromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyModule_Create2'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `_Py_fopen'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_AsString'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_Size'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsWideChar'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromEncodedObject'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8String'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromFormat'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromStringAndSize'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/compute_image_mean.bin] Error 1
`PyModule_Create2'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `_Py_fopen'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_AsString'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_Size'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsWideChar'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromEncodedObject'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8String'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromFormat'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromStringAndSize'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_InternFromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyModule_Create2'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `_Py_fopen'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_AsString'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_Size'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsWideChar'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromEncodedObject'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8String'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromFormat'
.build_release/lib/libcaffe.so: undefined reference to `/homeboost/::re_detail_106501beans::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_InternFromString': undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromStringAndSize'

/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyModule_Create2'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference collect2: error: ld returned 1 exit status
to `_Py_fopen'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_AsString'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocatormake: <*** [.build_release/tools/create_label_map.bin] Error 1
boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_Size'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsWideChar'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromEncodedObject'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8String'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromFormat'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromStringAndSize'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_InternFromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyModule_Create2'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `_Py_fopen'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_AsString'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_Size'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsWideChar'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromEncodedObject'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8String'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromFormat'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromStringAndSize'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_InternFromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyModule_Create2'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `_Py_fopen'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromString'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_AsString'
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyBytes_Size'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsWideChar'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromEncodedObject'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_AsUTF8String'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromFormat'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106501::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/home/beans/anaconda2/lib/libboost_python.so: undefined reference to `PyUnicode_FromStringAndSize'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_annoset.bin] Error 1

Steps to reproduce

If you are having difficulty building Caffe or training a model, please ask the caffe-users mailing list. If you are reporting a build error that seems to be due to a bug in Caffe, please attach your build configuration (either Makefile.config or CMakeCache.txt) and the output of the make (or cmake) command.

Your system configuration

Operating system: Compiler: CUDA version (if applicable): CUDNN version (if applicable): BLAS: Python or MATLAB version (for pycaffe and matcaffe respectively):

haibo-qiu commented 6 years ago

I hit the same problem :-( Did you solve it?

YangBain commented 6 years ago

@haibo-qiu Sorry, I did not solve it. If you solve it please tell me how to solve it.

haibo-qiu commented 6 years ago

@YangBain I have not solved it directly yet. But I did compile caffe successfully yesterday. My solution is using Make instead of CMake. It seems like the libboost_python in my anaconda helps me. But I still don't know the reason behind that.

YangBain commented 6 years ago

@haibo-qiu Could you give me some detailed information for how to use Make instead of CMake? Thanks.

haibo-qiu commented 6 years ago

@YangBain Sorry for not responding in time. I modify the Makefile.config by adding a new line: BOOST_DIR:=/usr/lib/x86_64-linux-gnu/ This is because I think the reason why we failed to compile caffe is that the version of libboost_python.so in Anaconda does not match what the Make need. Adding this new line is telling Make to use the libboost_python.so in the system itself instead of the Anaconda one when compiling caffe.

That is my own thought, which may be not exactly the true reason, but it did help me. Hope that also works for you.

derkbreeze commented 6 years ago

PYTHON_LIBRARIES := boost_python-py27 python2.7 solved the libboost_python problem for me. Using system's default python2.7

LongruiDong commented 6 years ago

PYTHON_LIBRARIES := boost_python-py27 python2.7 solved the libboost_python problem for me. Using system's default python2.7

That works for me~!!

woo1 commented 5 years ago

for python 3.6 uncomment this line and change PYTHON_LIBRARIES := boost_python-py36 python3.6m

dorwalprateek commented 5 years ago

I was able to solve it manually changing symlink libboost_python.so to 3.5 verison

ln -s libboost_python-py35.so libboost_python.so

liwei46 commented 5 years ago

hello, I encounter this problem when compiling using cmake and py3, after I change the following line: set(python_version "3" CACHE STRING "Specify which Python version to use")

It works.

wahyubram82 commented 4 years ago

succes with boost 1.74 python 3.6 build caffe. step to do:

  1. git clone --recursive https://github.com/boostorg/boost.git
  2. cd boost
  3. ./bootstrap.sh --with-python-version=3.6 --with-python=python3 (for record in the next step, the --prefix installation folder of boost set to /usr/local, so I don't add it, for more info just ./bootstrap.sh --help or view it with any text editor)
  4. ./b2
  5. sudo ./b2 install
  6. git clone caffe
  7. cd caffe
  8. edit Makefile, change: line 208: PYTHON_LIBRARIES := boost_python-py27 python2.7 change to: PYTHON_LIBRARIES ?= /usr/local/lib python3.6 reason: because we install boost that binding with python3.6 to that folder
  9. mkdir build
  10. cd build
  11. cmake ..
  12. if you want make sure all option, run: ccmake . or cmake-gui, you will see:

      Boost_FILESYSTEM_LIBRARY_RELEASE   /usr/local/lib/libboost_filesystem.so.1.74.0
      Boost_INCLUDE_DIR                                      /usr/local/include
      Boost_PYTHON_LIBRARY_RELEASE           /usr/local/lib/libboost_python36.so.1.74.0
      Boost_SYSTEM_LIBRARY_RELEASE           /usr/local/lib/libboost_system.so.1.74.0
      Boost_THREAD_LIBRARY_RELEASE           /usr/local/lib/libboost_thread.so.1.74.0

    don't worry with: boost_python-py36_DIR ---->>>> boost_python-py36_DIR-NOTFOUND don't forget make sure path instalation is correct, see the: CMAKE_INSTALL_PREFIX, mine is /usr/local

  13. make -j
  14. sudo make install

DONE

if you have error, because of using newest OPENCV 3 / 4, I already give a clue to fix it in here

cqray1990 commented 4 years ago

for python 3.6 uncomment this line and change PYTHON_LIBRARIES := boost_python-py36 python3.6m

what ever how to change ,i chang like this ,it also can find python3.6 alwaly default find python2.7

cqray1990 commented 4 years ago

hello, I encounter this problem when compiling using cmake and py3, after I change the following line: set(python_version "3" CACHE STRING "Specify which Python version to use")

It works.

i set 3 but it find 3.5 it didn't found 3.6