Skip to content

Support building with the default apt sources on Ubuntu 20.04 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

BewareMyPower
Copy link
Contributor

Motivation

Currently the Python client cannot be built with the default apt sources on Ubuntu 20.04, whose default CMake version is 3.16. However, even after I installed CMake 3.24 on Ubuntu 20.04, CMake would still fail to find Boost.Python.

Modifications

To fix the Boost.Python not found issue, find the Python component instead of Python3 when finding Boost.

In addition, when finding Python3, find the Development component instead of the Development.Module, which is a sub-component of Development. See
https://cmake.org/cmake/help/latest/module/FindPython3.html.

After that, the minimum required CMake version becomes back to 3.12 from 3.18, which was upgraded in
#11.

### Motivation

Currently the Python client cannot be built with the default apt sources
on Ubuntu 20.04, whose default CMake version is 3.16. However, even
after I installed CMake 3.24 on Ubuntu 20.04, CMake would still fail to
find Boost.Python.

### Modifications

To fix the Boost.Python not found issue, find the `Python` component
instead of `Python3` when finding Boost.

In addition, when finding Python3, find the `Development` component
instead of the `Development.Module`, which is a sub-component of
`Development`. See
https://cmake.org/cmake/help/latest/module/FindPython3.html.

After that, the minimum required CMake version becomes back to 3.12 from
3.18, which was upgraded in
apache#11.
@BewareMyPower
Copy link
Contributor Author

The CMake error is:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
  Could not find a package configuration file provided by "boost_python3"
  (requested version 1.71.0) with any of the following names:

    boost_python3Config.cmake
    boost_python3-config.cmake

  Add the installation prefix of "boost_python3" to CMAKE_PREFIX_PATH or set
  "boost_python3_DIR" to a directory containing one of the above files.  If
  "boost_python3" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
  /home/xyz/cmake-3.24.2-linux-x86_64/share/cmake-3.24/Modules/FindBoost.cmake:594 (find_package)
  CMakeLists.txt:48 (find_package)

or the following messages with -DBoost_NO_BOOST_CMAKE=ON option:

CMake Error at /home/xyz/cmake-3.24.2-linux-x86_64/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: python3) (found version "1.71.0")
Call Stack (most recent call first):
  /home/xyz/cmake-3.24.2-linux-x86_64/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /home/xyz/cmake-3.24.2-linux-x86_64/share/cmake-3.24/Modules/FindBoost.cmake:2376 (find_package_handle_standard_args)
  CMakeLists.txt:48 (find_package)

@BewareMyPower BewareMyPower marked this pull request as draft October 21, 2022 10:04
@BewareMyPower
Copy link
Contributor Author

It can be fixed by a simple CMake upgrade now after #23.

We cannot use find_package(Python3 COMPONENTS Development) because it will fail in manylinux container.

@BewareMyPower BewareMyPower deleted the bewaremypower/add-find-boost-python branch November 2, 2022 03:55
@BewareMyPower BewareMyPower removed this from the 3.0.0 milestone Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant