Hey all,

We've landed some major changes in `main` this week, so I thought it's a good idea to keep everyone in the loop.

First the good news: we now have full SIMD support in the Meson builds on `main`! This was a huge amount of work by Sayed, so I'd like to say thank you to him for doing all that.

This was the main missing piece of the puzzle for Python 3.12 support, and for the switch away from `numpy.distutils`. We're still in the process of some backports and other tweaks, but we're basically ready for a first 1.26.0 pre-release. We also need to port some CI jobs over in `main` from setup.py to meson, but that is separate from work for 1.26.x.

Now let me give a summary of where we are at, because I anticipate these questions coming up regularly.


We had to fork and vendor both Meson and meson-python, because for SIMD support we need a significant new feature in Meson (https://github.com/mesonbuild/meson/pull/11307) that is not yet merged; once that PR does get merged and ends up in the next Meson feature release, we can drop our vendored versions. For now they live as git submodules under `vendored-meson` in the root dir of the numpy repo. And we will keep the forks at https://github.com/numpy/meson and https://github.com/numpy/meson-python.

As a result of that fork, it is no longer possible to run `meson setup` in the root of the repo. This wasn't really recommended anyway, but it's good to know that it doesn't work right now. The two ways of building are:
   1. Via `pip` or `pypa/build`; that will trigger the build backend via the hook in `pyproject.toml`.
    2. Via the `spin` commands - this is the developer CLI (see https://github.com/scientific-python/spin).
Note that editable builds work well too, with `pip install -e . --no-build-isolation`.

For the remaining loose ends after the switch to Meson, see https://github.com/numpy/numpy/issues/23981. Once those are all taken care of and we have released 1.26.0 and see that there are no issues, we can remove the `setup.py` based builds. Probably towards the end of this year.

We still need to update the docs for the change over to Meson - this will happen before the 1.26.0 release. For now, the SciPy docs at http://scipy.github.io/devdocs/building/index.html are a good reference; those were recently fully rewritten, and everything for NumPy is essentially the same as for SciPy.

Another thing worth mentioning is that we have now, in the `main` and `1.26.x` branches, defaulted to failing the build if BLAS/LAPACK cannot be found. This is because all the detection mechanisms changed, and it would otherwise be too easy to silently get a build that is unoptimized (that can cause up to 100x slowdowns in widely used linalg functions). If you get a failure, you can fix it or pass a `-Dallow-noblas` CLI flag to indicate that that is what you intended (or at least, you don't mind a slow build). We may still revert the change for 1.26.0 and default to switching to `lapack_lite`, for the discussion on that and more details, see https://github.com/numpy/numpy/pull/24279.

A difference between the meson and setup.py builds is that rather than having a host of `NPY_` environment variables, we now have CLI flags for build options. These options can be queried and the used ones are reported in the build log, so it makes it much easier to understand what is being used. It does mean though that if you have a set of env vars in, for example, your `.bashrc`, those will no longer have an effect. For a full list of options, see the `meson_options.txt` file in the root of the repo. Note that some of the options for BLAS/LAPACK control (e.g., `NPY_BLAS_ORDER`) are not yet available. Those should arrive within the next couple of months.

Cheers,
Ralf