Additional BLAS/LAPACK library configuration for Numpy (#30817)
* Add amdblis and amdlibflame as BLAS/LAPACK options * Add Cray-libsci as BLAS/LAPACK option * Use Netlib config for Cray-libsci
This commit is contained in:
parent
9f5c6fb398
commit
9016b79270
@ -228,7 +228,7 @@ def write_library_dirs(f, dirs):
|
|||||||
# Tell numpy where to find BLAS/LAPACK libraries
|
# Tell numpy where to find BLAS/LAPACK libraries
|
||||||
with open('site.cfg', 'w') as f:
|
with open('site.cfg', 'w') as f:
|
||||||
if '^intel-mkl' in spec or \
|
if '^intel-mkl' in spec or \
|
||||||
'^intel-parallel-studio+mkl' or \
|
'^intel-parallel-studio+mkl' in spec or \
|
||||||
'^intel-oneapi-mkl' in spec:
|
'^intel-oneapi-mkl' in spec:
|
||||||
f.write('[mkl]\n')
|
f.write('[mkl]\n')
|
||||||
# FIXME: as of @1.11.2, numpy does not work with separately
|
# FIXME: as of @1.11.2, numpy does not work with separately
|
||||||
@ -247,7 +247,8 @@ def write_library_dirs(f, dirs):
|
|||||||
write_library_dirs(f, lapackblas_lib_dirs)
|
write_library_dirs(f, lapackblas_lib_dirs)
|
||||||
f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs))
|
f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs))
|
||||||
|
|
||||||
if '^blis' in spec:
|
if '^blis' in spec or \
|
||||||
|
'^amdblis' in spec:
|
||||||
f.write('[blis]\n')
|
f.write('[blis]\n')
|
||||||
f.write('libraries = {0}\n'.format(blas_lib_names))
|
f.write('libraries = {0}\n'.format(blas_lib_names))
|
||||||
write_library_dirs(f, blas_lib_dirs)
|
write_library_dirs(f, blas_lib_dirs)
|
||||||
@ -259,7 +260,8 @@ def write_library_dirs(f, dirs):
|
|||||||
write_library_dirs(f, lapackblas_lib_dirs)
|
write_library_dirs(f, lapackblas_lib_dirs)
|
||||||
f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs))
|
f.write('include_dirs = {0}\n'.format(lapackblas_header_dirs))
|
||||||
|
|
||||||
if '^libflame' in spec:
|
if '^libflame' in spec or \
|
||||||
|
'^amdlibflame' in spec:
|
||||||
f.write('[flame]\n')
|
f.write('[flame]\n')
|
||||||
f.write('libraries = {0}\n'.format(lapack_lib_names))
|
f.write('libraries = {0}\n'.format(lapack_lib_names))
|
||||||
write_library_dirs(f, lapack_lib_dirs)
|
write_library_dirs(f, lapack_lib_dirs)
|
||||||
@ -276,8 +278,9 @@ def write_library_dirs(f, dirs):
|
|||||||
f.write('libraries = {0}\n'.format(lapackblas_lib_names))
|
f.write('libraries = {0}\n'.format(lapackblas_lib_names))
|
||||||
write_library_dirs(f, lapackblas_lib_dirs)
|
write_library_dirs(f, lapackblas_lib_dirs)
|
||||||
|
|
||||||
if '^netlib-lapack' in spec:
|
if '^netlib-lapack' in spec or \
|
||||||
# netlib requires blas and lapack listed
|
'^cray-libsci' in spec:
|
||||||
|
# netlib and Cray require blas and lapack listed
|
||||||
# separately so that scipy can find them
|
# separately so that scipy can find them
|
||||||
if spec.satisfies('+blas'):
|
if spec.satisfies('+blas'):
|
||||||
f.write('[blas]\n')
|
f.write('[blas]\n')
|
||||||
@ -317,7 +320,6 @@ def setup_build_environment(self, env):
|
|||||||
# https://github.com/numpy/numpy/pull/13132
|
# https://github.com/numpy/numpy/pull/13132
|
||||||
# https://numpy.org/devdocs/user/building.html#accelerated-blas-lapack-libraries
|
# https://numpy.org/devdocs/user/building.html#accelerated-blas-lapack-libraries
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
|
|
||||||
# https://numpy.org/devdocs/user/building.html#blas
|
# https://numpy.org/devdocs/user/building.html#blas
|
||||||
if 'blas' not in spec:
|
if 'blas' not in spec:
|
||||||
blas = ''
|
blas = ''
|
||||||
@ -325,7 +327,8 @@ def setup_build_environment(self, env):
|
|||||||
spec['blas'].name == 'intel-parallel-studio' or \
|
spec['blas'].name == 'intel-parallel-studio' or \
|
||||||
spec['blas'].name == 'intel-oneapi-mkl':
|
spec['blas'].name == 'intel-oneapi-mkl':
|
||||||
blas = 'mkl'
|
blas = 'mkl'
|
||||||
elif spec['blas'].name == 'blis':
|
elif spec['blas'].name == 'blis' or \
|
||||||
|
spec['blas'].name == 'amdblis':
|
||||||
blas = 'blis'
|
blas = 'blis'
|
||||||
elif spec['blas'].name == 'openblas':
|
elif spec['blas'].name == 'openblas':
|
||||||
blas = 'openblas'
|
blas = 'openblas'
|
||||||
@ -347,7 +350,8 @@ def setup_build_environment(self, env):
|
|||||||
lapack = 'mkl'
|
lapack = 'mkl'
|
||||||
elif spec['lapack'].name == 'openblas':
|
elif spec['lapack'].name == 'openblas':
|
||||||
lapack = 'openblas'
|
lapack = 'openblas'
|
||||||
elif spec['lapack'].name == 'libflame':
|
elif spec['lapack'].name == 'libflame' or \
|
||||||
|
spec['lapack'].name == 'amdlibflame':
|
||||||
lapack = 'flame'
|
lapack = 'flame'
|
||||||
elif spec['lapack'].name == 'atlas':
|
elif spec['lapack'].name == 'atlas':
|
||||||
lapack = 'atlas'
|
lapack = 'atlas'
|
||||||
|
Loading…
Reference in New Issue
Block a user