Я использую этот метод для исследования. делаю, но у меня возникли трудности с настройкой. Примерно на полпути вниз по странице говорится, что нужно запустить ./ bootstrap.sh --with-python = python3 sudo ./b2 --with-python --with-filesystem --with-system --with-regex install
, затем отмечает, каким должен быть ответ. Он работал почти идеально, но есть несколько файлов, которые я не могу понять, как установить; особенно /usr/local/lib/libboost_python3.so
и /usr/local/lib/libboost_numpy3.so
. Ниже приводится полный ответ: (обратите внимание, что root @ cole-desktop: / home / cole / Downloads / Mass / boost_1_66_0 # ./bootstrap.sh --with-python = python3
был заполнен автоматически, и я просто нажал enter.)
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Detecting Python version... 3.8
Detecting Python root... /usr
Unicode/ICU support for Boost.Regex?... not found.
Backing up existing Boost.Build configuration in project-config.jam.2
Generating Boost.Build configuration in project-config.jam...
Bootstrapping is done. To build, run:
./b2
To adjust configuration, edit 'project-config.jam'.
Further information:
- Command line help:
./b2 --help
- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html
- Boost.Build documentation:
http://www.boost.org/build/doc/html/index.html
root@cole-desktop:/home/cole/Downloads/Mass/boost_1_66_0# sudo ./b2 --with-python --with-filesystem --with-system --with-regex install
Performing configuration checks
- 32-bit : no (cached)
- 64-bit : yes (cached)
- arm : no (cached)
- mips1 : no (cached)
- power : no (cached)
- sparc : no (cached)
- x86 : yes (cached)
- symlinks supported : yes (cached)
- has_icu builds : no (cached)
Component configuration:
- atomic : not building
- chrono : not building
- container : not building
- context : not building
- coroutine : not building
- date_time : not building
- exception : not building
- fiber : not building
- filesystem : building
- graph : not building
- graph_parallel : not building
- iostreams : not building
- locale : not building
- log : not building
- math : not building
- mpi : not building
- program_options : not building
- python : building
- random : not building
- regex : building
- serialization : not building
- signals : not building
- stacktrace : not building
- system : building
- test : not building
- thread : not building
- timer : not building
- type_erasure : not building
- wave : not building
...patience...
...patience...
...found 31231 targets...
...updating 11 targets...
gcc.compile.c++ bin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi/converter/builtin_converters.o
libs/python/src/converter/builtin_converters.cpp: In function ‘void* boost::python::converter::{anonymous}::convert_to_cstring(PyObject*)’:
libs/python/src/converter/builtin_converters.cpp:51:35: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
51 | return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0;
"g++" -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -m64 -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -I"/usr/include/python3.8" -c -o "bin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi/converter/builtin_converters.o" "libs/python/src/converter/builtin_converters.cpp"
...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi/converter/builtin_converters.o...
...skipped <pbin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi>libboost_python3.so.1.66.0 for lack of <pbin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi>converter/builtin_converters.o...
...skipped <p/usr/local/lib>libboost_python3.so.1.66.0 for lack of <pbin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi>libboost_python3.so.1.66.0...
...skipped <p/usr/local/lib>libboost_python3.so for lack of <p/usr/local/lib>libboost_python3.so.1.66.0...
...skipped <pbin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi>libboost_numpy3.so.1.66.0 for lack of <pbin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi>libboost_python3.so.1.66.0...
...skipped <p/usr/local/lib>libboost_numpy3.so.1.66.0 for lack of <pbin.v2/libs/python/build/gcc-gnu-9/release/threadapi-pthread/threading-multi>libboost_numpy3.so.1.66.0...
...skipped <p/usr/local/lib>libboost_numpy3.so for lack of <p/usr/local/lib>libboost_numpy3.so.1.66.0...
gcc.compile.c++ bin.v2/libs/python/build/gcc-gnu-9/release/link-static/threadapi-pthread/threading-multi/converter/builtin_converters.o
libs/python/src/converter/builtin_converters.cpp: In function ‘void* boost::python::converter::{anonymous}::convert_to_cstring(PyObject*)’:
libs/python/src/converter/builtin_converters.cpp:51:35: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
51 | return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0;
"g++" -O3 -finline-functions -Wno-inline -Wall -pthread -m64 -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DBOOST_PYTHON_STATIC_LIB -DNDEBUG -I"." -I"/usr/include/python3.8" -c -o "bin.v2/libs/python/build/gcc-gnu-9/release/link-static/threadapi-pthread/threading-multi/converter/builtin_converters.o" "libs/python/src/converter/builtin_converters.cpp"
...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-gnu-9/release/link-static/threadapi-pthread/threading-multi/converter/builtin_converters.o...
...skipped <pbin.v2/libs/python/build/gcc-gnu-9/release/link-static/threadapi-pthread/threading-multi>libboost_python3.a(clean) for lack of <pbin.v2/libs/python/build/gcc-gnu-9/release/link-static/threadapi-pthread/threading-multi>converter/builtin_converters.o...
...skipped <pbin.v2/libs/python/build/gcc-gnu-9/release/link-static/threadapi-pthread/threading-multi>libboost_python3.a for lack of <pbin.v2/libs/python/build/gcc-gnu-9/release/link-static/threadapi-pthread/threading-multi>converter/builtin_converters.o...
...skipped <p/usr/local/lib>libboost_python3.a for lack of <pbin.v2/libs/python/build/gcc-gnu-9/release/link-static/threadapi-pthread/threading-multi>libboost_python3.a...
...failed updating 2 targets...
...skipped 9 targets...
Я считаю, что проблема связана с тем, что компьютер не может найти какой-либо путь в pbin.v2
, но я понятия не имею, что / где это.
Я был в такой же идентичной ситуации.
У меня сработало следующее
sudo cp -r /usr/local/include/python3.6m/ /usr/local/include/python3.6/
Я не уверен, какая у вас конфигурация Python, но решение состоит в том, чтобы скопировать (или создать программную ссылку), как в приведенной выше команде. Проблема в том, что Boost ищет pyconfig.h в папке python без m, которого не существует.