diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/pexsi/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/pexsi/package.py | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/pexsi/package.py b/var/spack/repos/builtin/packages/pexsi/package.py index 989e2ebf6e..04d22c4da8 100644 --- a/var/spack/repos/builtin/packages/pexsi/package.py +++ b/var/spack/repos/builtin/packages/pexsi/package.py @@ -30,7 +30,7 @@ import shutil from spack import * -class Pexsi(Package): +class Pexsi(MakefilePackage): """The PEXSI library is written in C++, and uses message passing interface (MPI) to parallelize the computation on distributed memory computing systems and achieve scalability on more than 10,000 processors. @@ -46,14 +46,20 @@ class Pexsi(Package): homepage = 'https://math.berkeley.edu/~linlin/pexsi/index.html' url = 'https://math.berkeley.edu/~linlin/pexsi/download/pexsi_v0.9.0.tar.gz' + version('0.9.2', '0ce491a3a922d271c4edf9b20aa93076') version('0.9.0', '0c1a2de891ba1445dfc184b2fa270ed8') depends_on('parmetis') depends_on('superlu-dist@3.3', when='@0.9.0') + depends_on('superlu-dist@4.3', when='@0.9.2') + + variant( + 'fortran', default=False, description='Builds the Fortran interface' + ) parallel = False - def install(self, spec, prefix): + def edit(self, spec, prefix): substitutions = { '@MPICC': self.spec['mpi'].mpicc, @@ -70,9 +76,13 @@ class Pexsi(Package): '@LAPACK_LIBS': self.spec['lapack'].libs.joined(), '@BLAS_LIBS': self.spec['blas'].libs.joined(), # FIXME : what to do with compiler provided libraries ? - '@STDCXX_LIB': ' '.join(self.compiler.stdcxx_libs) + '@STDCXX_LIB': ' '.join(self.compiler.stdcxx_libs), + '@FLDFLAGS': '' } + if '@0.9.2' in self.spec: + substitutions['@FLDFLAGS'] = '-Wl,--allow-multiple-definition' + template = join_path( os.path.dirname(inspect.getmodule(self).__file__), 'make.inc' @@ -85,20 +95,29 @@ class Pexsi(Package): for key, value in substitutions.items(): filter_file(key, value, makefile) - make() + def build(self, spec, prefix): + super(Pexsi, self).build(spec, prefix) + if '+fortran' in self.spec: + make('-C', 'fortran') + + def install(self, spec, prefix): + # 'make install' does not exist, despite what documentation says mkdirp(self.prefix.lib) + install( join_path(self.stage.source_path, 'src', 'libpexsi_linux.a'), join_path(self.prefix.lib, 'libpexsi.a') ) + install_tree( join_path(self.stage.source_path, 'include'), self.prefix.include ) + # fortran "interface" - make('-C', 'fortran') - install_tree( - join_path(self.stage.source_path, 'fortran'), - join_path(self.prefix, 'fortran') - ) + if '+fortran' in self.spec: + install_tree( + join_path(self.stage.source_path, 'fortran'), + join_path(self.prefix, 'fortran') + ) |