使用 Python 3.10 在 Manjaro 上使用 Boost 进行编译

使用 Python 3.10 在 Manjaro 上使用 Boost 进行编译

我正在尝试使用康奈尔大学教育部软件。当尝试使用安装它时python setup.py install,我遇到以下错误:

[...]
running install_scripts
Could not find env var MOE_CMAKE_PATH for cmake, using /usr/bin/cmake from $PATH
Passing '-D MOE_PYTHON_INCLUDE_DIR=/usr/include/python3.10 -D MOE_PYTHON_LIBRARY=/usr/lib/libpython3.10.so.1.0' args from MOE_CMAKE_OPTS to cmake.
Passing CC=/usr/bin/gcc to cmake.
Passing CXX=/usr/bin/g++ to cmake.
PYTHON_INCLUDE_DIR (Expected full path to where Python.h is found): /usr/include/python3.10
PYTHON_LIBRARY (Expected path to Python shared object; e.g., libpython2.7.so or .dylib): /usr/lib/libpython3.10.so.1.0
CMake Deprecation Warning at CMakeLists.txt:11 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 12.2.1
-- The CXX compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonLibs: /usr/lib/libpython3.10.so.1.0 (found version "3.10.9") 
-- Searching for Boost Python 3 component
-- Could NOT find Boost: missing: python-py31 (found /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.51"))
-- Could NOT find Boost: missing: python31 (found /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.51"))
-- Could NOT find Boost: missing: python36 (found /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.51"))
-- Could NOT find Boost: missing: python3 (found /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.51"))
-- Could NOT find Boost: missing: python-py36 (found /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.51"))
-- Could NOT find Boost: missing: python-py35 (found /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.51"))
-- Could NOT find Boost: missing: python-py34 (found /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.51"))
-- Could NOT find Boost: missing: python-py33 (found /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found suitable version "1.81.0", minimum required is "1.51"))
CMake Error at /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake:141 (find_package):
  Could not find a package configuration file provided by "boost_python-py32"
  (requested version 1.81.0) with any of the following names:

    boost_python-py32Config.cmake
    boost_python-py32-config.cmake

  Add the installation prefix of "boost_python-py32" to CMAKE_PREFIX_PATH or
  set "boost_python-py32_DIR" to a directory containing one of the above
  files.  If "boost_python-py32" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake:262 (boost_find_component)
  /usr/share/cmake/Modules/FindBoost.cmake:594 (find_package)
  CMakeLists.txt:109 (find_package)


-- Configuring incomplete, errors occurred!

我对C++一点也不熟悉,也不知道Boost到底是用来做什么的,这使得调试相当痛苦。boost和软件包boost-libs都安装在我的系统上并且是最新的:

> pacman -Ss boost

extra/boost 1.81.0-3 [installé]
    Free peer-reviewed portable C++ source libraries (development headers)
extra/boost-libs 1.81.0-3 [installé]
    Free peer-reviewed portable C++ source libraries (runtime libraries)
extra/booster 0.9-1
[...]

如果相关的话,我正在使用 python 3.10 的虚拟环境中工作。两者都python运行python3.10没有问题。我还在系统范围内安装了一些其他 Python 发行版,它们是 Python 2.7、3.6、3.7、3.8 和 3.9。

为了让编译器找到 Boost 文件,我应该遵循哪些步骤?

相关内容