-
-
Notifications
You must be signed in to change notification settings - Fork 712
Compile everything with meson #36524
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
Merged
Merged
Changes from 208 commits
Commits
Show all changes
283 commits
Select commit
Hold shift + click to select a range
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 3b1c99d
Merge branch 'develop' into pr/tobiasdiez/36524
tobiasdiez e3b9006
update meson files
tobiasdiez cdc5efb
Autogenerate init files
tobiasdiez 77b279f
specify all build dependencies
tobiasdiez 65c08c1
Fix build
tobiasdiez d11815a
remove subprojects for now
tobiasdiez 5dfe3a5
fix conda env
tobiasdiez a8f321b
fix tests
tobiasdiez 01c801f
fix macos ci
tobiasdiez 81dc33d
downgrade meson-python
tobiasdiez 3ff0f36
fix ci
tobiasdiez 366987c
fix jinja error
tobiasdiez 587ed3b
ignore build dir
tobiasdiez ed10289
clarify build isolation
tobiasdiez 8e34075
fix import
tobiasdiez 734e0fe
run build only on linux for now
tobiasdiez fd13fd4
remove non-existing pynac dir
tobiasdiez c942abe
try to fix import
tobiasdiez ca168d8
fix sage.all import
tobiasdiez bf97775
fix tests
tobiasdiez 45e8af6
fix autogen iterpreters path
tobiasdiez b4cd883
fix classic build
tobiasdiez 2a9cd0e
fix import
tobiasdiez 40c9f3d
Revert "fix import"
tobiasdiez f51e83c
Merge branch 'develop' into meson-compile
tobiasdiez 17e1076
Merge branch 'develop' into meson-compile
dimpase f30e93b
unignore a meson.build file
dimpase f157a35
add missing matching.py to the list
dimpase 6035173
add runtime dependencies to pyproject.toml
tobiasdiez ae996ad
improve numpy dependency discovery
tobiasdiez e2c1f8b
remove duplicate iml dep
tobiasdiez a6beefa
remove unused subproject
tobiasdiez 9830859
cleanup subprojects
tobiasdiez 8f72313
check for homfly header
tobiasdiez c82c1ee
specify default c and cpp std
tobiasdiez c590f5c
explain how to set include and library path manually
tobiasdiez bcdcb8a
fix imports in tests
tobiasdiez cb797be
Revert "improve numpy dependency discovery"
tobiasdiez 1ba15a9
fix pyproject.toml metadata
tobiasdiez 451f405
ignore also build dirs for other python versions
tobiasdiez f5d64cf
reformat meson files
tobiasdiez 06e4dbe
improve meson update tool
tobiasdiez e96d54d
fix compilation
tobiasdiez e78e19b
exclude main files from testing
tobiasdiez c33134b
exclude symlink from vscode search
tobiasdiez 4048c75
further improvements to flint dpendency handling
tobiasdiez e6d4f1a
fix test errors due to missing sage_setup
tobiasdiez 3c61736
src/sage/libs/giac/meson.build: build extension only if libgiac is found
orlitzky 0b82587
src/sage/plot/plot3d/meson.build: depend on interpreters
orlitzky 4933a6c
meson.build: add "check: true" for the command that creates __init__.py
orlitzky 8688aec
fix tests
tobiasdiez 2f9a1c5
improve dependency handling by using disabler
tobiasdiez 26f037f
add exception to update-meson helper
tobiasdiez 46f490f
Improve handling of optional dependencies
tobiasdiez f9ba8d4
fix build
tobiasdiez 43bb980
try to fix doctests of sage_setup
tobiasdiez 45dabec
try with absolute import
tobiasdiez e57348d
try to add interpreters.internal to sage-setup/pyproject.toml
tobiasdiez ef630f7
fix more autogen tests
tobiasdiez 43c6952
add -D_XOPEN_SOURCE=600 to the right place
dimpase 233d350
use newer action
dimpase 658b25a
Try to fix interpreters compilation
tobiasdiez e39a130
improve docs
tobiasdiez cad2253
Readd D_XOPEN_SOURCE c_arg
tobiasdiez 2297338
Fix wonderful rst syntax (maybe)
tobiasdiez 93be190
fix documentation
tobiasdiez a980b66
Add more optional tags for database_graphs
tobiasdiez d912171
properly copy sage.gaprc
tobiasdiez bc5af68
fix interpreters dependency by specifying generated headers as source
tobiasdiez 7533a4e
Fix installation of sage.gaprc
tobiasdiez 2bf9a09
add all pxd files
tobiasdiez 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 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,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/[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') && '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 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,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 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,7 @@ | ||
| [build-system] | ||
| build-backend = 'mesonpy' | ||
| requires = ['meson-python', 'cython>=3.0.0'] | ||
|
|
||
| [project] | ||
| name = 'sagemath' | ||
| dynamic = ["version"] | ||
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 |
|---|---|---|
|
|
@@ -149,6 +149,7 @@ More information: | |
| binary | ||
| conda | ||
| source | ||
| meson | ||
| launching | ||
| troubles | ||
|
|
||
|
|
||
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,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 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
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
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.