Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Perale via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: James Hilliard <james.hilliard1@gmail.com>,
	Guillaume William Brs <guillaume.bressaix@gmail.com>,
	Jagan Teki <jagan@amarulasolutions.com>
Subject: [Buildroot] [PATCH 2025.02.x 3/3] package/python-numpy: fix meson configuration with LAPACK
Date: Tue, 20 Oct 2026 08:44:09 +0200	[thread overview]
Message-ID: <20261020064409.179420-3-thomas.perale@mind.be> (raw)
In-Reply-To: <20261020064409.179420-1-thomas.perale@mind.be>

Building numpy with the LAPACK package enabled (like when building
python-scipy) would result in the following error during configuration:

```
numpy/meson.build:203:49: ERROR: Could not get pkg-config variable
and no default provided for <PkgConfigDependency lapack: True None>
```

This is reproducible with the following defconfig:

cat >.config <<EOF
BR2_arm=y
BR2_cortex_a7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_NUMPY=y
BR2_PACKAGE_LAPACK=y
EOF
make oldefconfig
make python-numpy

The variable that triggered that error got assigned a default value in
upstream commit [1] which is available in python-numpy v2.0.0, which fix
this error.

This commit backport the part of the upstream commit that assign the
value by default.

[1] https://github.com/numpy/numpy/commit/34afbb97cc9915ad5976ddc869a539e897545722

Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/17125191093
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
---
 ...implement-BLAS-LAPACK-auto-detection.patch | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 package/python-numpy/0002-meson-implement-BLAS-LAPACK-auto-detection.patch

diff --git a/package/python-numpy/0002-meson-implement-BLAS-LAPACK-auto-detection.patch b/package/python-numpy/0002-meson-implement-BLAS-LAPACK-auto-detection.patch
new file mode 100644
index 0000000000..f7822ef852
--- /dev/null
+++ b/package/python-numpy/0002-meson-implement-BLAS-LAPACK-auto-detection.patch
@@ -0,0 +1,77 @@
+From 34afbb97cc9915ad5976ddc869a539e897545722 Mon Sep 17 00:00:00 2001
+From: Ralf Gommers <ralf.gommers@gmail.com>
+Date: Tue, 10 Oct 2023 00:27:02 +0200
+Subject: [PATCH] ENH: meson: implement BLAS/LAPACK auto-detection and many CI jobs [wheel build]
+
+This reimplements the auto-detection and many of the switches that
+`numpy.distutils` offered. Beyond that, it implements several new
+features:
+
+- Auto-detect the symbol suffix for ILP64 OpenBLAS (can be none or
+  `64_`)
+- MKL ILP64 support, threading control, and use of the layered library
+  model for MKL >=2023.0
+- FlexiBLAS support (LP64 and ILP64)
+- Support for the upcoming standard in Reference LAPACK for `_64` ILP64
+  symbol suffix convention.
+- A test suite for BLAS/LAPACK libraries, covering:
+
+    - OpenBLAS: LP64, ILP64 detected via pkg-config and with a "system
+                dependency" (i.e., custom code inside Meson)
+    - MKL: LP64, ILP64 (layered) and LP64 (SDL)
+    - Accelerate: LP64, ILP64 on macOS >=13.3
+    - FlexiBLAS: LP64, ILP64 on Fedora
+    - ATLAS (LP64, via pkg-config only)
+    - BLIS (LP64, via pkg-config only)
+    - plain libblas/liblapack (Netlib, LP64 only)
+
+The list of libraries that is tried with the default 'auto' setting
+excludes a couple of libraries, because they're either no longer
+developed (ATLAS), not mature (libflame), or can't be tested and
+may be re-added later (ArmPL, ssl2). Those libraries can still be
+quite easily used via pkg-config.
+
+The new CI jobs are running by default right now. Once things settle
+down, the plan is to disable them by default and allow triggering
+them via a `[blas ci]` command in the commit message (just like for
+wheel builds).
+
+Docs will be included in a separate PR with the pending rewrite of
+all the build/install docs. For now, the CI jobs and the
+`meson_options.txt` file serve as guidance for how to use this.
+
+Note that the test suite contains a few hacks, because of packaging
+bugs for MKL on PyPI (broken .pc files) and BLIS (missing .pc file in
+Debian).
+
+Upstream: https://github.com/numpy/numpy/commit/34afbb97cc9915ad5976ddc869a539e897545722
+[thomas: backport subset of upstream commit.
+  Only the part that fix the 2025.02.x scipy version LAPACK detection.
+
+ Fixes:
+    numpy/meson.build:203:49: ERROR: Could not get pkg-config variable
+    and no default provided for <PkgConfigDependency lapack: True None>
+]
+Signed-off-by: Thomas Perale <thomas.perale@mind.be>
+---
+ numpy/meson.build | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/numpy/meson.build b/numpy/meson.build
+--- a/numpy/meson.build
++++ b/numpy/meson.build
+@@ -198,10 +198,10 @@
+   if dep.found()
+     conf_data.set(name + '_VERSION', dep.version())
+     conf_data.set(name + '_TYPE_NAME', dep.type_name())
+-    conf_data.set(name + '_INCLUDEDIR', dep.get_variable('includedir'))
+-    conf_data.set(name + '_LIBDIR', dep.get_variable('libdir'))
+-    conf_data.set(name + '_OPENBLAS_CONFIG', dep.get_variable('openblas_config'))
+-    conf_data.set(name + '_PCFILEDIR', dep.get_variable('pcfiledir'))
++    conf_data.set(name + '_INCLUDEDIR', dep.get_variable('includedir', default_value: 'unknown'))
++    conf_data.set(name + '_LIBDIR', dep.get_variable('libdir', default_value: 'unknown'))
++    conf_data.set(name + '_OPENBLAS_CONFIG', dep.get_variable('openblas_config', default_value: 'unknown'))
++    conf_data.set(name + '_PCFILEDIR', dep.get_variable('pcfiledir', default_value: 'unknown'))
+   endif
+ endforeach
+ 
-- 
2.56.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-10-20  6:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20  6:44 [Buildroot] [PATCH 2025.02.x 1/3] package/python-scipy: fix build with cython >=3.1.0 Thomas Perale via buildroot
2026-10-20  6:44 ` [Buildroot] [PATCH 2025.02.x 2/3] package/python-scipy: fix build with GCC14 Thomas Perale via buildroot
2026-10-23 13:21   ` Raphaël Mélotte via buildroot
2026-10-20  6:44 ` Thomas Perale via buildroot [this message]
2026-10-23 13:21   ` [Buildroot] [PATCH 2025.02.x 3/3] package/python-numpy: fix meson configuration with LAPACK Raphaël Mélotte via buildroot
2026-10-23 13:21 ` [Buildroot] [PATCH 2025.02.x 1/3] package/python-scipy: fix build with cython >=3.1.0 Raphaël Mélotte via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261020064409.179420-3-thomas.perale@mind.be \
    --to=buildroot@buildroot.org \
    --cc=guillaume.bressaix@gmail.com \
    --cc=jagan@amarulasolutions.com \
    --cc=james.hilliard1@gmail.com \
    --cc=thomas.perale@mind.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox