diff options
-rw-r--r-- | meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch | 40 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3-numpy/0001-numpy-core-setup.py-disable-svml-for-now.patch | 29 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3-numpy_1.22.0.bb (renamed from meta/recipes-devtools/python/python3-numpy_1.21.5.bb) | 5 |
3 files changed, 49 insertions, 25 deletions
diff --git a/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch b/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch index b60ca1d216..676bdbb3af 100644 --- a/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch +++ b/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From dbcf296f84e5cef6a3ff0f1c469a4508f1e0fb15 Mon Sep 17 00:00:00 2001 | 1 | From eb6d6579150bf4684603ce377c51e90ad3bb8109 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sun, 15 Nov 2020 15:32:39 -0800 | 3 | Date: Sun, 15 Nov 2020 15:32:39 -0800 |
4 | Subject: [PATCH] numpy/core: Define RISCV-32 support | 4 | Subject: [PATCH] numpy/core: Define RISCV-32 support |
@@ -8,39 +8,33 @@ Helps compile on riscv32 | |||
8 | Upstream-Status: Submitted [https://github.com/numpy/numpy/pull/17780] | 8 | Upstream-Status: Submitted [https://github.com/numpy/numpy/pull/17780] |
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
10 | --- | 10 | --- |
11 | numpy/core/include/numpy/npy_cpu.h | 9 +++++++-- | 11 | numpy/core/include/numpy/npy_cpu.h | 3 +++ |
12 | numpy/core/include/numpy/npy_endian.h | 1 + | 12 | numpy/core/include/numpy/npy_endian.h | 1 + |
13 | 2 files changed, 8 insertions(+), 2 deletions(-) | 13 | 2 files changed, 4 insertions(+) |
14 | 14 | ||
15 | diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h | 15 | diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h |
16 | index 4dbf9d84e..bc41a7eda 100644 | 16 | index 78d229e..04be511 100644 |
17 | --- a/numpy/core/include/numpy/npy_cpu.h | 17 | --- a/numpy/core/include/numpy/npy_cpu.h |
18 | +++ b/numpy/core/include/numpy/npy_cpu.h | 18 | +++ b/numpy/core/include/numpy/npy_cpu.h |
19 | @@ -18,6 +18,7 @@ | 19 | @@ -19,6 +19,7 @@ |
20 | * NPY_CPU_ARCEL | ||
21 | * NPY_CPU_ARCEB | 20 | * NPY_CPU_ARCEB |
22 | * NPY_CPU_RISCV64 | 21 | * NPY_CPU_RISCV64 |
22 | * NPY_CPU_LOONGARCH | ||
23 | + * NPY_CPU_RISCV32 | 23 | + * NPY_CPU_RISCV32 |
24 | * NPY_CPU_WASM | 24 | * NPY_CPU_WASM |
25 | */ | 25 | */ |
26 | #ifndef _NPY_CPUARCH_H_ | 26 | #ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_ |
27 | @@ -100,8 +101,12 @@ | 27 | @@ -104,6 +105,8 @@ |
28 | #define NPY_CPU_ARCEL | ||
29 | #elif defined(__arc__) && defined(__BIG_ENDIAN__) | ||
30 | #define NPY_CPU_ARCEB | 28 | #define NPY_CPU_ARCEB |
31 | -#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 | 29 | #elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 |
32 | - #define NPY_CPU_RISCV64 | 30 | #define NPY_CPU_RISCV64 |
33 | +#elif defined(__riscv) | 31 | +#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 32 |
34 | + #if __riscv_xlen == 64 | 32 | + #define NPY_CPU_RISCV32 |
35 | + #define NPY_CPU_RISCV64 | 33 | #elif defined(__loongarch__) |
36 | + #elif __riscv_xlen == 32 | 34 | #define NPY_CPU_LOONGARCH |
37 | + #define NPY_CPU_RISCV32 | ||
38 | + #endif | ||
39 | #elif defined(__EMSCRIPTEN__) | 35 | #elif defined(__EMSCRIPTEN__) |
40 | /* __EMSCRIPTEN__ is defined by emscripten: an LLVM-to-Web compiler */ | ||
41 | #define NPY_CPU_WASM | ||
42 | diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h | 36 | diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h |
43 | index aa367a002..d59484573 100644 | 37 | index 5e58a7f..0926212 100644 |
44 | --- a/numpy/core/include/numpy/npy_endian.h | 38 | --- a/numpy/core/include/numpy/npy_endian.h |
45 | +++ b/numpy/core/include/numpy/npy_endian.h | 39 | +++ b/numpy/core/include/numpy/npy_endian.h |
46 | @@ -49,6 +49,7 @@ | 40 | @@ -49,6 +49,7 @@ |
@@ -48,9 +42,9 @@ index aa367a002..d59484573 100644 | |||
48 | || defined(NPY_CPU_ARCEL) \ | 42 | || defined(NPY_CPU_ARCEL) \ |
49 | || defined(NPY_CPU_RISCV64) \ | 43 | || defined(NPY_CPU_RISCV64) \ |
50 | + || defined(NPY_CPU_RISCV32) \ | 44 | + || defined(NPY_CPU_RISCV32) \ |
45 | || defined(NPY_CPU_LOONGARCH) \ | ||
51 | || defined(NPY_CPU_WASM) | 46 | || defined(NPY_CPU_WASM) |
52 | #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN | 47 | #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN |
53 | #elif defined(NPY_CPU_PPC) \ | ||
54 | -- | 48 | -- |
55 | 2.29.2 | 49 | 2.20.1 |
56 | 50 | ||
diff --git a/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-setup.py-disable-svml-for-now.patch b/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-setup.py-disable-svml-for-now.patch new file mode 100644 index 0000000000..66e322116a --- /dev/null +++ b/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-setup.py-disable-svml-for-now.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 0f0601e79f9ce7614d157284523e6cd8af2259d5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex@linutronix.de> | ||
3 | Date: Wed, 5 Jan 2022 12:12:47 +0100 | ||
4 | Subject: [PATCH] numpy/core/setup.py: disable svml for now | ||
5 | |||
6 | The check really doesn't work in cross compiling, | ||
7 | as it is using host python to see what arch we're | ||
8 | building on. Issue reported upstream: | ||
9 | https://github.com/numpy/numpy/issues/20736 | ||
10 | |||
11 | Upstream-Status: Inappropriate [needs upstream fix] | ||
12 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
13 | --- | ||
14 | numpy/core/setup.py | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/numpy/core/setup.py b/numpy/core/setup.py | ||
18 | index a5f423d..945f2dd 100644 | ||
19 | --- a/numpy/core/setup.py | ||
20 | +++ b/numpy/core/setup.py | ||
21 | @@ -70,7 +70,7 @@ def can_link_svml(): | ||
22 | """ | ||
23 | machine = platform.machine() | ||
24 | system = platform.system() | ||
25 | - return "x86_64" in machine and system == "Linux" | ||
26 | + return False | ||
27 | |||
28 | def check_svml_submodule(svmlpath): | ||
29 | if not os.path.exists(svmlpath + "/README.md"): | ||
diff --git a/meta/recipes-devtools/python/python3-numpy_1.21.5.bb b/meta/recipes-devtools/python/python3-numpy_1.22.0.bb index bdf99b492b..556e2dd5c9 100644 --- a/meta/recipes-devtools/python/python3-numpy_1.21.5.bb +++ b/meta/recipes-devtools/python/python3-numpy_1.22.0.bb | |||
@@ -11,8 +11,9 @@ SRC_URI = "https://github.com/${SRCNAME}/${SRCNAME}/releases/download/v${PV}/${S | |||
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://run-ptest \ | 13 | file://run-ptest \ |
14 | " | 14 | file://0001-numpy-core-setup.py-disable-svml-for-now.patch \ |
15 | SRC_URI[sha256sum] = "1a7ee0ffb35dc7489aebe5185a483f4c43b0d2cf784c3c9940f975a7dde56506" | 15 | " |
16 | SRC_URI[sha256sum] = "f2be14ba396780a6f662b8ba1a24466c9cf18a6a386174f614668e58387a13d7" | ||
16 | 17 | ||
17 | UPSTREAM_CHECK_URI = "https://github.com/numpy/numpy/releases" | 18 | UPSTREAM_CHECK_URI = "https://github.com/numpy/numpy/releases" |
18 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar" | 19 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar" |