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') 'numpy/core/include')
def install(self, spec, prefix): def install(self, spec, prefix):
libraries = [] # for build notes see http://www.scipy.org/scipylib/building/linux.html
library_dirs = [] lapackblas = LibraryList('')
if '+lapack' in spec:
lapackblas += spec['lapack'].lapack_libs
if '+blas' in spec: if '+blas' in spec:
libraries.append('blas') lapackblas += spec['blas'].blas_libs
library_dirs.append(spec['blas'].prefix.lib)
if '+lapack' in spec:
libraries.append('lapack')
library_dirs.append(spec['lapack'].prefix.lib)
if '+blas' in spec or '+lapack' in spec: if '+blas' in spec or '+lapack' in spec:
with open('site.cfg', 'w') as f: with open('site.cfg', 'w') as f:
f.write('[DEFAULT]\n') f.write('[DEFAULT]\n')
f.write('libraries=%s\n' % ','.join(libraries)) f.write('libraries=%s\n' % ','.join(lapackblas.names))
f.write('library_dirs=%s\n' % ':'.join(library_dirs)) f.write('library_dirs=%s\n' % ':'.join(lapackblas.directories))
f.write('rpath=%s\n' % ':'.join(library_dirs)) 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)) 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 # Known not to work with 2.23, 2.25
depends_on('binutils@2.26:', type='build') depends_on('binutils@2.26:', type='build')
depends_on('py-numpy@1.7.1:+blas+lapack', type=nolink) depends_on('py-numpy@1.7.1:+blas+lapack', type=nolink)
depends_on('blas')
depends_on('lapack')
def install(self, spec, prefix): def install(self, spec, prefix):
if 'atlas' in spec: # NOTE: scipy picks up Blas/Lapack from numpy, see
# libatlas.so actually isn't always installed, but this # http://www.scipy.org/scipylib/building/linux.html#step-4-build-numpy-1-5-0
# 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()
setup_py('install', '--prefix={0}'.format(prefix)) setup_py('install', '--prefix={0}'.format(prefix))