]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
python3-numpy: Attempt to fix reproducibility issue
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Sep 2023 16:47:12 +0000 (17:47 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Sep 2023 07:09:11 +0000 (08:09 +0100)
We've seen reproducibility failures where it appears an extra -O3 compiler flag ends
up in the multiarray library compilation. This can only really have come through
extra_info for BLASS support since it only affects just this library. Rather than
try and track down exactly where this came from in a rabbit warren of code, just
disable this since we don't have any of the dependencies anyway.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3-numpy/disable_blas.patch [new file with mode: 0644]
meta/recipes-devtools/python/python3-numpy_1.25.2.bb

diff --git a/meta/recipes-devtools/python/python3-numpy/disable_blas.patch b/meta/recipes-devtools/python/python3-numpy/disable_blas.patch
new file mode 100644 (file)
index 0000000..09d65e8
--- /dev/null
@@ -0,0 +1,37 @@
+We've seen reproducibility failures where it appears an extra -O3 compiler flag ends
+up in the multiarray library compilation. This can only really have come through
+extra_info since it only affects just this library. Rather than try and track
+down exactly where this came from in a rabbit warren of code, just disable
+this since we don't have any of the dependencies.
+
+Upstream-Status: Inappropriate [OE specific config hack]
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: numpy-1.25.2/numpy/core/setup.py
+===================================================================
+--- numpy-1.25.2.orig/numpy/core/setup.py
++++ numpy-1.25.2/numpy/core/setup.py
+@@ -755,22 +755,7 @@ def configuration(parent_package='',top_
+             join('src', 'common', 'npy_cpu_features.c'),
+             ]
+-    if os.environ.get('NPY_USE_BLAS_ILP64', "0") != "0":
+-        blas_info = get_info('blas_ilp64_opt', 2)
+-    else:
+-        blas_info = get_info('blas_opt', 0)
+-
+-    have_blas = blas_info and ('HAVE_CBLAS', None) in blas_info.get('define_macros', [])
+-
+-    if have_blas:
+-        extra_info = blas_info
+-        # These files are also in MANIFEST.in so that they are always in
+-        # the source distribution independently of HAVE_CBLAS.
+-        common_src.extend([join('src', 'common', 'cblasfuncs.c'),
+-                           join('src', 'common', 'python_xerbla.c'),
+-                          ])
+-    else:
+-        extra_info = {}
++    extra_info = {}
+     #######################################################################
+     #             _multiarray_umath module - multiarray part              #
index 0c6c0a32874da6d50e0290f35cf8e0a5cd58f549..4793b23a38c8da90b28419d3a1fdcc70b0fe150b 100644 (file)
@@ -10,6 +10,7 @@ SRCNAME = "numpy"
 SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${SRCNAME}-${PV}.tar.gz \
            file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
            file://0001-numpy-core-Define-RISCV-32-support.patch \
+           file://disable_blas.patch \
            file://run-ptest \
            "
 SRC_URI[sha256sum] = "fd608e19c8d7c55021dffd43bfe5492fab8cc105cc8986f813f8c3c048b38760"