Skip to content

Commit 9bc7885

Browse files
author
Release Manager
committed
sagemathgh-39378: Fix build with meson documentation 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):
2 parents f6a36dd + 3709ec8 commit 9bc7885

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/doc/en/installation/meson.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ To configure the project, we need to run the following command:
8888
$ meson setup builddir --prefix=$PWD/build-install
8989
9090
This will create a build directory ``builddir`` that will hold the build artifacts.
91-
The ``--prefix`` option specifies the directory where the Sage will be installed.
91+
The ``--prefix`` option specifies the directory where the Sage will be installed,
92+
and can be omitted when ``pip`` is used to install as explained below.
9293

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

9897
To compile the project, run the following command:
9998

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

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

122122
.. CODE-BLOCK:: shell-session
123123
@@ -134,7 +134,11 @@ Alternatively, we can still use pip to install:
134134
$ meson setup builddir --prefix=/usr --libdir=... -Dcpp_args=...
135135
$ meson compile -C builddir
136136
$ DESTDIR=/path/to/staging/root meson install -C builddir
137-
137+
138+
With the `default <https://mesonbuild.com/Running-Meson.html#installing>`_ prefix
139+
being ``/usr/local``, it may then install to
140+
``$DESTDIR/usr/local/lib/python3.12/site-packages/sage``.
141+
138142
See `Meson's quick guide <https://mesonbuild.com/Quick-guide.html#using-meson-as-a-distro-packager>`_
139143
and `Meson's install guide <https://mesonbuild.com/Installing.html#destdir-support>`_
140144
for more information.
@@ -144,6 +148,7 @@ Miscellaneous tips
144148

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

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

0 commit comments

Comments
 (0)