@@ -88,12 +88,11 @@ To configure the project, we need to run the following command:
88
88
$ meson setup builddir --prefix=$PWD/build-install
89
89
90
90
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.
92
93
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
94
95
``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/ ``.
97
96
98
97
To compile the project, run the following command:
99
98
@@ -117,7 +116,8 @@ Usually, this directory is not on your Python path, so you have to use:
117
116
118
117
When editable install is used, it is not necessary to reinstall after each compilation.
119
118
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):
121
121
122
122
.. CODE-BLOCK :: shell-session
123
123
@@ -134,7 +134,11 @@ Alternatively, we can still use pip to install:
134
134
$ meson setup builddir --prefix=/usr --libdir=... -Dcpp_args=...
135
135
$ meson compile -C builddir
136
136
$ 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
+
138
142
See `Meson's quick guide <https://mesonbuild.com/Quick-guide.html#using-meson-as-a-distro-packager >`_
139
143
and `Meson's install guide <https://mesonbuild.com/Installing.html#destdir-support >`_
140
144
for more information.
@@ -144,6 +148,7 @@ Miscellaneous tips
144
148
145
149
The environment variable ``MESONPY_EDITABLE_VERBOSE=1 `` can be set while running ``./sage ``,
146
150
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 >`_.
147
152
148
153
If a new ``.pyx `` file is added, it need to be added to ``meson.build `` file in the
149
154
containing directory.
0 commit comments