Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: Add NPY_DISABLE_SVML env var to opt out of SVML #20842

Merged
merged 1 commit into from Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions numpy/core/setup.py
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down