Skip to content

Move build system to meson-python - #303

Merged
ndgrigorian merged 47 commits into
masterfrom
use-meson-build
Jul 28, 2026
Merged

Move build system to meson-python#303
ndgrigorian merged 47 commits into
masterfrom
use-meson-build

Conversation

@ndgrigorian

@ndgrigorianndgrigorian commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

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)

@ndgrigorian
ndgrigorianforce-pushed the use-meson-build branch 4 times, most recently from fd5d163 to 182445dCompareApril 8, 2026 02:13
@ndgrigorian
ndgrigorian marked this pull request as ready for review April 8, 2026 06:51
CopilotAI review requested due to automatic review settings April 8, 2026 06:51

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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
FileDescription
setup.pyRemoved legacy setuptools build script.
pyproject.tomlSwitched build backend to mesonpy; adjusted formatter/lint tool config and removed setuptools-specific sections.
meson.buildNew Meson build: MKL dependency discovery, source generation, Cython extension build, and install rules.
conda-recipe/meta.yamlAdd Meson build tooling to host requirements; remove setuptools.
conda-recipe/build.shBuild/install via pip without setting MKLROOT.
conda-recipe/bld.batBuild/install via pip without setting MKLROOT.
conda-recipe-cf/meta.yamlSame as Intel recipe for conda-forge context.
conda-recipe-cf/build.shBuild/install via pip instead of setup.py.
conda-recipe-cf/bld.batBuild/install via pip instead of setup.py.
.github/workflows/build-with-standard-clang.ymlNew CI job validating Meson-based builds with system clang.
.github/workflows/build-with-clang.ymlUpdate dependency installation to Meson-based toolchain (workflow still uses editable install later).
.github/workflows/build_pip.ymlUpdate dependency installation to Meson-based toolchain (workflow still uses editable install).
.flake8Exclude new vendored helper script.
_vendored/README.mdDocument additional vendored script origin.
_vendored/process_src_template.pyNew vendored CLI for generating *.c from *.c.src.
_vendored/conv_template.pyFormatting/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.

Comment thread.github/workflows/build-with-clang.yml
Comment threadmeson.build
Comment thread_vendored/process_src_template.py
@ndgrigorian
ndgrigorianforce-pushed the use-meson-build branch 4 times, most recently from d321b0d to 1f244f9CompareApril 8, 2026 08:27
Comment threadconda-recipe/meta.yaml
Comment threadconda-recipe-cf/meta.yaml
@ndgrigorian
ndgrigorian changed the base branch from master to drop-mkl-service-dependencyApril 9, 2026 21:26
@ndgrigorian
ndgrigorianforce-pushed the use-meson-build branch 3 times, most recently from 2aaa278 to 619eff1CompareApril 9, 2026 21:33
@ndgrigorian
ndgrigorianforce-pushed the drop-mkl-service-dependency branch from aaf2822 to 81767b3CompareApril 9, 2026 21:36
@ndgrigorian
ndgrigorianforce-pushed the drop-mkl-service-dependency branch from 81767b3 to a8169a5CompareApril 9, 2026 23:32
@ndgrigorian
ndgrigorianforce-pushed the use-meson-build branch 2 times, most recently from 5118b1d to 1ec3c0eCompareApril 10, 2026 00:25
Base automatically changed from drop-mkl-service-dependency to masterApril 14, 2026 02:17
@vlad-perevezentsev

Copy link
Copy Markdown
Collaborator

The last commit is experimental 54edcb2 that switches conda-recipe build scripts from pip wheel/pip install to python -m build aligning with mkl-service to enable verbose ninja output by -Ccompile-args=-v.
It also adds python-build >=1.2.2 as a dependency

@vlad-perevezentsev

Copy link
Copy Markdown
Collaborator

@antonwolfy@jharlow-intel
This PR is ready for review

Comment thread.github/workflows/build_pip.yml Outdated
@antonwolfyantonwolfy added this to the 2.3.0 release milestone Jul 23, 2026
Comment threadconda-recipe/build.sh
Comment threadconda-recipe-cf/build.sh Outdated
Comment threadconda-recipe-cf/bld.bat
Comment threadmeson.build Outdated
Comment threadconda-recipe/build.sh Outdated
Comment threadconda-recipe-cf/meta.yaml
Comment thread.github/workflows/conda-package.yml Outdated
Comment threadmeson.build Outdated
modules: ['MKL::MKL'],
cmake_args: [
'-DMKL_ARCH=intel64',
'-DMKL_LINK=dynamic',

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.

I wonder why we use SDL here for mkl-service and SDL also in legacy mkl_fft. Is that intentional to migrate to dynamic link?

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.

I am not sure why sdl was changed to dynamic
@ndgrigorian could you please explain this?

In any case this change is not part of the meson migration.
If needed it can be done in a separate PR
I reverted it back to sdl

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

Reasoning was related to the change in mkl_umath to specify gnu_thread/intel_thread due to the issues with large size arrays. But probably, it wasn't needed.

Comment threadconda-recipe-cf/meta.yaml Outdated
Comment thread.github/workflows/build-with-standard-clang.yml Outdated
Comment thread.github/workflows/build-with-standard-clang.yml Outdated
Comment threadconda-recipe/build.sh Outdated

@antonwolfyantonwolfy left a comment

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.

Thank you @vlad-perevezentsev
No more comments from me, LGTM!

@ndgrigorian
ndgrigorian merged commit 9165494 into masterJul 28, 2026
121 of 122 checks passed
@ndgrigorian
ndgrigorian deleted the use-meson-build branch July 28, 2026 13:35
Sign up for freeto 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.

4 participants

@ndgrigorian@vlad-perevezentsev@antonwolfy