move rpath from ALL to other sections of site.cfg (#3028)

* move rpath from ALL to other sections of site.cfg.  Solves #3007
* Add back mac condition to py-numpy
* Refactor py-numpy a bit.
This commit is contained in:
Matthew Scott Krafczyk 2017-02-07 15:15:02 -06:00 committed by Todd Gamblin
parent 88e9bb586e
commit f71df7bda3

View File

@ -82,29 +82,12 @@ def patch(self):
# differently. # differently.
names = ','.join(lapackblas.names) names = ','.join(lapackblas.names)
dirs = ':'.join(lapackblas.directories) dirs = ':'.join(lapackblas.directories)
# First, workout the defaults.
# The section title for the defaults changed in @1.10, see
# https://github.com/numpy/numpy/blob/master/site.cfg.example
if spec.satisfies('@:1.9.2'):
f.write('[DEFAULT]\n')
else:
f.write('[ALL]\n')
if not ('^openblas' in spec or
'^mkl' in spec or
'^atlas' in spec):
f.write('libraries=%s\n' % names)
f.write('library_dirs=%s\n' % dirs)
if not ((platform.system() == "Darwin") and # Special treatment for some (!) BLAS/LAPACK. Note that
(platform.mac_ver()[0] == '10.12')):
f.write('rpath=%s\n' % ':'.join(lapackblas.directories))
# Now special treatment for some (!) BLAS/LAPACK. Note that
# in this case library_dirs can not be specified within [ALL]. # in this case library_dirs can not be specified within [ALL].
if '^openblas' in spec: if '^openblas' in spec:
f.write('[openblas]\n') f.write('[openblas]\n')
f.write('libraries=%s\n' % names) f.write('libraries=%s\n' % names)
f.write('library_dirs=%s\n' % dirs)
elif '^mkl' in spec: elif '^mkl' in spec:
# numpy does not expect system libraries needed for MKL # numpy does not expect system libraries needed for MKL
# here. # here.
@ -123,8 +106,19 @@ def patch(self):
# and using LD_LIBRARY_PATH throughout Spack. # and using LD_LIBRARY_PATH throughout Spack.
f.write('[mkl]\n') f.write('[mkl]\n')
f.write('mkl_libs=%s\n' % 'mkl_rt') f.write('mkl_libs=%s\n' % 'mkl_rt')
f.write('library_dirs=%s\n' % dirs)
elif '^atlas' in spec: elif '^atlas' in spec:
f.write('[atlas]\n') f.write('[atlas]\n')
f.write('atlas_libs=%s\n' % names) f.write('atlas_libs=%s\n' % names)
else:
# The section title for the defaults changed in @1.10, see
# https://github.com/numpy/numpy/blob/master/site.cfg.example
if spec.satisfies('@:1.9.2'):
f.write('[DEFAULT]\n')
else:
f.write('[ALL]\n')
f.write('libraries=%s\n' % names)
f.write('library_dirs=%s\n' % dirs) f.write('library_dirs=%s\n' % dirs)
if not ((platform.system() == "Darwin") and
(platform.mac_ver()[0] == '10.12')):
f.write('rpath=%s\n' % dirs)