Ensure same BLAS/LAPACK config from Numpy used in Scipy (#30818)
* Call Numpy package's set_blas_lapack() and setup_build_environment() in Scipy package * Remove broken link from comment * Use .package attribute of spec to avoid import
This commit is contained in:
parent
78cac4d840
commit
1485931695
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
|
||||||
class PyScipy(PythonPackage):
|
class PyScipy(PythonPackage):
|
||||||
"""SciPy (pronounced "Sigh Pie") is a Scientific Library for Python.
|
"""SciPy (pronounced "Sigh Pie") is a Scientific Library for Python.
|
||||||
It provides many user-friendly and efficient numerical routines such
|
It provides many user-friendly and efficient numerical routines such
|
||||||
@ -83,8 +84,9 @@ class PyScipy(PythonPackage):
|
|||||||
depends_on('python@3.8:3.10', when='@1.8:', type=('build', 'link', 'run'))
|
depends_on('python@3.8:3.10', when='@1.8:', type=('build', 'link', 'run'))
|
||||||
depends_on('py-pytest', type='test')
|
depends_on('py-pytest', type='test')
|
||||||
|
|
||||||
# NOTE: scipy picks up Blas/Lapack from numpy, see
|
# NOTE: scipy should use the same Blas/Lapack as numpy
|
||||||
# http://www.scipy.org/scipylib/building/linux.html#step-4-build-numpy-1-5-0
|
# This is achieved by calling the set_blas_lapack() and setup_build_environment()
|
||||||
|
# from numpy in the scipy spec
|
||||||
depends_on('blas')
|
depends_on('blas')
|
||||||
depends_on('lapack')
|
depends_on('lapack')
|
||||||
# https://github.com/scipy/scipy/wiki/Dropping-support-for-Accelerate
|
# https://github.com/scipy/scipy/wiki/Dropping-support-for-Accelerate
|
||||||
@ -96,6 +98,11 @@ class PyScipy(PythonPackage):
|
|||||||
|
|
||||||
patch('scipy-clang.patch', when='@1.5.0:1.6.3 %clang')
|
patch('scipy-clang.patch', when='@1.5.0:1.6.3 %clang')
|
||||||
|
|
||||||
|
@run_before('install')
|
||||||
|
def set_blas_lapack(self):
|
||||||
|
# Pick up Blas/Lapack from numpy
|
||||||
|
self.spec['py-numpy'].package.set_blas_lapack()
|
||||||
|
|
||||||
def setup_build_environment(self, env):
|
def setup_build_environment(self, env):
|
||||||
# https://github.com/scipy/scipy/issues/9080
|
# https://github.com/scipy/scipy/issues/9080
|
||||||
env.set('F90', spack_fc)
|
env.set('F90', spack_fc)
|
||||||
@ -104,6 +111,9 @@ def setup_build_environment(self, env):
|
|||||||
if self.spec.satisfies('@:1.4 %gcc@10:'):
|
if self.spec.satisfies('@:1.4 %gcc@10:'):
|
||||||
env.set('FFLAGS', '-fallow-argument-mismatch')
|
env.set('FFLAGS', '-fallow-argument-mismatch')
|
||||||
|
|
||||||
|
# Pick up Blas/Lapack from numpy
|
||||||
|
self.spec['py-numpy'].package.setup_build_environment(env)
|
||||||
|
|
||||||
def install_options(self, spec, prefix):
|
def install_options(self, spec, prefix):
|
||||||
args = []
|
args = []
|
||||||
if spec.satisfies('%fj'):
|
if spec.satisfies('%fj'):
|
||||||
|
Loading…
Reference in New Issue
Block a user