Reworking of lapack_shared_libs and similar properties (#1682)

* Turned <provider>_libs into an iterable

Modifications :
- added class LibraryList + unit tests
- added convenience functions `find_libraries` and `dedupe`
- modifed non Intel blas/lapack providers
- modified packages using blas_shared_libs and similar functions

* atlas : added pthread variant

* intel packages : added lapack_libs and blas_libs

* find_library_path : removed unused function

* PR review : fixed last issues

* LibraryList : added test on __add__ return type

* LibraryList : added __radd__ fixed unit tests

fix : failing unit tests due to missing `self`

* cp2k and dependecies : fixed blas-lapack related statements in package.py
This commit is contained in:
Massimiliano Culpo
2016-09-21 21:27:59 +02:00
committed by Todd Gamblin
parent 6b6f868f2a
commit d848559f70
33 changed files with 526 additions and 244 deletions

View File

@@ -95,7 +95,8 @@ def install(self, spec, prefix):
fcflags.extend([
'-I' + spec['fftw'].prefix.include
])
ldflags = ['-L' + spec['fftw'].prefix.lib]
fftw = find_libraries(['libfftw3'], root=spec['fftw'].prefix.lib)
ldflags = [fftw.search_flags]
libs = []
if '+plumed' in self.spec:
# Include Plumed.inc in the Makefile
@@ -157,9 +158,8 @@ def install(self, spec, prefix):
),
'-I' + join_path(spec['pexsi'].prefix, 'fortran')
])
ldflags.extend([
'-L' + spec['scalapack'].prefix.lib
])
scalapack = spec['scalapack'].scalapack_libs
ldflags.append(scalapack.search_flags)
libs.extend([
join_path(spec['elpa'].prefix.lib,
'libelpa.{0}'.format(dso_suffix)),
@@ -176,20 +176,15 @@ def install(self, spec, prefix):
'libmetis.{0}'.format(dso_suffix)
),
])
libs.extend(spec['scalapack'].scalapack_shared_libs)
libs.extend(scalapack)
libs.extend(self.spec['mpi'].mpicxx_shared_libs)
libs.extend(self.compiler.stdcxx_libs)
# LAPACK / BLAS
ldflags.extend([
'-L' + spec['lapack'].prefix.lib,
'-L' + spec['blas'].prefix.lib
])
libs.extend([
join_path(spec['fftw'].prefix.lib,
'libfftw3.{0}'.format(dso_suffix)),
spec['lapack'].lapack_shared_lib,
spec['blas'].blas_shared_lib
])
lapack = spec['lapack'].lapack_libs
blas = spec['blas'].blas_libs
ldflags.append((lapack + blas).search_flags)
libs.extend([str(x) for x in (fftw, lapack, blas)])
# Write compiler flags to file
mkf.write('CPPFLAGS = {0}\n'.format(' '.join(cppflags)))