diff options
3 files changed, 34 insertions, 38 deletions
diff --git a/meta/recipes-devtools/python/python3-numpy/disable_blas.patch b/meta/recipes-devtools/python/python3-numpy/disable_blas.patch deleted file mode 100644 index 09d65e8419..0000000000 --- a/meta/recipes-devtools/python/python3-numpy/disable_blas.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | We've seen reproducibility failures where it appears an extra -O3 compiler flag ends | ||
2 | up in the multiarray library compilation. This can only really have come through | ||
3 | extra_info since it only affects just this library. Rather than try and track | ||
4 | down exactly where this came from in a rabbit warren of code, just disable | ||
5 | this since we don't have any of the dependencies. | ||
6 | |||
7 | Upstream-Status: Inappropriate [OE specific config hack] | ||
8 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
9 | |||
10 | Index: numpy-1.25.2/numpy/core/setup.py | ||
11 | =================================================================== | ||
12 | --- numpy-1.25.2.orig/numpy/core/setup.py | ||
13 | +++ numpy-1.25.2/numpy/core/setup.py | ||
14 | @@ -755,22 +755,7 @@ def configuration(parent_package='',top_ | ||
15 | join('src', 'common', 'npy_cpu_features.c'), | ||
16 | ] | ||
17 | |||
18 | - if os.environ.get('NPY_USE_BLAS_ILP64', "0") != "0": | ||
19 | - blas_info = get_info('blas_ilp64_opt', 2) | ||
20 | - else: | ||
21 | - blas_info = get_info('blas_opt', 0) | ||
22 | - | ||
23 | - have_blas = blas_info and ('HAVE_CBLAS', None) in blas_info.get('define_macros', []) | ||
24 | - | ||
25 | - if have_blas: | ||
26 | - extra_info = blas_info | ||
27 | - # These files are also in MANIFEST.in so that they are always in | ||
28 | - # the source distribution independently of HAVE_CBLAS. | ||
29 | - common_src.extend([join('src', 'common', 'cblasfuncs.c'), | ||
30 | - join('src', 'common', 'python_xerbla.c'), | ||
31 | - ]) | ||
32 | - else: | ||
33 | - extra_info = {} | ||
34 | + extra_info = {} | ||
35 | |||
36 | ####################################################################### | ||
37 | # _multiarray_umath module - multiarray part # | ||
diff --git a/meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch b/meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch new file mode 100644 index 0000000000..d952aed00c --- /dev/null +++ b/meta/recipes-devtools/python/python3-numpy/fix_reproducibility.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | This regex decides whether to use O3 opimisation on numpy or not. | ||
2 | |||
3 | It includes "od", which happens to be a substring of "reproducible" | ||
4 | but not "qemux86-world". | ||
5 | |||
6 | The regex will run against all compiler options including things like: | ||
7 | |||
8 | -fmacro-prefix-map=/XXX/build/tmp/work/core2-64-poky-linux/python3-numpy/1.26.0/numpy-1.26.0=/usr/src/debug/python3-numpy/1.26.0-r0 | ||
9 | |||
10 | i.e. including build paths. | ||
11 | |||
12 | Reduce the regex to something deterministic for our builds, assuming | ||
13 | nobody builds in /home/debug:full/ | ||
14 | |||
15 | The autobuilder race depended upon whether qemux86-world or the | ||
16 | reproducible target ran first and won the race to populate sstate. | ||
17 | |||
18 | Upstream-Status: Inappropriate [upstream have dropped distutils and switched to meson] | ||
19 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
20 | |||
21 | Index: numpy-1.26.0/numpy/distutils/ccompiler_opt.py | ||
22 | =================================================================== | ||
23 | --- numpy-1.26.0.orig/numpy/distutils/ccompiler_opt.py | ||
24 | +++ numpy-1.26.0/numpy/distutils/ccompiler_opt.py | ||
25 | @@ -990,7 +990,7 @@ class _CCompiler: | ||
26 | ("cc_is_nocc", "", ""), | ||
27 | ) | ||
28 | detect_args = ( | ||
29 | - ("cc_has_debug", ".*(O0|Od|ggdb|coverage|debug:full).*", ""), | ||
30 | + ("cc_has_debug", ".*debug:full.*", ""), | ||
31 | ("cc_has_native", | ||
32 | ".*(-march=native|-xHost|/QxHost|-mcpu=a64fx).*", ""), | ||
33 | # in case if the class run with -DNPY_DISABLE_OPTIMIZATION | ||
diff --git a/meta/recipes-devtools/python/python3-numpy_1.26.0.bb b/meta/recipes-devtools/python/python3-numpy_1.26.0.bb index e94e431209..4e1e34e8df 100644 --- a/meta/recipes-devtools/python/python3-numpy_1.26.0.bb +++ b/meta/recipes-devtools/python/python3-numpy_1.26.0.bb | |||
@@ -10,7 +10,7 @@ SRCNAME = "numpy" | |||
10 | SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${SRCNAME}-${PV}.tar.gz \ | 10 | SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${SRCNAME}-${PV}.tar.gz \ |
11 | file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \ | 11 | file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \ |
12 | file://0001-numpy-core-Define-RISCV-32-support.patch \ | 12 | file://0001-numpy-core-Define-RISCV-32-support.patch \ |
13 | file://disable_blas.patch \ | 13 | file://fix_reproducibility.patch \ |
14 | file://run-ptest \ | 14 | file://run-ptest \ |
15 | " | 15 | " |
16 | SRC_URI[sha256sum] = "f93fc78fe8bf15afe2b8d6b6499f1c73953169fad1e9a8dd086cdff3190e7fdf" | 16 | SRC_URI[sha256sum] = "f93fc78fe8bf15afe2b8d6b6499f1c73953169fad1e9a8dd086cdff3190e7fdf" |