Skip to content

Move build system to meson-python#303

Open
ndgrigorian wants to merge 14 commits intomasterfrom
use-meson-build
Open

Move build system to meson-python#303
ndgrigorian wants to merge 14 commits intomasterfrom
use-meson-build

Conversation

@ndgrigorian
Copy link
Copy Markdown
Collaborator

@ndgrigorian ndgrigorian commented Apr 7, 2026

This PR proposes moving from setuptools to meson-python as the mkl_fft build system

meson-python is already used by NumPy and allows setup.py to be removed (with its logic moved into the meson.build script)

Also moves to mkl as dependency, with mkl-service only used as a dependency when using the scipy interface. If scipy is installed without mkl-service, the scipy interface won't be available

@ndgrigorian ndgrigorian force-pushed the use-meson-build branch 2 times, most recently from 2c7d955 to 6b7640f Compare April 8, 2026 01:56
we search for MKL with cmake. Also drop pkg-config from meta.yamls and use cmake
@ndgrigorian ndgrigorian marked this pull request as ready for review April 8, 2026 06:51
Copilot AI review requested due to automatic review settings April 8, 2026 06:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates mkl_fft’s build backend from setuptools/setup.py to meson-python, moving extension/module build logic into meson.build and updating packaging/CI/conda recipes accordingly.

Changes:

  • Switch PEP 517 build backend to mesonpy and drop setup.py-based build configuration.
  • Add a Meson build definition that generates mklfft.c and builds/installs the _pydfti extension plus Python sources/tests.
  • Update conda recipes and CI workflows to install Meson-based build dependencies and build via pip.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
setup.py Removed legacy setuptools build script.
pyproject.toml Switched build backend to mesonpy; adjusted formatter/lint tool config and removed setuptools-specific sections.
meson.build New Meson build: MKL dependency discovery, source generation, Cython extension build, and install rules.
conda-recipe/meta.yaml Add Meson build tooling to host requirements; remove setuptools.
conda-recipe/build.sh Build/install via pip without setting MKLROOT.
conda-recipe/bld.bat Build/install via pip without setting MKLROOT.
conda-recipe-cf/meta.yaml Same as Intel recipe for conda-forge context.
conda-recipe-cf/build.sh Build/install via pip instead of setup.py.
conda-recipe-cf/bld.bat Build/install via pip instead of setup.py.
.github/workflows/build-with-standard-clang.yml New CI job validating Meson-based builds with system clang.
.github/workflows/build-with-clang.yml Update dependency installation to Meson-based toolchain (workflow still uses editable install later).
.github/workflows/build_pip.yml Update dependency installation to Meson-based toolchain (workflow still uses editable install).
.flake8 Exclude new vendored helper script.
_vendored/README.md Document additional vendored script origin.
_vendored/process_src_template.py New vendored CLI for generating *.c from *.c.src.
_vendored/conv_template.py Formatting/modernization changes to vendored tempita processor.
Comments suppressed due to low confidence (1)

.github/workflows/build_pip.yml:49

  • This workflow still installs the package in editable mode (pip install -e ...), but build-with-standard-clang.yml explicitly notes that mkl_fft cannot be installed in editable mode. If editable installs are indeed unsupported with the meson-python backend, switch this workflow to a non-editable install (pip install .) and run tests from outside the repo checkout (e.g., cd ..) to ensure imports come from the installed wheel. If editable installs are intended to be supported, please drop/adjust the comment in build-with-standard-clang.yml and ensure meson-python minimum version is set accordingly.

@ndgrigorian ndgrigorian force-pushed the use-meson-build branch 3 times, most recently from 09bf55a to 32ead19 Compare April 8, 2026 08:22
mkl-service is now an optional requirement, needed when the scipy interface is installed
- python
- python-gil # [py>=314]
- mkl-service
- {{ pin_compatible('mkl') }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The log points to missing dependency on openmp:

WARNING (mkl_fft,lib/python3.14/site-packages/mkl_fft/_pydfti.cpython-314-x86_64-linux-gnu.so): Needed DSO lib/libiomp5.so found in ['https://software.repos.intel.com/python/conda/linux-64::intel-openmp==2025.3.3=intel_30']
WARNING (mkl_fft,lib/python3.14/site-packages/mkl_fft/_pydfti.cpython-314-x86_64-linux-gnu.so): .. but ['https://software.repos.intel.com/python/conda/linux-64::intel-openmp==2025.3.3=intel_30'] not in reqs/run, (i.e. it is overlinking) (likely) or a missing dependency (less likely)

- python
- python-gil # [py>=314]
- mkl-service
- {{ pin_compatible('mkl') }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The log points to missing dependency on openmp:

WARNING (mkl_fft,lib/python3.14/site-packages/mkl_fft/_pydfti.cpython-314-x86_64-linux-gnu.so): Needed DSO lib/libomp.so found in ['conda-forge/linux-64::llvm-openmp==22.1.2=h4922eb0_0']
WARNING (mkl_fft,lib/python3.14/site-packages/mkl_fft/_pydfti.cpython-314-x86_64-linux-gnu.so): .. but ['conda-forge/linux-64::llvm-openmp==22.1.2=h4922eb0_0'] not in reqs/run, (i.e. it is overlinking) (likely) or a missing dependency (less likely)

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.

3 participants