GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DOC: Update building docs to use Meson by charris · Pull Request #24614 · numpy/numpy

DOC: Update building docs to use Meson #24614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
charris merged 1 commit into numpy:maintenance/1.26.x from charris:backport-24573
Sep 1, 2023

Uh oh!

There was an error while loading. Please reload this page.

Merged

DOC: Update building docs to use Meson #24614

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
5e63c86
DOC: Update building docs to use Meson (#24573)
melissawm Sep 1, 2023
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
DOC: Update building docs to use Meson (#24573)
Removes mentions of runtests.py when appropriate and replaces them with
equivalent spin commands (or pytest in a few cases).

[skip azp]

Co-authored-by: Ralf Gommers <[email protected]>
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@melissawm @rgommers @charris
2 people authored and charris committed Sep 1, 2023
commit 5e63c8690a14cd09220462ddce556bbeaced80b9

There are no files selected for viewing

55 changes: 27 additions & 28 deletions 55 INSTALL.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Hypothesis__ https://hypothesis.readthedocs.io/en/latest/
.. note::

If you want to build NumPy in order to work on NumPy itself, use
``runtests.py``. For more details, see
``spin``. For more details, see
https://numpy.org/devdocs/dev/development_environment.html

.. note::
Expand All @@ -52,37 +52,36 @@ Basic Installation

To install NumPy, run::

python setup.py build -j 4 install --prefix $HOME/.local
pip install .

This will compile numpy on 4 CPUs and install it into the specified prefix.
To perform an inplace build that can be run from the source folder run::
This will compile NumPy on all available CPUs and install it into the active
environment.

python setup.py build_ext --inplace -j 4
To run the build from the source folder for development purposes, use the
``spin`` development CLI::

spin build # installs in-tree under `build-install/`
spin ipython # drop into an interpreter where `import numpy` picks up the local build

Alternatively, use an editable install with::

pip install -e . --no-build-isolation

See `Requirements for Installing Packages <https://packaging.python.org/tutorials/installing-packages/>`_
for more details.

The number of build jobs can also be specified via the environment variable
NPY_NUM_BUILD_JOBS.


Choosing compilers
==================

NumPy needs a C compiler, and for development versions also needs Cython. A Fortran
compiler isn't needed to build NumPy itself; the ``numpy.f2py`` tests will be
skipped when running the test suite if no Fortran compiler is available. For
building Scipy a Fortran compiler is needed though, so we include some details
on Fortran compilers in the rest of this section.

On OS X and Linux, all common compilers will work. The minimum supported GCC
version is 6.5.

For Fortran, ``gfortran`` works, ``g77`` does not. In case ``g77`` is
installed then ``g77`` will be detected and used first. To explicitly select
``gfortran`` in that case, do::
NumPy needs C and C++ compilers, and for development versions also needs
Cython. A Fortran compiler isn't needed to build NumPy itself; the
``numpy.f2py`` tests will be skipped when running the test suite if no Fortran
compiler is available.

python setup.py build --fcompiler=gnu95
For more options including selecting compilers, setting custom compiler flags
and controlling parallelism, see
https://scipy.github.io/devdocs/building/compilers_and_options.html

Windows
-------
Expand All @@ -104,10 +103,11 @@ for more details.
Building with optimized BLAS support
====================================

Configuring which BLAS/LAPACK is used if you have multiple libraries installed,
or you have only one installed but in a non-standard location, is done via a
``site.cfg`` file. See the ``site.cfg.example`` shipped with NumPy for more
details.
Configuring which BLAS/LAPACK is used if you have multiple libraries installed
is done via a ``--config-settings`` CLI flag - if not given, the default choice
is OpenBLAS. If your installed library is in a non-standard location, selecting
that location is done via a pkg-config ``.pc`` file.
See http://scipy.github.io/devdocs/building/blas_lapack.html for more details.

Windows
-------
Expand All @@ -120,9 +120,8 @@ For an overview of the state of BLAS/LAPACK libraries on Windows, see
macOS
-----

You will need to install a BLAS/LAPACK library. We recommend using OpenBLAS or
Intel MKL. Apple's Accelerate also still works, however it has bugs and we are
likely to drop support for it in the near future.
On macOS >= 13.3, you can use Apple's Accelerate library. On older macOS versions,
Accelerate has bugs and we recommend using OpenBLAS or (on x86-64) Intel MKL.

Ubuntu/Debian
-------------
Expand Down
26 changes: 12 additions & 14 deletions 26 benchmarks/README.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ Usage
-----

Airspeed Velocity manages building and Python virtualenvs by itself,
unless told otherwise. Some of the benchmarking features in
``runtests.py`` also tell ASV to use the NumPy compiled by
``runtests.py``. To run the benchmarks, you do not need to install a
unless told otherwise. To run the benchmarks, you do not need to install a
development version of NumPy to your current Python environment.

Before beginning, ensure that *airspeed velocity* is installed.
Expand All @@ -28,10 +26,9 @@ submitting a pull request.
To run all benchmarks, navigate to the root NumPy directory at
the command line and execute::

python runtests.py --bench
spin bench

where ``--bench`` activates the benchmark suite instead of the
test suite. This builds NumPy and runs all available benchmarks
This builds NumPy and runs all available benchmarks
defined in ``benchmarks/``. (Note: this could take a while. Each
benchmark is run multiple times to measure the distribution in
execution times.)
Expand All @@ -49,18 +46,19 @@ and `--quick` is used to avoid repetitions.
To run benchmarks from a particular benchmark module, such as
``bench_core.py``, simply append the filename without the extension::

python runtests.py --bench bench_core
spin bench -t bench_core

To run a benchmark defined in a class, such as ``Mandelbrot``
from ``bench_avx.py``::
To run a benchmark defined in a class, such as ``MeshGrid``
from ``bench_creation.py``::

python runtests.py --bench bench_avx.Mandelbrot
spin bench -t bench_creation.MeshGrid

Compare change in benchmark results to another version/commit/branch::
Compare changes in benchmark results to another version/commit/branch, use the
``--compare`` option (or the equivalent ``-c``)::

python runtests.py --bench-compare v1.6.2 bench_core
python runtests.py --bench-compare 8bf4e9b bench_core
python runtests.py --bench-compare main bench_core
spin bench --compare v1.6.2 -t bench_core
spin bench --compare 20d03bcfd -t bench_core
spin bench -c main -t bench_core

All of the commands above display the results in plain text in
the console, and the results are not saved for comparison with
Expand Down
9 changes: 3 additions & 6 deletions 9 building_with_meson.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ pytest --pyargs numpy

### pip install

Note that `pip` will use the default build system, which is (as of now) still
`numpy.distutils`. In order to switch that default to Meson, uncomment the
`build-backend = "mesonpy"` line at the top of `pyproject.toml`.

After that is done, `pip install .` or `pip install --no-build-isolation .`
will work as expected. As does building an sdist or wheel with `python -m build`,
Note that `pip` will use the default build system, which is now Meson.
Commands such as `pip install .` or `pip install --no-build-isolation .`
will work as expected, as does building an sdist or wheel with `python -m build`,
or `pip install -e . --no-build-isolation` for an editable install.
For a more complete developer experience than editable installs, consider using
`spin` instead though (see above).
Expand Down
2 changes: 1 addition & 1 deletion 2 doc/RELEASE_WALKTHROUGH.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ repository::

Sanity check::

$ python3 runtests.py -m "full"
$ python3 -m spin test -m full

Tag the release and push the tag. This requires write permission for the numpy
repository::
Expand Down
8 changes: 4 additions & 4 deletions 8 doc/TESTS.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ example, the ``core`` module, use the following::
Running tests from the command line
-----------------------------------

If you want to build NumPy in order to work on NumPy itself, use
``runtests.py``.To run NumPy's full test suite::
If you want to build NumPy in order to work on NumPy itself, use the ``spin``
utility. To run NumPy's full test suite::

$ python runtests.py
$ spin test -m full

Testing a subset of NumPy::

$python runtests.py -t numpy/core/tests
$ spin test -t numpy/core/tests

For detailed info on testing, see :ref:`testing-builds`

Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.