-
Notifications
You must be signed in to change notification settings - Fork 23
Move build system to meson-python
#303
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
Open
ndgrigorian
wants to merge
15
commits into
drop-mkl-service-dependency
Choose a base branch
from
use-meson-build
base: drop-mkl-service-dependency
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
75db327
move build system to meson
ndgrigorian e3bdda5
use meson-python in meta.yaml files
ndgrigorian 8c48a06
add cmake to build system dependencies
ndgrigorian 0e6a2f9
don't set MKLROOT
ndgrigorian 43bb9c8
update clang and pip builds
ndgrigorian 8180487
remove MKLROOT from build_pip
ndgrigorian b5cf45c
add standard clang build workflow
ndgrigorian 9a86b95
make ninja explicit in pyproject.toml and meta.yamls
ndgrigorian e19f3da
use pip install in conda-forge build scripts
ndgrigorian a725ccc
remove jq from pip build
ndgrigorian c191245
build_pip.yaml -> build_pip.yml
ndgrigorian 86a9b52
add comment justifying get_compiler call in meson build
ndgrigorian ad0681d
remove redundant mkl pip installation in standard clang build
ndgrigorian 1597f35
install mkl-service with --no-deps in clang build
ndgrigorian 1ec3c0e
add openmp as explicit conda package requirement
ndgrigorian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Build project with standard clang compiler | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| build-with-standard-clang: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| python: ["3.10", "3.11", "3.12", "3.13", "3.14"] | ||
| numpy_version: ["numpy'>=2'"] | ||
|
|
||
| env: | ||
| COMPILER_ROOT: /usr/bin | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash -el {0} | ||
|
|
||
| steps: | ||
| - name: Cancel Previous Runs | ||
| uses: styfle/cancel-workflow-action@3155a141048f8f89c06b4cdae32e7853e97536bc # 0.13.0 | ||
| with: | ||
| access_token: ${{ github.token }} | ||
|
|
||
| - name: Install Dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y clang | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: ${{ matrix.python }} | ||
| architecture: x64 | ||
|
|
||
| - name: Checkout repo | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install mkl_fft dependencies | ||
| run: | | ||
| pip install meson-python ninja cmake cython mkl-devel | ||
| pip install ${{ matrix.numpy_version }} | ||
|
|
||
| - name: Build mkl_fft | ||
| run: | | ||
| export CC=${{ env.COMPILER_ROOT }}/clang | ||
| pip install . --no-build-isolation --no-deps --verbose | ||
|
|
||
| - name: Run mkl_fft tests | ||
| run: | | ||
| pip install pytest mkl-service scipy | ||
| # mkl_fft cannot be installed in editable mode, we need | ||
| # to change directory before importing it and running tests | ||
| cd .. | ||
| python -m pytest -sv --pyargs mkl_fft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| ## Vendored files | ||
|
|
||
| File `conv_template.py` is copied from NumPy's numpy/distutils folder, since | ||
| `numpy.distutils` is absent from the installation layout starting with | ||
| Python 3.12 | ||
| Files `conv_template.py` and `process_src_template.py` are copied from NumPy's numpy/numpy/_build_utils folder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| #!/usr/bin/env python3 | ||
| import argparse | ||
| import importlib.util | ||
| import os | ||
|
|
||
|
|
||
| def get_processor(): | ||
| # Convoluted because we can't import from numpy | ||
| # (numpy is not yet built) | ||
| conv_template_path = os.path.join( | ||
| os.path.dirname(__file__), | ||
| 'conv_template.py' | ||
| ) | ||
| spec = importlib.util.spec_from_file_location( | ||
| 'conv_template', conv_template_path | ||
| ) | ||
| mod = importlib.util.module_from_spec(spec) | ||
| spec.loader.exec_module(mod) | ||
| return mod.process_file | ||
|
|
||
|
|
||
| def process_and_write_file(fromfile, outfile): | ||
| """Process tempita templated file and write out the result. | ||
|
|
||
| The template file is expected to end in `.src` | ||
| (e.g., `.c.src` or `.h.src`). | ||
| Processing `npy_somefile.c.src` generates `npy_somefile.c`. | ||
|
|
||
| """ | ||
| process_file = get_processor() | ||
| content = process_file(fromfile) | ||
| with open(outfile, 'w') as f: | ||
| f.write(content) | ||
|
|
||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument( | ||
| "infile", | ||
| type=str, | ||
| help="Path to the input file" | ||
| ) | ||
| parser.add_argument( | ||
| "-o", | ||
| "--outfile", | ||
| type=str, | ||
| help="Path to the output file" | ||
| ) | ||
| parser.add_argument( | ||
| "-i", | ||
| "--ignore", | ||
| type=str, | ||
| help="An ignored input - may be useful to add a " | ||
| "dependency between custom targets", | ||
| ) | ||
| args = parser.parse_args() | ||
|
|
||
| if not args.infile.endswith('.src'): | ||
| raise ValueError(f"Unexpected extension: {args.infile}") | ||
|
|
||
| outfile_abs = os.path.join(os.getcwd(), args.outfile) | ||
ndgrigorian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| process_and_write_file(args.infile, outfile_abs) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| set MKLROOT=%PREFIX% | ||
| %PYTHON% setup.py build --force install --old-and-unmanageable | ||
| %PYTHON% -m pip install --no-build-isolation --no-deps . | ||
| if errorlevel 1 exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| #!/bin/bash -x | ||
|
|
||
| # make sure that compiler has been sourced, if necessary | ||
|
|
||
| export MKLROOT=${PREFIX} | ||
| $PYTHON setup.py build --force install --old-and-unmanageable | ||
| $PYTHON -m pip install --no-build-isolation --no-deps . |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.