Skip to content

Init a new branch to update to meson v1.11#27

Open
seiko2plus wants to merge 29 commits into
numpy:main-numpymeson-1.11from
seiko2plus:module_feature_1_11
Open

Init a new branch to update to meson v1.11#27
seiko2plus wants to merge 29 commits into
numpy:main-numpymeson-1.11from
seiko2plus:module_feature_1_11

Conversation

@seiko2plus

@seiko2plus seiko2plus commented Jun 13, 2026

Copy link
Copy Markdown
Member

Likely during the merge to v1.9.2 (#24), an incomplete or diverged rebase broke the meson sub-project functionality (see CI errors within numpy/numpy#29699). Therefore, I created a new clean branch main-numpymeson-1.11 for meson v1.11, also I made a few changes to make the module feature, and blas compatible with the latest versions of meson; see the original PR mesonbuild#11307.

back-ported

AI disclosure

Parts of this PR were written with the assistance of an AI coding tool
(Claude Code). All changes were reviewed, tested, and verified by me; I take
responsibility for the contents.

seiko2plus and others added 18 commits June 13, 2026 23:55
  This module aims to provide a more dynamic way to control common
  features between compilers that would generally require special
  headers, arguments, or compile-time test cases, quite ideal
  to manage CPU features and solve compatibility issues.
  and brings X86 CPU features
  - Removes CPU features implmentation and move them NumPy meson scripts

  - Removes attr 'header', since it can be handeled within
    a configuration file
  - re-implment method test, make it more simple

  - Implment method `multi_targets`
    Handels multi_targets via meson script was pretty anoyning
    from python make it much simpler
  - Improve multi_targets() method:

    * rename multi_target() to multi_targets() use plural to indicates handling more than one CPU target
    * Split the function into multiple smaller functions for better organization.
    * Modify the function to return a single library array instead of a list of libraries.
    * Avoid returning the result of testing the enabled features to keep it
    * simple.
    * Enhance debugging capabilities by printing the test results of enabled targets.
    * Avoid returns static_lib instead wraps it with another object
      to reduce the number of final generated objects also
      to sort the all objects based on lowest interest
    * validate the sort of dispatch features

  - fix mypy
  - init the module doc
  - allow disables the cache
  - fix method `features.new` name during trigger arguments errors
  - generate config files inside the builddir instead
  - add test cases
  - cache tests within coredata
  - fix duplicate baseline build
  - refactor module name from `feature` to `features`
  - fix python typying
- Attributes without match were never actually added to the list
- Only the last conflict actually had an effect, earlier results were
  discarded
rgommers and others added 7 commits June 14, 2026 04:34
…dependencies

Also a bit of refactoring and improvements to OpenBLAS and MKL logic
to reduce the amount of unnecessary checks.
The two things fixed here:
- `xcrun` isn't available on very old versions (MacPorts still supports
  10.5/10.6)
- Version comparison is done correctly now with
  `mesonlib.version_compare`

See numpy/numpy#25406 for the bug report.
@seiko2plus seiko2plus force-pushed the module_feature_1_11 branch 3 times, most recently from 2acb911 to 336cf07 Compare June 20, 2026 10:51
…eson

Port blas_lapack.py to the current Meson dependency/compiler APIs and fix all mypy errors.
@seiko2plus seiko2plus force-pushed the module_feature_1_11 branch 2 times, most recently from 4221e53 to 91cdc45 Compare June 20, 2026 12:54
freakboy3742 and others added 2 commits June 20, 2026 16:42
Sayed: Fix BLAS/LAPACK 3.14 subprocess encoding; guard ios_ver for mypy < 3.13
main.f90 uses default 32-bit integers, so ILP64 (e.g. MKL) segfaults.
@seiko2plus seiko2plus force-pushed the module_feature_1_11 branch from 91cdc45 to ce09643 Compare June 20, 2026 13:42
@seiko2plus seiko2plus marked this pull request as ready for review June 20, 2026 14:20
@seiko2plus

Copy link
Copy Markdown
Member Author

@rgommers, Do we still need #4?

# We also need the SDK to be >=13.3 (meaning at least XCode 14.3)
cmd = ['xcrun', '-sdk', 'macosx', '--show-sdk-version']
sdk_version = subprocess.run(cmd, capture_output=True, check=True, text=True).stdout.strip()
sdk_version = subprocess.run(cmd, capture_output=True, check=True, encoding='utf-8').stdout.strip()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fixes the 3.14 subprocess encoding. IDK if this bug has been reported or not.

@seiko2plus

Copy link
Copy Markdown
Member Author

Verified by numpy/numpy#31633

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.

5 participants