diff options
author | Matthew Badin <mbadin@apple.com> | 2021-04-28 16:56:01 -0700 |
---|---|---|
committer | Matthew Badin <mbadin@apple.com> | 2021-04-28 17:20:11 -0700 |
commit | e28da7a3d50862fa99b8b704d60fc6543b5af631 (patch) | |
tree | 57f4c3684d5333c319d3b7a3cbcdbb087418acc4 /numpy/_build_utils/apple_accelerate.py | |
parent | 53e34d49d46b0999927160444a7dd0650efafad7 (diff) | |
download | numpy-e28da7a3d50862fa99b8b704d60fc6543b5af631.tar.gz |
BLD: Enable Accelerate Framework
Diffstat (limited to 'numpy/_build_utils/apple_accelerate.py')
-rw-r--r-- | numpy/_build_utils/apple_accelerate.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/numpy/_build_utils/apple_accelerate.py b/numpy/_build_utils/apple_accelerate.py new file mode 100644 index 000000000..8ce54619e --- /dev/null +++ b/numpy/_build_utils/apple_accelerate.py @@ -0,0 +1,21 @@ +import os +import sys +import re + +__all__ = ['uses_accelerate_framework'] + +def uses_accelerate_framework(info): + """ Returns True if Accelerate framework is used for BLAS/LAPACK """ + # If we're not building on Darwin (macOS), don't use Accelerate + if sys.platform != "darwin": + return False + # If we're building on macOS, but targeting a different platform, + # don't use Accelerate. + if os.getenv('_PYTHON_HOST_PLATFORM', None): + return False + r_accelerate = re.compile("Accelerate") + extra_link_args = info.get('extra_link_args', '') + for arg in extra_link_args: + if r_accelerate.search(arg): + return True + return False |