From 3709ec8f6a4c8b36e882531242c09042de41d8d1 Mon Sep 17 00:00:00 2001 From: user202729 <25191436+user202729@users.noreply.github.com> Date: Sat, 25 Jan 2025 09:03:37 +0700 Subject: [PATCH] Fix build with meson documentation --- src/doc/en/installation/meson.rst | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/doc/en/installation/meson.rst b/src/doc/en/installation/meson.rst index e0051dbbf68..45ba64c4100 100644 --- a/src/doc/en/installation/meson.rst +++ b/src/doc/en/installation/meson.rst @@ -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: @@ -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 @@ -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 `_ prefix + being ``/usr/local``, it may then install to + ``$DESTDIR/usr/local/lib/python3.12/site-packages/sage``. + See `Meson's quick guide `_ and `Meson's install guide `_ for more information. @@ -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 ``_. If a new ``.pyx`` file is added, it need to be added to ``meson.build`` file in the containing directory.