Skip to content

Commit

Permalink
sagemathgh-36524: Compile everything with meson
Browse files Browse the repository at this point in the history
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

Add meson configuration to compile sagelib with meson. Basic developer
docs are added as well (meant as background info, not real installation
instructions and thus under "developer").

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36524
Reported by: Tobias Diez
Reviewer(s): Dima Pasechnik, Gonzalo Tornaría, Matthias Köppe, Michael Orlitzky, Tobias Diez
  • Loading branch information
Release Manager committed Oct 22, 2024
2 parents 7726cd9 + 2bf9a09 commit fc94bf0
Show file tree
Hide file tree
Showing 167 changed files with 7,288 additions and 248 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/ci-meson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build & Test using Meson

on:
push:
branches:
- master
- develop
pull_request:
workflow_dispatch:
# Allow to run manually

concurrency:
# Cancel previous runs of this workflow for the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Conda (${{ matrix.os }}, Python ${{ matrix.python }})
runs-on: ${{ matrix.os }}-latest

strategy:
fail-fast: false
matrix:
os: [ubuntu]
python: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v4

- name: Merge CI fixes from sagemath/sage
run: |
.ci/merge-fixes.sh
env:
GH_TOKEN: ${{ github.token }}

- name: Cache conda packages
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ hashFiles('src/environment-3.11-linux.yml') }}

- name: Compiler cache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-meson-${{ matrix.python }}

- name: Setup Conda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
miniforge-version: latest
use-mamba: true
channels: conda-forge
channel-priority: true
activate-environment: sage
environment-file: src/environment-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && (startsWith(runner.arch, 'ARM') && 'macos' || 'macos-x86_64') || 'linux' }}.yml

- name: Print Conda environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Build
shell: bash -l {0}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CC="ccache $CC"
export CXX="ccache $CXX"
pip install --no-build-isolation --config-settings=builddir=builddir . -v
- name: Test
shell: bash -l {0}
run: |
# We don't install sage_setup, so don't try to test it
rm -R ./src/sage_setup/
./sage -t --all -p4
170 changes: 170 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ __pycache__/

# Generated by sage_setup.autogen
/src/sage/ext/interpreters
!/src/sage/ext/interpreters/meson.build

# Generated Cython files
*.so
**/*.so
**/*.so.old
/src/cython_debug
# Most C and C++ files are generated by Cython and should not
# be included in the sdist.
Expand Down Expand Up @@ -299,3 +301,171 @@ src/.coverage/
# git worktree
worktree*
**/worktree*

# Meson build directory
builddir
builddir-*
build-install
build/cp*

# Meson temporary files
src/sage/interfaces/__init__.py
src/sage/crypto/block_cipher/__init__.py
src/sage/crypto/public_key/__init__.py
src/sage/logic/__init__.py
src/sage/parallel/__init__.py
src/sage/dynamics/cellular_automata/__init__.py
src/sage/dynamics/arithmetic_dynamics/__init__.py
src/sage/dynamics/__init__.py
src/sage/dynamics/complex_dynamics/__init__.py
src/sage/knots/__init__.py
src/sage/topology/__init__.py
src/sage/functions/__init__.py
src/sage/manifolds/subsets/__init__.py
src/sage/manifolds/__init__.py
src/sage/manifolds/differentiable/examples/__init__.py
src/sage/manifolds/differentiable/__init__.py
src/sage/coding/source_coding/__init__.py
src/sage/coding/guruswami_sudan/__init__.py
src/sage/coding/__init__.py
src/sage/coding/codecan/__init__.py
src/sage/games/__init__.py
src/sage/quivers/__init__.py
src/sage/schemes/cyclic_covers/__init__.py
src/sage/schemes/plane_conics/__init__.py
src/sage/schemes/curves/__init__.py
src/sage/schemes/plane_quartics/__init__.py
src/sage/schemes/jacobians/__init__.py
src/sage/schemes/toric/sheaf/__init__.py
src/sage/schemes/toric/__init__.py
src/sage/schemes/product_projective/__init__.py
src/sage/schemes/elliptic_curves/__init__.py
src/sage/schemes/riemann_surfaces/__init__.py
src/sage/schemes/hyperelliptic_curves/__init__.py
src/sage/schemes/berkovich/__init__.py
src/sage/schemes/generic/__init__.py
src/sage/schemes/projective/__init__.py
src/sage/schemes/__init__.py
src/sage/schemes/affine/__init__.py
src/sage/modular/hecke/__init__.py
src/sage/modular/pollack_stevens/__init__.py
src/sage/modular/overconvergent/__init__.py
src/sage/modular/modform/__init__.py
src/sage/modular/quasimodform/__init__.py
src/sage/modular/modsym/__init__.py
src/sage/modular/local_comp/__init__.py
src/sage/modular/quatalg/__init__.py
src/sage/modular/ssmod/__init__.py
src/sage/modular/abvar/__init__.py
src/sage/modular/__init__.py
src/sage/modular/btquotients/__init__.py
src/sage/modular/arithgroup/__init__.py
src/sage/modular/modform_hecketriangle/__init__.py
src/sage/combinat/cluster_algebra_quiver/__init__.py
src/sage/combinat/root_system/__init__.py
src/sage/combinat/species/__init__.py
src/sage/combinat/designs/__init__.py
src/sage/combinat/posets/__init__.py
src/sage/combinat/matrices/__init__.py
src/sage/combinat/rigged_configurations/__init__.py
src/sage/combinat/ncsf_qsym/__init__.py
src/sage/combinat/path_tableaux/__init__.py
src/sage/combinat/sf/__init__.py
src/sage/combinat/__init__.py
src/sage/combinat/chas/__init__.py
src/sage/combinat/ncsym/__init__.py
src/sage/combinat/words/__init__.py
src/sage/combinat/crystals/__init__.py
src/sage/tensor/modules/__init__.py
src/sage/tensor/__init__.py
src/sage/groups/matrix_gps/__init__.py
src/sage/groups/semimonomial_transformations/__init__.py
src/sage/groups/perm_gps/partn_ref2/__init__.py
src/sage/groups/perm_gps/partn_ref/__init__.py
src/sage/groups/perm_gps/__init__.py
src/sage/groups/__init__.py
src/sage/groups/affine_gps/__init__.py
src/sage/groups/abelian_gps/__init__.py
src/sage/groups/additive_abelian/__init__.py
src/sage/groups/lie_gps/__init__.py
src/sage/groups/misc_gps/__init__.py
src/sage/symbolic/__init__.py
src/sage/symbolic/integration/__init__.py
src/sage/lfunctions/__init__.py
src/sage/arith/__init__.py
src/sage/ext/__init__.py
src/sage/categories/examples/__init__.py
src/sage/categories/__init__.py
src/sage/modules/fg_pid/__init__.py
src/sage/modules/__init__.py
src/sage/modules/with_basis/__init__.py
src/sage/modules/fp_graded/steenrod/__init__.py
src/sage/modules/fp_graded/__init__.py
src/sage/misc/__init__.py
src/sage/rings/convert/__init__.py
src/sage/rings/invariants/__init__.py
src/sage/rings/finite_rings/__init__.py
src/sage/rings/function_field/__init__.py
src/sage/rings/function_field/drinfeld_modules/__init__.py
src/sage/rings/semirings/__init__.py
src/sage/rings/number_field/__init__.py
src/sage/rings/__init__.py
src/sage/rings/padics/__init__.py
src/sage/rings/valuation/__init__.py
src/sage/rings/asymptotic/__init__.py
src/sage/rings/polynomial/weil/__init__.py
src/sage/rings/polynomial/__init__.py
src/sage/rings/polynomial/padics/__init__.py
src/sage/monoids/__init__.py
src/sage/matrix/__init__.py
src/sage/matroids/__init__.py
src/sage/interacts/__init__.py
src/sage/__init__.py
src/sage/plot/__init__.py
src/sage/plot/plot3d/__init__.py
src/sage/typeset/__init__.py
src/sage/algebras/lie_conformal_algebras/__init__.py
src/sage/algebras/fusion_rings/__init__.py
src/sage/algebras/letterplace/__init__.py
src/sage/algebras/quatalg/__init__.py
src/sage/algebras/steenrod/__init__.py
src/sage/algebras/finite_dimensional_algebras/__init__.py
src/sage/algebras/__init__.py
src/sage/algebras/hecke_algebras/__init__.py
src/sage/algebras/lie_algebras/__init__.py
src/sage/algebras/quantum_groups/__init__.py
src/sage/quadratic_forms/genera/__init__.py
src/sage/quadratic_forms/__init__.py
src/sage/game_theory/__init__.py
src/sage/sandpiles/__init__.py
src/sage/sat/__init__.py
src/sage/homology/__init__.py
src/sage/geometry/riemannian_manifolds/__init__.py
src/sage/geometry/hyperplane_arrangement/__init__.py
src/sage/geometry/triangulation/__init__.py
src/sage/geometry/polyhedron/modules/__init__.py
src/sage/geometry/polyhedron/__init__.py
src/sage/geometry/polyhedron/combinatorial_polyhedron/__init__.py
src/sage/geometry/__init__.py
src/sage/geometry/hyperbolic_space/__init__.py
src/sage/sets/__init__.py
src/sage/probability/__init__.py
src/sage/numerical/backends/__init__.py
src/sage/numerical/__init__.py
src/sage/data_structures/__init__.py
src/sage/graphs/graph_decompositions/__init__.py
src/sage/graphs/generators/__init__.py
src/sage/graphs/__init__.py
src/sage/graphs/base/__init__.py
src/sage/databases/__init__.py
src/sage/stats/hmm/__init__.py
src/sage/stats/__init__.py
src/sage/stats/distributions/__init__.py
src/sage/libs/gap/__init__.py
src/sage/libs/mpfi/__init__.py
src/sage/libs/__init__.py
src/sage/libs/polybori/__init__.py
src/sage/libs/mpfr/__init__.py
src/sage/libs/mpc/__init__.py
src/sage/calculus/transforms/__init__.py
src/sage/calculus/__init__.py
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"pkgs/sage-conf_pypi/sage_root": true,
"pkgs/sage-docbuild/sage_docbuild": true,
"pkgs/sage-setup/sage_setup": true,
"pkgs/sagemath-*/sage": true
"pkgs/sagemath-*/sage": true,
"pkgs/sagemath-*/sage_setup": true
},
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
Expand Down
3 changes: 3 additions & 0 deletions bootstrap-conda
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ echo >&2 $0:$LINENO: generate conda environment files
) > environment-template.yml
(
sed 's/name: sage-build/name: sage/' environment-template.yml
echo " - meson"
echo " - meson-python"
echo " - pytest"
echo " # Additional packages providing all dependencies for the Sage library"
for pkg in $SAGELIB_SYSTEM_PACKAGES; do
echo " - $pkg"
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/sage_setup/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cython pkgconfig jinja2 $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/*.py $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/autogen/interpreters/specs/*.py $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/command/*.py | $(PYTHON_TOOLCHAIN) $(PYTHON)
cython pkgconfig jinja2 $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/*.py $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/autogen/interpreters/internal/specs/*.py $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/command/*.py | $(PYTHON_TOOLCHAIN) $(PYTHON)

----------
All lines of this file are ignored except the first.
Loading

0 comments on commit fc94bf0

Please sign in to comment.