fix blas-lapack in scipy and numpy (#1949)

* fix blas-lapack in scipy and numpy

* py-numpy: do not set rpath on macOS

* py-scipy: do not set Blas/Lapack. This appears to be picked up from py-numpy

* py-numpy: don't write rpath= in Sierra only

* py-numpy: add a link to build notes
This commit is contained in:
Denis Davydov 2016-10-10 21:38:44 +02:00 committed by Todd Gamblin
parent 377ac68690
commit c2ca8693e9
2 changed files with 14 additions and 19 deletions

View file

@ -66,21 +66,21 @@ def setup_dependent_package(self, module, dep_spec):
'numpy/core/include')
def install(self, spec, prefix):
libraries = []
library_dirs = []
# for build notes see http://www.scipy.org/scipylib/building/linux.html
lapackblas = LibraryList('')
if '+lapack' in spec:
lapackblas += spec['lapack'].lapack_libs
if '+blas' in spec:
libraries.append('blas')
library_dirs.append(spec['blas'].prefix.lib)
if '+lapack' in spec:
libraries.append('lapack')
library_dirs.append(spec['lapack'].prefix.lib)
lapackblas += spec['blas'].blas_libs
if '+blas' in spec or '+lapack' in spec:
with open('site.cfg', 'w') as f:
f.write('[DEFAULT]\n')
f.write('libraries=%s\n' % ','.join(libraries))
f.write('library_dirs=%s\n' % ':'.join(library_dirs))
f.write('rpath=%s\n' % ':'.join(library_dirs))
f.write('libraries=%s\n' % ','.join(lapackblas.names))
f.write('library_dirs=%s\n' % ':'.join(lapackblas.directories))
if not ((platform.system() == "Darwin") and
(platform.mac_ver()[0] == '10.12')):
f.write('rpath=%s\n' % ':'.join(lapackblas.directories))
setup_py('install', '--prefix={0}'.format(prefix))

View file

@ -45,15 +45,10 @@ class PyScipy(Package):
# Known not to work with 2.23, 2.25
depends_on('binutils@2.26:', type='build')
depends_on('py-numpy@1.7.1:+blas+lapack', type=nolink)
depends_on('blas')
depends_on('lapack')
def install(self, spec, prefix):
if 'atlas' in spec:
# libatlas.so actually isn't always installed, but this
# seems to make the build autodetect things correctly.
env['ATLAS'] = join_path(
spec['atlas'].prefix.lib, 'libatlas.' + dso_suffix)
else:
env['BLAS'] = spec['blas'].blas_libs.joined()
env['LAPACK'] = spec['lapack'].lapack_libs.joined()
# NOTE: scipy picks up Blas/Lapack from numpy, see
# http://www.scipy.org/scipylib/building/linux.html#step-4-build-numpy-1-5-0
setup_py('install', '--prefix={0}'.format(prefix))