From 4729ab33765cc773d73eedb7c64c338cc27cfd3f Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Fri, 31 Dec 2021 22:55:42 -0500 Subject: [PATCH] python3-numpy: update to 1.22.0. --- .../python3-numpy/patches/disable_svml.patch | 34 +++++++++++++++++++ srcpkgs/python3-numpy/template | 14 +++----- 2 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 srcpkgs/python3-numpy/patches/disable_svml.patch diff --git a/srcpkgs/python3-numpy/patches/disable_svml.patch b/srcpkgs/python3-numpy/patches/disable_svml.patch new file mode 100644 index 00000000000..31e7389f856 --- /dev/null +++ b/srcpkgs/python3-numpy/patches/disable_svml.patch @@ -0,0 +1,34 @@ +From 50d5f1af8406165128a8567b0796ce244542f70c Mon Sep 17 00:00:00 2001 +From: "Andrew J. Hesford" +Date: Sat, 1 Jan 2022 10:48:33 -0500 +Subject: [PATCH] BLD: Add NPY_DISABLE_SVML env var to opt out of SVML + +--- + numpy/core/setup.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/numpy/core/setup.py b/numpy/core/setup.py +index 0f2f3c21020..a67a4cab6a2 100644 +--- a/numpy/core/setup.py ++++ b/numpy/core/setup.py +@@ -24,6 +24,11 @@ + NPY_RELAXED_STRIDES_DEBUG = (os.environ.get('NPY_RELAXED_STRIDES_DEBUG', "0") != "0") + NPY_RELAXED_STRIDES_DEBUG = NPY_RELAXED_STRIDES_DEBUG and NPY_RELAXED_STRIDES_CHECKING + ++# Set NPY_DISABLE_SVML=1 in the environment to disable the vendored SVML ++# library. This option only has significance on a Linux x86_64 host and is most ++# useful to avoid improperly requiring SVML when cross compiling. ++NPY_DISABLE_SVML = (os.environ.get('NPY_DISABLE_SVML', "0") == "1") ++ + # XXX: ugly, we use a class to avoid calling twice some expensive functions in + # config.h/numpyconfig.h. I don't see a better way because distutils force + # config.h generation inside an Extension class, and as such sharing +@@ -68,6 +73,8 @@ def can_link_svml(): + """SVML library is supported only on x86_64 architecture and currently + only on linux + """ ++ if NPY_DISABLE_SVML: ++ return False + machine = platform.machine() + system = platform.system() + return "x86_64" in machine and system == "Linux" diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template index 8c9e0818105..f736b5e3d45 100644 --- a/srcpkgs/python3-numpy/template +++ b/srcpkgs/python3-numpy/template @@ -1,6 +1,6 @@ # Template file for 'python3-numpy' pkgname=python3-numpy -version=1.21.5 +version=1.22.0 revision=1 wrksrc="numpy-${version}" build_style=python3-module @@ -13,7 +13,7 @@ maintainer="Andrew J. Hesford " license="BSD-3-Clause" homepage="https://www.numpy.org/" distfiles="https://github.com/numpy/numpy/archive/v${version}.tar.gz" -checksum=d69b09c335ae6bb661f7e3d8ee2cd9d17bb3879abca0401e310e434b30f12554 +checksum=34957b830448ae34b8bed1f5334ad790431b23bf1a16571b5a29dcd49bceafa4 alternatives="numpy:f2py:/usr/bin/f2py3" # Tests do not function propery in a build directory make_check="no" @@ -35,6 +35,9 @@ if [ "$build_option_openblas" ]; then esac fi +# SVML AVX-512 functions have very limited support; disble for now +export NPY_DISABLE_SVML=1 + post_patch() { case "${XBPS_TARGET_MACHINE}" in armv5tel-musl) @@ -46,13 +49,6 @@ post_patch() { if [ "$XBPS_TARGET_LIBC" = musl ] ; then vsed -i 's|"backtrace",||' numpy/core/setup_common.py fi - - if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then - # When host/target word sizes disagree, this $werror header - # triggers -Werror failures about redefining SIZEOF_OFF_T from - # the wrong host size to the correct target size - vsed -e 's/\$werror//' -i numpy/core/src/_simd/_simd.dispatch.c.src - fi } pre_build() {