-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Compile everything with meson #36524
Open
tobiasdiez
wants to merge
212
commits into
sagemath:develop
Choose a base branch
from
tobiasdiez:meson-compile
base: develop
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
212 commits
Select commit
Hold shift + click to select a range
bfac057
Use meson instead of configure for conda install
tobiasdiez 9694046
remove editable wheel customization
tobiasdiez 376742a
remove configure from conda ci
tobiasdiez e270392
Merge remote-tracking branch 'tobiasdiez/ci-conda-error' into meson-c…
tobiasdiez a21655b
Merge remote-tracking branch 'mkoeppe/conda_legacy_editable' into mes…
tobiasdiez 84ff7ff
Revert "remove editable wheel customization"
tobiasdiez 885e2b4
split setup and conf for cleaner display
tobiasdiez f755a8e
add meson to conda env
tobiasdiez 4406868
Fix style in conda docs
tobiasdiez c0cdb5f
add meson only in src env files
tobiasdiez b408311
keep configure around in the ci
tobiasdiez 4c8b56b
Merge remote-tracking branch 'origin/develop' into meson-config
tobiasdiez f6f27d9
fix conda-ci
tobiasdiez b4ff544
Compile categories with meson
tobiasdiez 26cca82
Restore atexit
tobiasdiez b2e7046
improve installation using meson-python
tobiasdiez 090aa2a
small improvements
tobiasdiez 393aa08
add a few more meson build files
tobiasdiez 7c2f3a1
add more meson files
tobiasdiez a1dc936
readd init
tobiasdiez 8a2cc9c
Fix build (kind of)
tobiasdiez 9baf964
Add meson to ci
tobiasdiez 21c4c9a
improve ci
tobiasdiez c3cdc31
don't apply ci fixes
tobiasdiez 52bc4c6
add pytest to conda env
tobiasdiez 8427fae
Merge remote-tracking branch 'tobiasdiez/rel_import_small' into meson…
tobiasdiez a06732f
Merge remote-tracking branch 'tobiasdiez/rel_import_structure' into m…
tobiasdiez 10bfec3
Merge remote-tracking branch 'tobiasdiez/rel_import_categories' into …
tobiasdiez 2c4f316
Merge remote-tracking branch 'tobiasdiez/rel_import_rings' into meson…
tobiasdiez c52827e
improve generate meson script
tobiasdiez 677c1f1
use sage to run pytest in ci
tobiasdiez fdd1655
add more meson configs
tobiasdiez 3840207
Merge remote-tracking branch 'tobiasdiez/rel_import_rings' into meson…
tobiasdiez 781f001
Merge branch 'rel_import_modules' into meson-compile
tobiasdiez 0152168
Merge branch 'rel_headers' into meson-compile
tobiasdiez 119fcfa
add version to pyproject.toml
tobiasdiez 0760fb2
fix test command in ci
tobiasdiez 573b569
Merge remote-tracking branch 'origin/develop' into meson-compile
tobiasdiez f25cbfa
add more meson build files
tobiasdiez eaa267f
Merge remote-tracking branch 'tobiasdiez/rel_import_rings' into meson…
tobiasdiez 5930aff
More meson files
tobiasdiez e650614
Merge branch 'rel_import_ntl' into meson-compile
tobiasdiez 100a35d
Add interpreters
tobiasdiez 5e28f54
Merge branch 'interpreters_outdir' into meson-compile
tobiasdiez 72799e7
Merge remote-tracking branch 'tobiasdiez/rel_headers' into meson-compile
tobiasdiez f0acc6d
Merge remote-tracking branch 'mkoeppe/absolute_cimport_sage_graphs' i…
tobiasdiez dbe7b15
Merge remote-tracking branch 'mkoeppe/absolute_cimport_sage_libs' int…
tobiasdiez 111b145
And another round of meson files
tobiasdiez c279072
Fix matrix
tobiasdiez a993e90
Merge remote-tracking branch 'mkoeppe/absolute_cimport_sage_geometry'…
tobiasdiez 8accfbd
Last set of meson files
tobiasdiez 9db105f
Last set of relative imports
tobiasdiez d3aaee7
cleanup
tobiasdiez 2486d99
fix ci
tobiasdiez 3e5f3c1
Improve symbolic compilation
tobiasdiez 3990cc0
improve docs
tobiasdiez d8c04cf
git ignore old so files
tobiasdiez c27aa7b
use dependency to find singular
tobiasdiez f0cbcfe
remove outdated comment
tobiasdiez e70b24e
remove gmpxx in symbolic
tobiasdiez 4519e18
fix a few runtime errors
tobiasdiez f5cc9d6
Merge remote-tracking branch 'tobiasdiez/rel_import_modules' into pr/…
tobiasdiez e4afb29
Properly compile dynamics
tobiasdiez c0e6c59
properly compile sat
tobiasdiez eaa04d4
ci: run tests
tobiasdiez 44d7498
Fix a few runtime errors
tobiasdiez 9d5afd3
Add missing singular dependencies
tobiasdiez dec2e02
Drop bogus ginac depencency
tobiasdiez 310975e
Fix a few more runtime errors
tobiasdiez 1c1bfa3
Remove dependency on https://github.com/sagemath/sage/pull/36489
tobiasdiez 7727ab1
fix farey compilation
tobiasdiez 8a6d93b
remove duplicate dependency
tobiasdiez d700f64
Fix farey compilation
tobiasdiez c60c866
Remove obsolete uncommented code
tobiasdiez edcdb2a
Try to fix farey header compilation
tobiasdiez 93d9000
try to fix farey compilation in ci
tobiasdiez 903c79b
Another try to fix farey
tobiasdiez cdc880f
Merge remote-tracking branch 'origin/develop' into pr/tobiasdiez/36524
tobiasdiez 9d689cb
Don't install farey header
tobiasdiez 37a67ab
Fix farey import error
tobiasdiez 3cee517
Merge branch 'develop' into meson-compile
tobiasdiez 395c310
Remove old warning about sage.gaprc
tobiasdiez b63beef
Fix compilation of interpreters
tobiasdiez 49fa87b
Git-ignore all builddirs
tobiasdiez 82c5f2b
Include static maxima file
tobiasdiez 8453c1c
Readd a few all imports
tobiasdiez 97053a7
Recreate missing init files
tobiasdiez efe272c
create dependency on generated interpreters
tobiasdiez 17888c9
Readd interpreter generation in ci
tobiasdiez 946ef70
And remove some of the init files again
tobiasdiez 0189df5
Fix interpreters include directory
tobiasdiez ef0ba56
Fix glpk import error
tobiasdiez 56e1d8d
Fix arb runtime error
tobiasdiez 1199bcd
Add missing init file
tobiasdiez 5759c28
Fix runtime errors due to missing glpk
tobiasdiez b4988ff
Don't remove init file in interpreters
tobiasdiez bd9fd26
Fix missing pari dependency
tobiasdiez 592e2f4
cleanup ci
tobiasdiez 4f5b91b
install ext_data
tobiasdiez 7a5c83e
Don't fail fast in ci
tobiasdiez c00b92f
set env variables correctly
tobiasdiez b391063
Add a few missing headers
tobiasdiez b78557d
correctly specify version
tobiasdiez 353b989
Properly set SAGE_SHARE to datadir, and warn if cremona is not installed
tobiasdiez 46dbc4f
Install more headers
tobiasdiez d328913
Readd init files
tobiasdiez 817c49c
Fix tests
tobiasdiez b5ffbe6
Fix linter
tobiasdiez fef4acf
Merge branch 'develop' into init_files
tobiasdiez 41a9f0e
Merge branch 'develop' into meson-compile
tobiasdiez f001d1a
Merge remote-tracking branch 'upstream/develop' into meson-compile
tobiasdiez db94088
Merge branch 'meson-compile' of https://github.com/tobiasdiez/sage in…
tobiasdiez 4698e07
update meson files
tobiasdiez 1adecdb
fix bernmm compilation
tobiasdiez 56f3394
fix missing python file
tobiasdiez c9f9948
fix a few more failing tests by installing necessary files
tobiasdiez 7205317
embed file position into cython docstrings
tobiasdiez 4e5d73e
Merge remote-tracking branch 'tobiasdiez/init_files' into meson-compile
tobiasdiez 7851141
Merge branch 'develop' into init_files
tobiasdiez e39f031
Merge branch 'develop' into meson-compile
tobiasdiez f74c257
Merge remote-tracking branch 'origin/develop' into pr/tobiasdiez/36524
tobiasdiez 36a8e75
Fix build error
tobiasdiez b468af3
cleanup
tobiasdiez 95ed032
Remove explicit file names from docs
tobiasdiez 4280f5d
Merge remote-tracking branch 'upstream/develop' into meson-compile
tobiasdiez d19ce80
Update meson file of sets
tobiasdiez 192c26b
Revert "Remove old warning about sage.gaprc"
tobiasdiez 88b6edd
fix farey header import
tobiasdiez cea7fd7
Print more infos during ci
tobiasdiez d2440c7
Implement gap root discovery in meson
tobiasdiez 88b8b47
Install missing directory
tobiasdiez 9879646
fix failing test
tobiasdiez 2e44f4f
docs: uninstall other sage packages
tobiasdiez 6a5a8da
include missing cython source file
tobiasdiez 1ab5f9e
Install missing file in groups
tobiasdiez 2fe2862
Merge remote-tracking branch 'upstream/develop' into init_files
tobiasdiez 580e14d
Merge branch 'develop' into meson-compile
tobiasdiez 76dfa79
Merge branch 'develop' into init_files
tobiasdiez 7891c11
Remove unused setuptools versioning in pyproject.toml
tobiasdiez ff68103
Fix bug with Cython source code not appearing in tracebacks
tobiasdiez 8793852
Fix runtime problem with lie algebras
tobiasdiez f930634
Cleanup meson files
tobiasdiez 866000e
Update documentation
tobiasdiez dbef9cc
Add meson as an installation option in table of contents
tobiasdiez 1174548
Use ccache action
tobiasdiez 52f0032
Add ccache to project compilers as workaround
tobiasdiez 76c36e3
Remove ccache from conda env
tobiasdiez ad1b8a7
Update ccache-action to use main branch
tobiasdiez 482dd0d
Explicitly set path to ccache
tobiasdiez 7943da6
Fix ccache-action version
tobiasdiez e8ae9cf
Update build configuration to force use ccache
tobiasdiez 634512b
Fix reference to section-prereqs in meson.rst
tobiasdiez 1c47bcd
Fix broken link in installation instructions
tobiasdiez 46bc6b4
Fix ccache restore key
tobiasdiez d823087
Merge branch 'develop' into init_files
tobiasdiez b4bcaf1
Merge branch 'develop' into meson-compile
tobiasdiez 37e9d49
Update flint meson file
tobiasdiez 4ef94d4
Update test command to use 4 parallel processes
tobiasdiez 0a4c97d
Merge branch 'develop' into meson-compile
tobiasdiez 7ceba8a
Merge branch 'develop' into init_files
tobiasdiez ae4571d
Merge branch 'develop' into init_files
tobiasdiez 2d0cbe7
Merge branch 'develop' into meson-compile
tobiasdiez 30c7049
Remove gap_packages.py from py.install_sources()
tobiasdiez 0d8b2d7
Add new Python files to various modules
tobiasdiez dc24eaf
Add order_ideal.py to number_field module
tobiasdiez dacc419
Delete unused meson files in algebras and combinatorics
tobiasdiez be36e74
Merge remote-tracking branch 'upstream/develop' into meson-compile
tobiasdiez 6a89c45
Add new files to categories and designs
tobiasdiez 6b14ccb
Remove unnecessary meson_version field from project configuration
tobiasdiez 087df3f
Update install_sources in meson files
tobiasdiez e866cbc
update cython files
tobiasdiez bf0c7f7
Refactor matrix build dependencies and add meataxe dependency for mat…
tobiasdiez 911e714
Merge branch 'develop' into init_files
tobiasdiez 57b8a9e
Try to fix doctest on macos
tobiasdiez b578c77
Update library dependencies handling in meson.build files
tobiasdiez d2c8520
Revert "Try to fix doctest on macos"
tobiasdiez f538e1a
Fix exponent overflow bug in RingElement class
tobiasdiez 71396c2
Improve handling of dependencies
tobiasdiez c4f21dd
Merge branch 'develop' into init_files
tobiasdiez bae9fb0
Merge branch 'develop' into meson-compile
tobiasdiez e509b11
Add script for updating Python sources and extension data in meson bu…
tobiasdiez 62bf19f
Remove unnecessary code for finding include path for Cython modules
tobiasdiez 5e7a899
Improve code for generating interpreters
tobiasdiez d129c03
Update CI workflow to use lock environment file
tobiasdiez 434225c
Remove unnecessary arb include directory in meson.build files
tobiasdiez 3fbe6a3
add meson to conda lock file
tobiasdiez 8d1acf8
Remove unnecessary interpreters include_directories in meson.build files
tobiasdiez b26b887
Merge branch 'pr/antonio-rojas/37484' into meson-compile
tobiasdiez e435308
Fix compilation (arb)
tobiasdiez c83cc2f
try to fix interpreter build
tobiasdiez a1e41c1
More fun with interpreters
tobiasdiez 0d5f088
Add build directory as include directory for Cython compilation
tobiasdiez 0913750
Merge branch 'develop' into meson-compile
tobiasdiez 765c5b9
Don't run pytest on builddir
tobiasdiez 159d350
Restore --config-settings editable_mode=compat in ci-conda
tobiasdiez e036436
Cleanup workflow
tobiasdiez 020cb40
Merge remote-tracking branch 'upstream/develop' into init_files
tobiasdiez 0b2d76f
Ignore module-not-measured error during code coverage collection
tobiasdiez 8c21bc5
Remove acidentially commited submodules
tobiasdiez 16d8234
Move compilers to src/meson.build
tobiasdiez 11cb41c
Remove acidentially commited submodules
tobiasdiez c8e3a18
Merge branch 'init_files' into meson-compile
tobiasdiez 861506a
Fix tests
tobiasdiez 5d62950
Try installing the generated init file to fix cython module name issues
tobiasdiez 757932f
Generate init file for interpreters
tobiasdiez 73c840a
Improve fflas dependency in meson.build
tobiasdiez 3819a6e
Add fallback for gap
tobiasdiez ee096c9
Add more fallback subprojects
tobiasdiez 614ad77
Merge branch 'develop' into meson-compile
dimpase a048c2a
Merge branch 'develop' into meson-compile
dimpase cf571d2
Merge branch 'develop' into meson-compile
tobiasdiez 49dc635
Merge branch 'develop' into meson-compile
dimpase File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains 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,76 @@ | ||
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, macos] | ||
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@v3 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-conda-${{ hashFiles('src/environment-3.11-linux.yml') }} | ||
|
||
- name: Compiler cache | ||
uses: hendrikmuhs/ccache-action@v1.2 | ||
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') && 'macos' || '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: ./sage -t --all -p4 |
This file contains 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 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 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,32 @@ | ||
project( | ||
'SageMath', | ||
['c', 'cpp', 'cython'], | ||
version: files('src/VERSION.txt'), | ||
license: 'GPL v3' | ||
) | ||
|
||
# Python module | ||
# https://mesonbuild.com/Python-module.html | ||
py_module = import('python') | ||
py = py_module.find_installation(pure: false) | ||
py_dep = py.dependency() | ||
|
||
# Additional targets | ||
py_with_pytest = py_module.find_installation(required: false, modules: ['pytest']) | ||
if py_with_pytest.found() | ||
test( | ||
'pytest', | ||
py_with_pytest, | ||
args: [ | ||
'-m', | ||
'pytest', | ||
'-c', | ||
meson.current_source_dir() / 'tox.ini', | ||
'--doctest', | ||
meson.current_source_dir() / 'src' / 'sage' / 'categories' | ||
], | ||
timeout: 0, | ||
) | ||
endif | ||
|
||
subdir('src') |
This file contains 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 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,7 @@ | ||
[build-system] | ||
build-backend = 'mesonpy' | ||
requires = ['meson-python', 'cython>=3.0.0'] | ||
|
||
[project] | ||
name = 'sagemath' | ||
dynamic = ["version"] |
This file contains 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 |
---|---|---|
|
@@ -218,6 +218,7 @@ More information: | |
binary | ||
conda | ||
source | ||
meson | ||
launching | ||
troubles | ||
|
||
|
This file contains 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,107 @@ | ||
.. _build-source-meson: | ||
|
||
================================ | ||
Building from source using Meson | ||
================================ | ||
|
||
This is a short guide on how to build the Sage from source using Meson. | ||
|
||
Walkthrough | ||
=========== | ||
|
||
Assume we're starting from a clean repo and a fully set up conda environment:: | ||
|
||
```bash | ||
./bootstrap-conda | ||
mamba env create --file src/environment-dev-3.11.yml --name sage-dev | ||
conda activate sage-dev | ||
``` | ||
|
||
Alternatively, install all build requirements as described in section | ||
:ref:`section-prereqs`. | ||
|
||
.. NOTE:: | ||
|
||
If you have previously build Sage in-place, you first have to delete the | ||
already compiled files, e.g. with ``shopt -s globstar`` followed by | ||
``rm src/**/*.so`` or ``for f in src/**/*.so ; do mv "$f" "$f.old"; done``. | ||
Also uninstall the 'old' sage packages with ``pip uninstall sage-conf sage-setup sagemath-standard``. | ||
|
||
To compile and install the project in editable install, just use:: | ||
|
||
```bash | ||
pip install --no-build-isolation --editable . | ||
``` | ||
|
||
This will install Sage in the current Python environment. You can then start | ||
Sage from the command line with ``./sage`` or run the tests with ``./sage -t``. | ||
|
||
.. NOTE:: | ||
|
||
By using ``pip install --editable`` in the above steps, the Sage library | ||
is installed in editable mode. This means that when you only edit source | ||
files, there is no need to rebuild the library; it suffices to restart Sage. | ||
Note that this even works when you edit Cython files, so you no longer need | ||
to manually compile after editing Cython files. | ||
|
||
.. NOTE:: | ||
|
||
Note that ``make`` is not used at all, nor is ``configure``. | ||
This means that any Sage-the-distribution commands such as ``sage -i`` | ||
will not work. | ||
|
||
Background information | ||
====================== | ||
|
||
Under the hood, pip invokes meson to configure and build the project. | ||
We can also use meson directly as follows. | ||
|
||
To configure the project, we need to run the following command:: | ||
|
||
```bash | ||
meson setup builddir --prefix=$PWD/build-install | ||
``` | ||
|
||
This will create a build directory ``builddir`` that will hold the build artifacts. | ||
The ``--prefix`` option specifies the directory where the Sage will be installed. | ||
To compile the project, run the following command:: | ||
|
||
```bash | ||
meson compile -C builddir | ||
``` | ||
|
||
Installing is done with the following command:: | ||
|
||
```bash | ||
meson install -C builddir | ||
``` | ||
|
||
This will then install in the directory specified by ``--prefix``, e.g. | ||
`build-install/lib/python3.11/site-packages/sage`. | ||
Usually, this directory is not on your Python path, so you have to use:: | ||
|
||
```bash | ||
PYTHONPATH=build-install/lib/python3.11/site-packages ./sage | ||
``` | ||
|
||
Alternatively, we can still use pip to install:: | ||
|
||
```bash | ||
pip install --no-build-isolation --config-settings=builddir=builddir --editable . | ||
``` | ||
|
||
.. tip:: | ||
|
||
Package maintainers may want to specify further build options or need | ||
to install to a different directory than the install prefix. | ||
Both are supported naturally by Meson:: | ||
|
||
```bash | ||
meson setup builddir --prefix=/usr --libdir=... -Dcpp_args=... | ||
meson compile -C builddir | ||
DESTDIR=/path/to/staging/root meson install -C builddir | ||
``` | ||
|
||
See `Meson's quick guide <https://mesonbuild.com/Quick-guide.html#using-meson-as-a-distro-packager>`_ | ||
and `Meson's install guide <https://mesonbuild.com/Installing.html#destdir-support>`_ | ||
for more information. |
This file contains 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 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 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 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I have said before in #36489 (comment), I disagree with making this structural change of making SAGE_ROOT the root of a Python project by introducing the file
pyproject.toml
.In #36503 (comment) you denied that you're even making this structural change, but here on the PR it is now fully formed, by declaring a new Python project ("sagemath").
I have made the reason for my objection clear before: Both this file (and the introduction of the file
meson.build
in SAGE_ROOT, as discussed in #36489 (comment)) mislead users into assuming that they can build Sage usingpip install .
and/ormeson ...
instead of using./configure && make
. This is not true because the latter are the build system of the Sage distribution, whereas you have developed a build system for the (monolithic) Sage library -- with is the Python project already declared insrc/pyproject.toml
named "sagemath-standard".The correct solution is to edit
src/pyproject.toml
so that the Sage library uses the mesonpy build system instead of setuptools (delete setup.py), and to usesrc/meson.build
as the toplevel meson file. This affects the default (monolithic editable) build. Users can use./configure --disable-editable
or./configure --disable-editable --enable-wheels
to switch back to a setuptools-based build system.As I explained in #36489 (comment), changing the structure of SAGE_ROOT in this PR is simply not necessary for the goal of the PR -- building the Sage library with meson, which makes the bundling inappropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've developed an alternative for make for the sage project. In this meson alternative, there is not such a distinction between sage-the-distribution and sage-library. There is one project, called sage (or sagemath if you prefer). You can build it using
pip install .
(plus some args) or usingmeson compile
(plus some args) from the root. The only difference to the currentmake build
command is that the developer is responsible for setting up the surrounding build environment (i.e. if dependencies are not present, the build fails). This is very much similar to scipy/numpy/name another meson project.I don't think the meson-based system can directly function as a new default. It's unrealistic that it will directly as stable as the existing setuptools-based one. So it should be opt-in instead of opt-out. So the root directory is the only option I see to place the new pyprojecttoml file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to explain how what you are doing is different from building the Sage library.
(Edit: Previously asked but not answered in the thread starting at #36489 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this not mean that it is doing nothing of what the Sage distribution does in addition to the Sage library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to help:
src/pyproject.toml
from using setuptools to using mesonpy. Trivial to do by declaring a custom PEP-517/660 build api (about 10 lines of code); reference: sage_setup: Add PEP 517 / PEP 660 buildapi #29845pkgs/sagemath-standard_meson
with pyproject.toml.m4There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes of course its building the sage library....that's also the end-goal of sage-the-distribution.
Sage-the-library doesn't have any means to detect and link libraries that are needed for its compilation (except a few runtime fallbacks). Finding and setting these dependencies up is currently the job of sage-the-distribution. This part of sage-the-distribution is covered by meson.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's false. It is using pkg-config for this purpose.