Skip to content

Commit

Permalink
sagemathgh-39378: Fix build with meson documentation
Browse files Browse the repository at this point in the history
    
Fix some errors pointed out in
sagemath#39129


### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39378
Reported by: user202729
Reviewer(s):
  • Loading branch information
Release Manager committed Jan 27, 2025
2 parents 70db56a + 3709ec8 commit 0d3c3f7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/doc/en/installation/meson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ To configure the project, we need to run the following command:
$ 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.
The ``--prefix`` option specifies the directory where the Sage will be installed,
and can be omitted when ``pip`` is used to install as explained below.

If pip is used as above, ``builddir`` is set to be
If pip is used as above with ``--editable``, ``builddir`` is set to be
``build/cp[Python major version][Python minor version]``, such as ``build/cp311``.
``--prefix=`` can be left unspecified, when conda is used then meson will
install to the conda environment e.g. ``$HOME/miniforge3/envs/sage-dev/``.

To compile the project, run the following command:

Expand All @@ -117,7 +116,8 @@ Usually, this directory is not on your Python path, so you have to use:
When editable install is used, it is not necessary to reinstall after each compilation.

Alternatively, we can still use pip to install:
Alternatively, we can still use pip to install (which does not require specifying
``--prefix`` in advance and automatically works with conda environment):

.. CODE-BLOCK:: shell-session
Expand All @@ -134,7 +134,11 @@ Alternatively, we can still use pip to install:
$ meson setup builddir --prefix=/usr --libdir=... -Dcpp_args=...
$ meson compile -C builddir
$ DESTDIR=/path/to/staging/root meson install -C builddir
With the `default <https://mesonbuild.com/Running-Meson.html#installing>`_ prefix
being ``/usr/local``, it may then install to
``$DESTDIR/usr/local/lib/python3.12/site-packages/sage``.

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.
Expand All @@ -144,6 +148,7 @@ Miscellaneous tips

The environment variable ``MESONPY_EDITABLE_VERBOSE=1`` can be set while running ``./sage``,
so that when Cython files are recompiled a message is printed out.
See `<https://mesonbuild.com/meson-python/how-to-guides/editable-installs.html#verbose-mode>`_.

If a new ``.pyx`` file is added, it need to be added to ``meson.build`` file in the
containing directory.
Expand Down

0 comments on commit 0d3c3f7

Please sign in to comment.