close
Skip to content

Add python-numpy-include feature - #611

Open
robwoolley wants to merge 1 commit into
bfgroup:mainfrom
robwoolley:main
Open

Add python-numpy-include feature#611
robwoolley wants to merge 1 commit into
bfgroup:mainfrom
robwoolley:main

Conversation

@robwoolley

Copy link
Copy Markdown

Proposed changes

The b2 python.jam file attempts to import the NumPy module to determine whether the Boost.Python NumPy extension should be enabled. This approach is problematic when cross-compiling, particularly because NumPy includes C extensions built for the target architecture.

Introduce the new python-numpy-include feature to avoid probing for NumPy at build time by allowing the include path to be specified explicitly.

This enables build systems to provide the correct NumPy include directory, eliminating the need to import the NumPy module to find the directory in site-packages.

Sample output of the change when used through BitBake / OpenEmbedded can be seen here: https://lists.openembedded.org/g/openembedded-core/message/243301

Types of changes

What types of changes does your code introduce?

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes
  • Other (please describe):

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I searched the discussions
  • I searched the closed and open issues
  • I read the contribution guidelines
  • I added myself to the copyright attributions for significant changes
  • I checked that tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • I added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

The b2 python.jam file attempts to import the NumPy module to
determine whether the Boost.Python NumPy extension should be
enabled. This approach is problematic when cross-compiling,
particularly because NumPy includes C extensions built for the
target architecture.

Introduce the new python-numpy-include feature to avoid probing for
NumPy at build time by allowing the include path to be specified
explicitly.

This enables build systems to provide the correct NumPy include
directory, eliminating the need to import the NumPy module to find
the directory in site-packages.

Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
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.

1 participant