summaryrefslogtreecommitdiff
path: root/numpy/distutils/system_info.py
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-05-22 19:26:27 +0300
committerGitHub <noreply@github.com>2020-05-22 11:26:27 -0500
commit78593a1059f0a9c04385f97b2c1caa221efefa5f (patch)
tree8dd408a53518726d2c392edeb4c6d1e62869278b /numpy/distutils/system_info.py
parentdabf31c74f6f3153ef4e7c72ad969c37f8652c8a (diff)
downloadnumpy-78593a1059f0a9c04385f97b2c1caa221efefa5f.tar.gz
BUILD: Remove Accelerate support (#15759)
Remove support for Apple Accelerate, since it is buggy. A build error should occur on most or all setups if linked against Accelerate. Test or import failures should occur on setups where Accelerate is picked up dynamically. Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r--numpy/distutils/system_info.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 3a6a7b29d..df82683dc 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -362,6 +362,22 @@ default_src_dirs = [_m for _m in default_src_dirs if os.path.isdir(_m)]
so_ext = get_shared_lib_extension()
+def is_symlink_to_accelerate(filename):
+ accelpath = '/System/Library/Frameworks/Accelerate.framework'
+ return (sys.platform == 'darwin' and os.path.islink(filename) and
+ os.path.realpath(filename).startswith(accelpath))
+
+
+_accel_msg = (
+ 'Found {filename}, but that file is a symbolic link to the '
+ 'MacOS Accelerate framework, which is not supported by NumPy. '
+ 'You must configure the build to use a different optimized library, '
+ 'or disable the use of optimized BLAS and LAPACK by setting the '
+ 'environment variables NPY_BLAS_ORDER="" and NPY_LAPACK_ORDER="" '
+ 'before building NumPy.'
+)
+
+
def get_standard_file(fname):
"""Returns a list of files named 'fname' from
1) System-wide directory (directory-location of this module)
@@ -427,7 +443,6 @@ def get_info(name, notfound_action=0):
'blis': blis_info, # use blas_opt instead
'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
'blas_mkl': blas_mkl_info, # use blas_opt instead
- 'accelerate': accelerate_info, # use blas_opt instead
'openblas64_': openblas64__info,
'openblas64__lapack': openblas64__lapack_info,
'openblas_ilp64': openblas_ilp64_info,
@@ -919,6 +934,9 @@ class system_info:
for prefix in lib_prefixes:
p = self.combine_paths(lib_dir, prefix + lib + ext)
if p:
+ # p[0] is the full path to the binary library file.
+ if is_symlink_to_accelerate(p[0]):
+ raise RuntimeError(_accel_msg.format(filename=p[0]))
break
if p:
assert len(p) == 1
@@ -1650,8 +1668,8 @@ def get_atlas_version(**config):
class lapack_opt_info(system_info):
notfounderror = LapackNotFoundError
- # List of all known BLAS libraries, in the default order
- lapack_order = ['mkl', 'openblas', 'flame', 'atlas', 'accelerate', 'lapack']
+ # List of all known LAPACK libraries, in the default order
+ lapack_order = ['mkl', 'openblas', 'flame', 'atlas', 'lapack']
order_env_var_name = 'NPY_LAPACK_ORDER'
def _calc_info_mkl(self):
@@ -1823,7 +1841,7 @@ class lapack64__opt_info(lapack_ilp64_opt_info):
class blas_opt_info(system_info):
notfounderror = BlasNotFoundError
# List of all known BLAS libraries, in the default order
- blas_order = ['mkl', 'blis', 'openblas', 'atlas', 'accelerate', 'blas']
+ blas_order = ['mkl', 'blis', 'openblas', 'atlas', 'blas']
order_env_var_name = 'NPY_BLAS_ORDER'
def _calc_info_mkl(self):