Skip to content
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

ENH: BLD: enable building SciPy with Meson #14847

Merged
merged 33 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e20a577
BLD: meson: add main meson.build files and `_lib` and `_build_utils`
rgommers Oct 12, 2021
3cf395e
BLD: meson: add support for `cluster`
rgommers Oct 12, 2021
d90d67e
BLD: meson: add support for `constants`
rgommers Oct 12, 2021
ee391d4
BLD: meson: add support for `fft`
rgommers Oct 12, 2021
58e80dd
BLD: meson: add support for `interpolate`
rgommers Oct 12, 2021
707647a
BLD: meson: add support for `linalg`
rgommers Oct 12, 2021
1d21781
BLD: meson: add support for `sparse` and `sparse.csgraph`
rgommers Oct 12, 2021
d7da189
BLD: meson: add support for `special`
rgommers Oct 12, 2021
a215b70
BLD: meson: add support for `odr`
rgommers Oct 12, 2021
a9b1270
BLD: meson: add support for `ndimage`
rgommers Oct 12, 2021
1ce1e0b
BLD: meson: add support for `integrate`
czgdp1807 Oct 12, 2021
202e36b
BLD: meson: add support for `optimize`
czgdp1807 Oct 12, 2021
1706cee
BLD: meson: add support for `spatial`
czgdp1807 Oct 12, 2021
b7d00e5
BLD: meson: add support for `stats`
czgdp1807 Oct 12, 2021
38a17fd
BLD: meson: add support for `sparse.linalg`
czgdp1807 Oct 12, 2021
7c585d7
BLD: meson: add support for `io`
czgdp1807 Oct 12, 2021
35eb646
BLD: meson: add support for `fftpack`
rgommers Oct 12, 2021
a241670
BLD: meson: add support for `misc`
Smit-create Oct 12, 2021
54b45c3
BLD: meson: add support for `signal`
Smit-create Oct 12, 2021
8010344
DEV: add ninjatracing.py script for profiling build performance
rgommers Oct 12, 2021
c32c823
BLD: meson: make version string and `__config__` generation work
HarshCasper Oct 12, 2021
e609d7d
DEV: meson: add a tool to check that all Python test files got installed
Smit-create Oct 12, 2021
ea581bb
BLD: add script to process f2py `.src` template files
rgommers Oct 12, 2021
506b557
MAINT: add files to `.gitignore`
rgommers Oct 12, 2021
4204dbb
DEV: meson: add a conda environment file for Meson
rgommers Oct 12, 2021
8704c00
DEV: meson: add a dev.py script (similar to runtests.py)
rgommers Oct 12, 2021
ccd8ec6
DOC: meson: add documentation on using Meson to the contributor guide
rgommers Oct 12, 2021
23219d7
CI: meson: add a Linux Meson build which uses `-Werror`
rgommers Oct 12, 2021
aec36cb
DOC: add documentation on how to run a CI job locally with Act
HarshCasper Oct 13, 2021
1315fe0
BLD: Windows support in Meson build
matthew-brett Dec 24, 2021
c941cf2
BLD: updates to meson.build files for recent changes in SciPy master
rgommers Dec 24, 2021
40c3f67
BLD: meson: update build config for `optimize._highs` changes
rgommers Dec 29, 2021
b22f0c7
DOC: extend Meson build documentation
rgommers Dec 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/workflows/linux_meson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Linux Meson tests

# This is a single job: Python 3.9, building with Meson, using -Werror to
# ensure we remain at zero build warnings. Other Meson CI jobs are running
# on https://github.com/rgommers/scipy/tree/meson

on:
push:
branches:
- master
- maintenance/**
pull_request:
branches:
- master
- maintenance/**

env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
INSTALLDIR: "installdir"

jobs:
test_meson:
name: Meson build
# If using act to run CI locally the github object does not exist and the usual skipping should not be enforced
if: "github.repository != '' || github.repository == 'scipy/scipy' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]') && !contains(github.ref, 'maintenance/') && !contains(github.base_ref, 'maintenance/')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Ubuntu dependencies
run: |
# NOTE: not the same OpenBLAS version as in upstream CI (I'm being lazy here)
sudo apt-get update
sudo apt-get install -y libopenblas-dev libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache libmpc-dev

- name: Caching Python dependencies
uses: actions/cache@v2
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip

- name: Install Python packages
run: |
python -m pip install numpy setuptools wheel cython pytest pytest-xdist pybind11 mpmath gmpy2 pythran ninja meson==0.60.3

- name: Prepare compiler cache
id: prep-ccache
shell: bash
run: |
mkdir -p "${CCACHE_DIR}"
echo "::set-output name=dir::$CCACHE_DIR"
NOW=$(date -u +"%F-%T")
echo "::set-output name=timestamp::${NOW}"

- name: Setup compiler cache
uses: actions/cache@v2
id: cache-ccache
# Reference: https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
# NOTE: The caching strategy is modeled in a way that it will always have a unique cache key for each workflow run
# (even if the same workflow is run multiple times). The restore keys are not unique and for a partial match, they will
# return the most recently created cache entry, according to the GitHub Action Docs.
with:
path: ${{ steps.prep-ccache.outputs.dir }}
# Restores ccache from either a previous build on this branch or on master
key: ${{ github.workflow }}-${{ matrix.python-version }}-ccache-linux-${{ steps.prep-ccache.outputs.timestamp }}
# This evaluates to `Linux Tests-3.9-ccache-linux-` which is not unique. As the CI matrix is expanded, this will
# need to be updated to be unique so that the cache is not restored from a different job altogether.
restore-keys: |
${{ github.workflow }}-${{ matrix.python-version }}-ccache-linux-

- name: Setup build and install scipy
run: |
python dev.py -j 2 --build-only --werror

- name: Ccache performance
shell: bash -l {0}
run: ccache -s

- name: Check installation
run: |
pushd tools
python check_installation.py ${{ env.INSTALLDIR }}
popd

- name: Test SciPy
run: |
export OMP_NUM_THREADS=2
python dev.py -n -j 2
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ setup.cfg
.libs
.eggs
pip-wheel-metadata
# install directory for Meson
installdir/

# Paver generated files #
#########################
Expand Down
Loading