Skip to content

Conversation

@meyerj
Copy link

@meyerj meyerj commented Aug 2, 2018

Fixes #215.

The boost_python library has been renamed in Boost 1.67 and the FindBoost.cmake module requires a Python version suffix.

Currently hard-coding python27 for Python 2 builds, but I assume that's a reasonable assumption. The alternative would be to extract the major and minor version from PYTHONLIBS_VERSION_STRING.

@meyerj meyerj changed the title cv_bridge: fix finding Boost Python library after its renaming in Boost 1.67 Fix finding Boost Python library after its renaming in Boost 1.67 Aug 2, 2018
@meyerj
Copy link
Author

meyerj commented Aug 3, 2018

Duplicate of #225.

But I think cmake should check for Boost 1.67 and not for Apple. It just happens that macOS+HomeBrew is already using Boost 1.67. But the problem would affect other OS in the same way and on the other side we are also using macOS with pinned older versions of Boost.

@berkaydeniz berkaydeniz mentioned this pull request Aug 8, 2018
@NikolausDemmel
Copy link

+1, this fixes compilation for me on macos sierra

@rossburton
Copy link

Obviously this is a bit of a hack for Python 2 (although as there's never going to be a 2.8, it works), but more importantly it totally fails for Python 3 builds.

@meyerj
Copy link
Author

meyerj commented Oct 16, 2018

Obviously this is a bit of a hack for Python 2 (although as there's never going to be a 2.8, it works), but more importantly it totally fails for Python 3 builds.

Should be fixed in b57fd5b, but I did not actually test it yet with Boost 1.67 or greater.

@ijnek
Copy link
Member

ijnek commented Sep 7, 2022

Hi @meyerj, I've recently become a maintainer of this repo, and I'm going through the PRs to figure out which PRs are active or stale. Sorry this PR took a long time.

Considering this PR is against kinetic which has reached EOL, I'm going to close this out. If you do believe the changes here are necessary in other distros, feel free to retarget another branch. Thanks!

@ijnek ijnek closed this Sep 7, 2022
@meyerj
Copy link
Author

meyerj commented Sep 7, 2022

I am not working with macOS anymore those days, but obviously the current version of the CMake code on branch noetic is still based on assumptions about the combination of Boost and Python versions that may only hold on specific Linux distrubtions:

if(NOT ANDROID)
find_package(PythonLibs)
if(PYTHONLIBS_VERSION_STRING VERSION_LESS "3.8")
# Debian Buster
find_package(Boost REQUIRED python37)
else()
# Ubuntu Focal
find_package(Boost REQUIRED python)
endif()
else()
find_package(Boost REQUIRED)
endif()

According to the documentation, whether find_package(Boost REQUIRED pythonXY) requires the version suffix XY or not actually depends on the Boost version, not on the Python version. Apparently it still somehow works without that for Ubuntu Focal and all supported distributions that also have Python 3.8 or higher (the else branch), but that may be distribution-specific then? Or related to Boost CMake available from version 1.70 on?

Anyway, Python 2 is mostly irrelevant by now, and likely the same holds for Boost versions older than 1.67, so the proposed patch as-is does not add any value anymore. On ROS 2 branches the same issue has already been addresses in different ways (#246, #279, #421), so the best path forward would be to backport those changes back into ROS 1, or to merge them, in order to support a wide range of platforms for both. All that does not depend on the ROS version and applies to ROS 1 and 2 in the same way, I guess.

@meyerj meyerj deleted the fix-cmake-for-boost-python-1.67 branch September 7, 2022 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot locate Boost-Python

4 participants