From 2e4378bcd035c9910a4565d791fcdbdab0afffd8 Mon Sep 17 00:00:00 2001 From: jthies Date: Thu, 22 Mar 2018 17:42:38 -0700 Subject: added a new package file for PHIST (Pipelined, Hybrid-parallel Iterat… (#7361) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added a new package file for PHIST (Pipelined, Hybrid-parallel Iterative Solver Toolkit) * packages/phist: fix some formatting errors (too long lines etc) and set allowed values for option "outlev" * packages/phist: fix some more flake8 errors * add headers property to netlib-lapack and intel-mkl * ghost: fix finding cblas header and libs (at least for mkl and netlib-lapack, which provide headers()) * added a new package file for PHIST (Pipelined, Hybrid-parallel Iterative Solver Toolkit) * packages/phist: fix some formatting errors (too long lines etc) and set allowed values for option "outlev" * packages/phist: fix some more flake8 errors * phist: use headers property to find lapacke include dir * phist: fix flake8 error * phist: be more specific about dependencies and update version * phist: state trilinos minimum version when building with Tpetra kernels * gmp: add oldish version 5.1.3 with checksum * phist: get rid of the 'petsc+complex' variant, it can be installed by kernel_lib=petsc ^petsc+complex * phist: new version * phist: fix version checksum * Revert "add headers property to netlib-lapack and intel-mkl" This reverts commit d8cb62905ebfb2cba186fd2d736d54a88a49d089. * Revert "ghost: fix finding cblas header and libs (at least for mkl and netlib-lapack, which provide headers())" This reverts commit d406a77ed7879c124fbaf1d757d002b9f0771620. * phist: remove unused function * phist: reorder package file versions/variants/depends_on/rest * phist: some minor changes requested by @adamjsteward --- var/spack/repos/builtin/packages/phist/package.py | 132 ++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 var/spack/repos/builtin/packages/phist/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/phist/package.py b/var/spack/repos/builtin/packages/phist/package.py new file mode 100644 index 0000000000..d224be372f --- /dev/null +++ b/var/spack/repos/builtin/packages/phist/package.py @@ -0,0 +1,132 @@ +############################################################################## +# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/spack/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +from spack import * + + +class Phist(CMakePackage): + """The Pipelined, Hybrid-parallel Iterative Solver Toolkit provides + implementations of and interfaces to block iterative solvers for sparse + linear and eigenvalue problems. In contrast to other libraries we support + multiple backends (e.g. Trilinos, PETSc and our own optimized kernels), + and interfaces in multiple languages such as C, C++, Fortran 2003 and + Python. PHIST has a clear focus on portability and hardware performance: + in particular support row-major storage of block vectors and using GPUs + (via the ghost library or Trilinos/Tpetra). + """ + + homepage = "https://bitbucket.org/essex/phist/" + url = 'https://bitbucket.org/essex/phist/get/phist-1.4.3.tar.gz' + + version('develop', + git='https://bitbucket.org/essex/phist/phist.git', branch='devel') + version('master', + git='https://bitbucket.org/essex/phist/phist.git', branch='master') + version('1.4.3', 'af3300378d4282366d148e38c3a3199a') + + variant(name='kernel_lib', default='builtin', + description='select the kernel library (backend) for phist', + values=['builtin', + 'epetra', + 'tpetra', + 'petsc', + 'eigen', + 'ghost']) + variant(name='outlev', default='2', values=['0', '1', '2', '3', '4', '5'], + description='verbosity. 0: errors 1: +warnings 2: +info ' + '3: +verbose 4: +extreme 5; +debug') + + variant('shared', default=True, + description='Enables the build of shared libraries') + + variant('mpi', default=True, + description='enable/disable MPI (note that the kernel library may ' + 'not support this choice)') + variant('parmetis', default=False, + description='enable/disable ParMETIS partitioning (only actually ' + 'used with kernel_lib=builtin)') + variant('trilinos', default=False, + description='enable/disable Trilinos third-party libraries. ' + 'For all kernel_libs, we can use Belos and Anasazi ' + 'iterative solvers. For the Trilinos backends ' + '(kernel_lib=epetra|tpetra) we can use preconditioner ' + 'packages such as Ifpack, Ifpack2 and ML.') + + # ###################### Dependencies ########################## + + depends_on('cmake@3.8:', type='build') + depends_on('blas') + depends_on('lapack') + depends_on('mpi', when='+mpi') + depends_on('trilinos+anasazi+belos+teuchos', when='+trilinos') + depends_on('trilinos@12:+tpetra', when='kernel_lib=tpetra') + # Epetra backend also works with older Trilinos versions + depends_on('trilinos+epetra', when='kernel_lib=epetra') + depends_on('petsc', when='kernel_lib=petsc') + depends_on('eigen', when='kernel_lib=eigen') + depends_on('ghost', when='kernel_lib=ghost') + + depends_on('trilinos', when='+trilinos') + depends_on('parmetis ^metis+int64', when='+parmetis') + + def cmake_args(self): + spec = self.spec + + kernel_lib = spec.variants['kernel_lib'].value + outlev = spec.variants['outlev'].value + + lapacke_libs = \ + (spec['lapack:c'].libs + spec['blas:c'].libs).joined(';') + lapacke_include_dir = spec['lapack:c'].headers.directories[0] + + args = ['-DPHIST_KERNEL_LIB=%s' % kernel_lib, + '-DPHIST_OUTLEV=%s' % outlev, + '-DTPL_LAPACKE_LIBRARIES=%s' % lapacke_libs, + '-DTPL_LAPACKE_INCLUDE_DIRS=%s' % lapacke_include_dir, + '-DPHIST_ENABLE_MPI:BOOL=%s' + % ('ON' if '+mpi' in spec else 'OFF'), + '-DBUILD_SHARED_LIBS:BOOL=%s' + % ('ON' if '+shared' in spec else 'OFF'), + '-DPHIST_USE_TRILINOS_TPLS:BOOL=%s' + % ('ON' if '+trilinos' in spec else 'OFF'), + '-DPHIST_USE_SOLVER_TPLS:BOOL=%s' + % ('ON' if '+trilinos' in spec else 'OFF'), + '-DPHIST_USE_PRECON_TPLS:BOOL=%s' + % ('ON' if '+trilinos' in spec else 'OFF'), + ] + + return args + + @run_after('build') + @on_package_attributes(run_tests=True) + def check(self): + with working_dir(self.build_directory): + make("check") + + @run_after('install') + @on_package_attributes(run_tests=True) + def test_install(self): + with working_dir(self.build_directory): + make("test_install") -- cgit v1.2.3-70-g09d2