void-packages/srcpkgs/python3-numpy/patches/disable_svml.patch
2022-01-05 11:53:01 -05:00

34 lines
1.4 KiB
Diff

From 50d5f1af8406165128a8567b0796ce244542f70c Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
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"