-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[boost] add support for multiple boost_python versions #11998
Conversation
This comment has been minimized.
This comment has been minimized.
I detected other pull requests that are modifying boost/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
8bfdcd4
to
f1977f9
Compare
This comment has been minimized.
This comment has been minimized.
f1977f9
to
e307c4b
Compare
This comment has been minimized.
This comment has been minimized.
New version of the patch adds new options |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
FIXME: doesn't yet package the extra libs. |
6b075ab
to
95b8865
Compare
This comment has been minimized.
This comment has been minimized.
95b8865
to
1cf7742
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
cd2a4e6
to
80519b4
Compare
This comment has been minimized.
This comment has been minimized.
80519b4
to
9b9f12b
Compare
This comment has been minimized.
This comment has been minimized.
Boost b2 supports building Boost.Python for multiple python versions. (https://www.boost.org/doc/libs/1_79_0/libs/python/doc/html/building/configuring_boost_build.html) Pass option `boost:pythonXY_executable` to enable building boost_python for X.Y of python. For example when in a python 3.10 environment, adding these options: -o boost:python27_executable=`which python2.7` \ -o boost:python36_executable=`which python3.6` \ ... Will build libboost_python310 (the default), libboost_python27 and libboost_python36.
9fe3719
to
41e0ce4
Compare
FIXME: raise an error when explicitly specifying `pythonXY_version` without the matching `pythonXY_executable` option. FIXME: extra python libs are missing python_buildid and buildid
814a648
to
ea44f85
Compare
Tests only one detected python.
self._pythons is only populated in the configure method so use the explicit options instead. FIXME: does this work for implicit (detected) python version?
FIXME: fix ABI compatibility between python versions Given:
This should work:
And should install the pre-built package. |
(v, _) = self._all_pythons()[0] | ||
cmake.definitions["Python_ADDITIONAL_VERSIONS"] = "{}.{}".format(v.major, v.minor) | ||
cmake.definitions["PYTHON_COMPONENT_SUFFIX"] = "{}{}".format(v.major, v.minor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (somewhat arbitrary) selection of python lib to link against means all enabled pythons must have their equivalent pythonXY-devel package installed.
Otherwise no /usr/lib/libpythonXY.so and cmake configure fails with errors of the form:
CMake Error at CMakeLists.txt:113 (target_link_libraries):
Target "hello_ext" links to:
Boost::python39
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
|
Should be compatible with *any* extra versions (max 2^len(PYTHON_VERSIONS) packages) but limiting it to just any one extra. e.g. `conan install -o boost:python310=True` could fall back to `-o boost:python310=True -o boost:python27=True`
I could remove all python libs from Any ideas to resolve this last stumbling block @SSE4, @uilianries ? |
All green in build 28 (
|
Hooks produced the following warnings for commit aa5b781boost/1.71.0
boost/1.74.0
boost/1.77.0
boost/1.70.0
boost/1.76.0
boost/1.72.0
boost/1.78.0
boost/1.73.0
boost/1.75.0
boost/1.79.0
|
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Not workable. |
Fixes #12038.
fixes #12122
Specify library name and version: boost >=1.70
Boost (
>=1.67
) supports building multiple versions of boost_pythonXY for various python versions.This adds support for building these libraries.
Python versions are specified using
boost:pythonXY=True
andboost:pythonXY_executable
.The options are provided for python 2.7 and 3.5+.
Example:
As part of these changes python-related methods were refactored to
class PythonTool
.Example Usage
Implicit:
boost:without_python=False
Enable current python (as used for conan invocation) and set correct
pythonXY
.e.g.
Explicit:
boost:pythonXY_version=True
Build one or more specific versions. Disables detection of current python.
Requires a matching
boost:pythonXY_executable
option.Does not imply
boost:without_python=False
which must also be specified explicitly.e.g.
Workflow
This does not work:
Alternatively: