diff --git a/var/spack/repos/builtin/packages/alquimia/package.py b/var/spack/repos/builtin/packages/alquimia/package.py new file mode 100644 index 0000000000..9e35aa9e15 --- /dev/null +++ b/var/spack/repos/builtin/packages/alquimia/package.py @@ -0,0 +1,74 @@ +############################################################################## +# Copyright (c) 2013-2016, 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/llnl/spack +# Please also see the LICENSE file 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 Alquimia(CMakePackage): + """Alquimia is an interface that exposes the capabilities + of mature geochemistry codes such as CrunchFlow and PFLOTRAN""" + + homepage = "https://github.com/LBL-EESA/alquimia-dev" + + version('xsdk-0.2.0', git='https://github.com/LBL-EESA/alquimia-dev.git', tag='xsdk-0.2.0') + version('develop', git='https://github.com/LBL-EESA/alquimia-dev.git') + + variant('shared', default=True, + description='Enables the build of shared libraries') + variant('debug', default=False, + description='Builds a debug version of the libraries') + + depends_on('mpi') + depends_on('hdf5') + depends_on('pflotran@xsdk-0.2.0', when='@xsdk-0.2.0') + depends_on('pflotran@develop', when='@develop') + depends_on('petsc@xsdk-0.2.0', when='@xsdk-0.2.0') + depends_on('petsc@develop', when='@develop') + + def cmake_args(self): + spec = self.spec + + options = ['-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc, + '-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc, + '-DUSE_XSDK_DEFAULTS=YES', + '-DCMAKE_BUILD_TYPE:STRING=%s' % ( + 'DEBUG' if '+debug' in spec else 'RELEASE'), + '-DXSDK_ENABLE_DEBUG:STRING=%s' % ( + 'YES' if '+debug' in spec else 'NO'), + '-DBUILD_SHARED_LIBS:BOOL=%s' % ( + 'ON' if '+shared' in spec else 'OFF'), + '-DTPL_ENABLE_MPI:BOOL=ON', + '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix, + '-DTPL_ENABLE_HDF5:BOOL=ON', + '-DXSDK_WITH_PFLOTRAN:BOOL=ON', + # This is not good. + # It assumes that the .a file exists and is not a .so + '-DTPL_PFLOTRAN_LIBRARIES=%s' % ( + spec['pflotran'].prefix.lib + "/libpflotranchem.a"), + '-DTPL_PFLOTRAN_INCLUDE_DIRS=%s' % ( + spec['pflotran'].prefix.include), + '-DTPL_ENABLE_PETSC:BOOL=ON', + '-DPETSC_EXECUTABLE_RUNS=ON', + '-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % self.prefix] + return options diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 55886d86fa..67a636de44 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -36,6 +36,7 @@ class Hypre(Package): url = "http://computation.llnl.gov/project/linear_solvers/download/hypre-2.10.0b.tar.gz" version('develop', git='https://github.com/LLNL/hypre', tag='master') + version('xsdk-0.2.0', git='https://github.com/LLNL/hypre', tag='xsdk-0.2.0') version('2.11.2', 'd507943a1a3ce5681c3308e2f3a6dd34') version('2.11.1', '3f02ef8fd679239a6723f60b7f796519') version('2.10.1', 'dc048c4cabb3cd549af72591474ad674') diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index d3c1895508..4e2effd9ad 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -23,8 +23,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -import os import sys +import os from spack import * @@ -38,8 +38,7 @@ class Petsc(Package): url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.5.3.tar.gz" version('develop', git='https://bitbucket.org/petsc/petsc.git', tag='master') - version('for-pflotran-0.1.0', git='https://bitbucket.org/petsc/petsc.git', - commit='7943f4e1472fff9cf1fc630a1100136616e4970f') + version('xsdk-0.2.0', git='https://bitbucket.org/petsc/petsc.git', tag='xsdk-0.2.0') version('3.7.5', 'f00f6e6a3bac39052350dd47194b58a3') version('3.7.4', 'aaf94fa54ef83022c14091f10866eedf') @@ -66,11 +65,15 @@ class Petsc(Package): variant('boost', default=True, description='Activates support for Boost') variant('hypre', default=True, description='Activates support for Hypre (only parallel)') - variant('mumps', default=True, + # Mumps is disabled by default, because it depends on Scalapack + # which is not portable to all HPC systems + variant('mumps', default=False, description='Activates support for MUMPS (only parallel' ' and 32bit indices)') variant('superlu-dist', default=True, description='Activates support for SuperluDist (only parallel)') + variant('trilinos', default=False, + description='Activates support for Trilinos (only parallel)') variant('int64', default=False, description='Compile with 64bit indices') @@ -106,15 +109,24 @@ class Petsc(Package): # conflict in headers see # https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py depends_on('hypre~internal-superlu~int64', when='+hypre+mpi~complex~int64') + depends_on('hypre@xsdk-0.2.0~internal-superlu+int64', when='@xsdk-0.2.0+hypre+mpi~complex+int64') + depends_on('hypre@xsdk-0.2.0~internal-superlu~int64', when='@xsdk-0.2.0+hypre+mpi~complex~int64') + depends_on('hypre@develop~internal-superlu+int64', when='@develop+hypre+mpi~complex+int64') + depends_on('hypre@develop~internal-superlu~int64', when='@develop+hypre+mpi~complex~int64') depends_on('hypre~internal-superlu+int64', when='+hypre+mpi~complex+int64') depends_on('superlu-dist@:4.3~int64', when='@3.4.4:3.6.4+superlu-dist+mpi~int64') depends_on('superlu-dist@:4.3+int64', when='@3.4.4:3.6.4+superlu-dist+mpi+int64') depends_on('superlu-dist@5.0.0:~int64', when='@3.7:+superlu-dist+mpi~int64') depends_on('superlu-dist@5.0.0:+int64', when='@3.7:+superlu-dist+mpi+int64') - depends_on('superlu-dist@5.0.0:~int64', when='@for-pflotran-0.1.0+superlu-dist+mpi~int64') - depends_on('superlu-dist@5.0.0:+int64', when='@for-pflotran-0.1.0+superlu-dist+mpi+int64') + depends_on('superlu-dist@xsdk-0.2.0~int64', when='@xsdk-0.2.0+superlu-dist+mpi~int64') + depends_on('superlu-dist@xsdk-0.2.0+int64', when='@xsdk-0.2.0+superlu-dist+mpi+int64') + depends_on('superlu-dist@develop~int64', when='@develop+superlu-dist+mpi~int64') + depends_on('superlu-dist@develop+int64', when='@develop+superlu-dist+mpi+int64') depends_on('mumps+mpi', when='+mumps+mpi~int64') depends_on('scalapack', when='+mumps+mpi~int64') + depends_on('trilinos@12.6.2:', when='@3.7.0:+trilinos+mpi') + depends_on('trilinos@xsdk-0.2.0', when='@xsdk-0.2.0+trilinos+mpi') + depends_on('trilinos@develop', when='@xdevelop+trilinos+mpi') def mpi_dependent_options(self): if '~mpi' in self.spec: @@ -140,14 +152,10 @@ def mpi_dependent_options(self): raise RuntimeError('\n'.join(errors)) else: compiler_opts = [ - '--with-mpi=1', - '--with-mpi-dir=%s' % self.spec['mpi'].prefix, + '--with-cc=%s' % self.spec['mpi'].mpicc, + '--with-cxx=%s' % self.spec['mpi'].mpicxx, + '--with-fc=%s' % self.spec['mpi'].mpifc ] - if sys.platform != "darwin": - compiler_opts.extend([ - '--with-cpp=cpp', - '--with-cxxcpp=cpp', - ]) return compiler_opts def install(self, spec, prefix): @@ -173,6 +181,9 @@ def install(self, spec, prefix): '--with-blas-lapack-lib=%s' % lapack_blas.joined() ]) + if 'trilinos' in spec: + options.append('--with-cxx-dialect=C++11') + # Help PETSc pick up Scalapack from MKL: if 'scalapack' in spec: scalapack = spec['scalapack'].libs @@ -187,7 +198,7 @@ def install(self, spec, prefix): # Activates library support if needed for library in ('metis', 'boost', 'hdf5', 'hypre', 'parmetis', - 'mumps'): + 'mumps', 'scalapack', 'trilinos'): options.append( '--with-{library}={value}'.format( library=library, value=('1' if library in spec else '0')) diff --git a/var/spack/repos/builtin/packages/pflotran/package.py b/var/spack/repos/builtin/packages/pflotran/package.py index fc70693041..b7e623cb05 100644 --- a/var/spack/repos/builtin/packages/pflotran/package.py +++ b/var/spack/repos/builtin/packages/pflotran/package.py @@ -33,13 +33,12 @@ class Pflotran(AutotoolsPackage): homepage = "http://www.pflotran.org" - version('develop', hg='https://bitbucket.org/pflotran/pflotran-xsdk') - version('0.1.0', hg='https://bitbucket.org/pflotran/pflotran-xsdk', - commmit='4734cf5e606b') + version('develop', git='https://bitbucket.org/pflotran/pflotran') + version('xsdk-0.2.0', git='https://bitbucket.org/pflotran/pflotran', tag='master') depends_on('mpi') depends_on('hdf5@1.8.12:+mpi+fortran') - depends_on('petsc@develop+hdf5+metis',when='@develop') - depends_on('petsc@for-pflotran-0.1.0+hdf5+metis',when='@0.1.0') + depends_on('petsc@develop+hdf5+metis', when='@develop') + depends_on('petsc@xsdk-0.2.0+hdf5+metis', when='@xsdk-0.2.0') parallel = False diff --git a/var/spack/repos/builtin/packages/superlu-dist/package.py b/var/spack/repos/builtin/packages/superlu-dist/package.py index 9c31694295..e19a33a900 100644 --- a/var/spack/repos/builtin/packages/superlu-dist/package.py +++ b/var/spack/repos/builtin/packages/superlu-dist/package.py @@ -34,6 +34,7 @@ class SuperluDist(Package): url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_4.1.tar.gz" version('develop', git='https://github.com/xiaoyeli/superlu_dist', tag='master') + version('xsdk-0.2.0', git='https://github.com/xiaoyeli/superlu_dist', tag='xsdk-0.2.0') version('5.1.3', 'fec21a9207ef94f57501c9406da78285') version('5.1.1', '12638c631733a27dcbd87110e9f9cb1e') version('5.1.0', '6bb86e630bd4bd8650243aed8fd92eb9') diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 9422034893..0d90ae4e1e 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -46,6 +46,8 @@ class Trilinos(CMakePackage): homepage = "https://trilinos.org/" url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-12-10-1.tar.gz" + version('xsdk-0.2.0', + git='https://github.com/trilinos/Trilinos.git', tag='xsdk-0.2.0') version('develop', git='https://github.com/trilinos/Trilinos.git', tag='develop') version('master', @@ -86,6 +88,7 @@ class Trilinos(CMakePackage): variant('debug', default=False, description='Builds a debug version of the libraries') variant('boost', default=True, description='Compile with Boost') + variant('tpetra', default=True, description='Compile with Tpetra') variant('exodus', default=False, description='Compile with Exodus from SEACAS') # Everything should be compiled with -fpic @@ -112,15 +115,19 @@ class Trilinos(CMakePackage): depends_on('scalapack', when='+mumps') depends_on('superlu-dist@:4.3', when='@:12.6.1+superlu-dist') depends_on('superlu-dist', when='@12.6.2:+superlu-dist') + depends_on('superlu-dist@develop', when='@develop+superlu-dist') + depends_on('superlu-dist@xsdk-0.2.0', when='@xsdk-0.2.0+superlu-dist') depends_on('superlu+fpic@4.3', when='+superlu') # Trilinos can not be built against 64bit int hypre depends_on('hypre~internal-superlu~int64', when='+hypre') + depends_on('hypre@xsdk-0.2.0~internal-superlu', when='@xsdk-0.2.0+hypre') + depends_on('hypre@develop~internal-superlu', when='@develop+hypre') depends_on('hdf5+mpi', when='+hdf5') depends_on('python', when='+python') depends_on('py-numpy', when='+python', type=('build', 'run')) depends_on('swig', when='+python') - patch('umfpack_from_suitesparse.patch', when='@:12.8.1') + patch('umfpack_from_suitesparse.patch', when='@11.14.1:12.8.1') def url_for_version(self, version): url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-{0}.tar.gz" @@ -128,7 +135,8 @@ def url_for_version(self, version): # check that the combination of variants makes sense def variants_check(self): - if '+superlu-dist' in self.spec and self.spec.satisfies('@:11.4.3'): + if ('+superlu-dist' in self.spec and + self.spec.satisfies('@11.14.1:11.14.3')): # For Trilinos v11 we need to force SuperLUDist=OFF, since only the # deprecated SuperLUDist v3.3 together with an Amesos patch is # working. @@ -174,7 +182,9 @@ def cmake_args(self): '-DLAPACK_LIBRARY_DIRS=%s' % ';'.join(lapack.directories), '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', - '-DTPL_ENABLE_Netcdf:BOOL=ON' + '-DTPL_ENABLE_Netcdf:BOOL=ON', + '-DTrilinos_ENABLE_Tpetra:BOOL=%s' % ( + 'ON' if '+tpetra' in spec else 'OFF') ]) if '.'.join(platform.mac_ver()[0].split('.')[:2]) == '10.12': @@ -385,7 +395,7 @@ def cmake_args(self): options.extend([ '-DTrilinos_ENABLE_SEACAS:BOOL=OFF' ]) - + # disable due to compiler / config errors: if spec.satisfies('%xl') or spec.satisfies('%xl_r'): options.extend([ diff --git a/var/spack/repos/builtin/packages/xsdk/package.py b/var/spack/repos/builtin/packages/xsdk/package.py new file mode 100644 index 0000000000..3ceadcda7e --- /dev/null +++ b/var/spack/repos/builtin/packages/xsdk/package.py @@ -0,0 +1,84 @@ +############################################################################## +# Copyright (c) 2013-2016, 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## + +import os +from spack import * + + +class Xsdk(Package): + """Xsdk is a suite of Department of Energy (DOE) packages for numerical + simulation. This is a Spack bundle package that installs the xSDK + packages + """ + + homepage = "http://xsdk.info" + + # Dummy url since Spack complains if I don't list something, will be + # removed when metapackage is available + url = 'https://bitbucket.org/saws/saws/get/master.tar.gz' + + version('develop', '941a541bdf625856be18c9752249146d') + version('xsdk-0.2.0', '941a541bdf625856be18c9752249146d') + + depends_on('hypre@xsdk-0.2.0~internal-superlu', when='@xsdk-0.2.0') + depends_on('hypre@develop~internal-superlu', when='@develop') + + depends_on('superlu-dist@xsdk-0.2.0', when='@xsdk-0.2.0') + depends_on('superlu-dist@develop', when='@develop') + + depends_on('trilinos@xsdk-0.2.0+hypre+superlu-dist+metis+hdf5~mumps+boost~suite-sparse~tpetra', + when='@xsdk-0.2.0') + depends_on('trilinos@develop+xsdkflags+hypre+superlu-dist+metis+hdf5~mumps+boost~suite-sparse~tpetra', + when='@develop') + + depends_on('petsc@xsdk-0.2.0+trilinos+mpi+hypre+superlu-dist+metis+hdf5~mumps~boost', + when='@xsdk-0.2.0') + depends_on('petsc@develop+trilinos+mpi+hypre+superlu-dist+metis+hdf5~mumps~boost', + when='@develop') + + depends_on('pflotran@xsdk-0.2.0', when='@xsdk-0.2.0') + depends_on('pflotran@develop', when='@develop') + + depends_on('alquimia@xsdk-0.2.0', when='@xsdk-0.2.0') + depends_on('alquimia@develop', when='@develop') + + # xSDKTrilinos depends on the version of Trilinos built with + # +tpetra which is turned off for faster xSDK + # depends_on('xsdktrilinos@xsdk-0.2.0', when='@xsdk-0.2.0') + # depends_on('xsdktrilinos@develop', when='@develop') + + variant('debug', default=False, description='Compile in debug mode') + + # How do we propagate debug flag to all depends on packages ? + # If I just do spack install xsdk+debug will that propogate it down? + + # Dummy install for now, will be removed when metapackage is available + def install(self, spec, prefix): + # Prevent the error message + # ==> Error: Install failed for xsdk. Nothing was installed! + # ==> Error: Installation process had nonzero exit code : 256 + with open(os.path.join(spec.prefix, 'bundle-package.txt'), 'w') as out: + out.write('This is a bundle\n') + out.close() diff --git a/var/spack/repos/builtin/packages/xsdktrilinos/package.py b/var/spack/repos/builtin/packages/xsdktrilinos/package.py index 7e88b2f9eb..7af6cd73a7 100644 --- a/var/spack/repos/builtin/packages/xsdktrilinos/package.py +++ b/var/spack/repos/builtin/packages/xsdktrilinos/package.py @@ -35,6 +35,7 @@ class Xsdktrilinos(CMakePackage): url = "https://github.com/trilinos/xSDKTrilinos/archive/trilinos-release-12-8-1.tar.gz" version('develop', git='https://github.com/trilinos/xSDKTrilinos.git', tag='master') + version('xsdk-0.2.0', git='https://github.com/trilinos/xSDKTrilinos.git', tag='xsdk-0.2.0') version('12.8.1', '9cc338ded17d1e10ea6c0dc18b22dcd4') version('12.6.4', '44c4c54ccbac73bb8939f68797b9454a') @@ -50,10 +51,14 @@ class Xsdktrilinos(CMakePackage): # MPI related dependencies depends_on('mpi') depends_on('hypre~internal-superlu', when='+hypre') - depends_on('petsc+mpi~complex', when='+petsc') + depends_on('hypre@xsdk-0.2.0~internal-superlu', when='@xsdk-0.2.0+hypre') + depends_on('hypre@develop~internal-superlu', when='@develop+hypre') + depends_on('petsc@xsdk-0.2.0+mpi~complex', when='@xsdk-0.2.0+petsc') + depends_on('petsc@develop+mpi~complex', when='@develop+petsc') depends_on('trilinos@12.6.4', when='@12.6.4') depends_on('trilinos@12.8.1', when='@12.8.1') - depends_on('trilinos@develop', when='@develop') + depends_on('trilinos@xsdk-0.2.0', when='@xsdk-0.2.0') + depends_on('trilinos@develop', when='@develop') def url_for_version(self, version): url = "https://github.com/trilinos/xSDKTrilinos/archive/trilinos-release-{0}.tar.gz"