Skip to content

Commit

Permalink
Fix build with meson documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
user202729 committed Jan 25, 2025
1 parent 5188024 commit 59d3c41
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/doc/en/installation/meson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ 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/``.
``--prefix=`` can be left unspecified, the installation directory can be specified
later with ``DESTDIR`` as explained below.

To compile the project, run the following command:

Expand All @@ -117,7 +118,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 @@ -144,6 +146,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 59d3c41

Please sign in to comment.