diff options
author | Mark C. Miller <miller86@llnl.gov> | 2017-05-09 16:26:57 -0700 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2017-05-09 18:26:57 -0500 |
commit | 64fb2f22b436cf14e75da11e27430500a675212c (patch) | |
tree | d613e8d1db340c55a4e4601b6f952781a3a667c4 /var/spack/repos/builtin/packages/chombo | |
parent | a5fd658986be32404b6d50539dc413df8efea96f (diff) | |
download | spack-64fb2f22b436cf14e75da11e27430500a675212c.tar.gz spack-64fb2f22b436cf14e75da11e27430500a675212c.tar.bz2 spack-64fb2f22b436cf14e75da11e27430500a675212c.tar.xz spack-64fb2f22b436cf14e75da11e27430500a675212c.zip |
Adding FASTMath uber package and missing FASTMath packages (#4120)
* adding 0.5.1 and variant for uint8 bit stream word type
* Revisions as per davydden
* fixing style (flake8) issues
* - switched to derive from MakefilePackage
- fixed typo in variant check
- Confirmed installs correctly with bswtuint8 variant
* added build method; changed zfp_incdir to incdir
* * Adding uber fastmath package to support 'spack install fastmath'
* Adding dims variant boxlib to control compile-time spatial dimension count
* Explicitly disabling many parts of moab to get lib to build. Don't need tools yet.
* Add logic to spack/setup-env to not refer to $SYS_TYPE if its not defined.
* adding mesquite package
* * Added Chombo (still working on Fortran name mangling)
* Made mesquite depend on mpi
* Fixed use of boxlib's dims numerical variant
* adding PUMI
* flake8 compliance
* adding phasta
* fixing flake8 issues
* undue $SYS_TYPE protection change
* fixing install step for fastmath uber package; resolve issues requested by adamjstewart in PR
* revisions as per adamjstewart
* re-enabling trilinos and phasta dependencies
* all changes requested modulu values= and assert statement
* fixing cmake_args usage in pumi; fixing lib installs for chombo
* first pass at numerical variant
* fixing dims variant as per @adamjstewart
* fixing func/var name collision
* fixing means of disabling -Werror
* fix name collision for cmake_args var/func
* fixing chombo homepage/url; make FASTMath use chombo#3.2; remove extraneous comment about boxlib dim
* remove dummy fastmath package; switch to @BarrySmith soln for install of dummy bundle
* fix flake8 import os issue
* remove extraneous comment
* adding url for fastmath scidac site
* final fixes as per @adamjstewart
* adding 1 dims option for boxlib
* switching make(all) to gmake(all)
Diffstat (limited to 'var/spack/repos/builtin/packages/chombo')
3 files changed, 175 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/chombo/Make.defs.local.template.patch b/var/spack/repos/builtin/packages/chombo/Make.defs.local.template.patch new file mode 100644 index 0000000000..cc72659445 --- /dev/null +++ b/var/spack/repos/builtin/packages/chombo/Make.defs.local.template.patch @@ -0,0 +1,23 @@ +*** lib/mk/Make.defs.local.template 2017-05-02 16:00:16.000000000 -0700 +--- lib/mk/Make.defs.local.template.patched 2017-05-02 18:50:36.000000000 -0700 +*************** +*** 129,135 **** +--- 129,137 ---- + #HDFMPILIBFLAGS= -L<hdf_parallel_dir>/lib -lhdf5 -lz + #USE_MF = + #USE_MT = ++ #USE_LAPACK = + #USE_SETVAL = ++ #USE_TIMER = + #CH_AR = + #CH_CPP = + #DOXYGEN = +*************** +*** 151,155 **** +--- 153,158 ---- + #ldoptflags = + #ldprofflags = + #syslibflags = ++ #lapackincflags = + + #end -- dont change this line diff --git a/var/spack/repos/builtin/packages/chombo/hdf5-16api.patch b/var/spack/repos/builtin/packages/chombo/hdf5-16api.patch new file mode 100644 index 0000000000..6525061886 --- /dev/null +++ b/var/spack/repos/builtin/packages/chombo/hdf5-16api.patch @@ -0,0 +1,12 @@ +*** lib/src/BoxTools/HDF5Portable.H 2017-05-02 13:57:57.000000000 -0700 +--- lib/src/BoxTools/HDF5Portable.H.patched 2017-05-02 13:55:30.000000000 -0700 +*************** +*** 15,20 **** +--- 15,21 ---- + extern "C" + { + #ifdef CH_USE_HDF5 ++ #define H5_USE_16_API + #include <hdf5.h> + #else + typedef long hid_t; diff --git a/var/spack/repos/builtin/packages/chombo/package.py b/var/spack/repos/builtin/packages/chombo/package.py new file mode 100644 index 0000000000..1ae50e6bc0 --- /dev/null +++ b/var/spack/repos/builtin/packages/chombo/package.py @@ -0,0 +1,140 @@ +############################################################################## +# 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 * +from shutil import copyfile +import glob + + +class Chombo(MakefilePackage): + """The Chombo package provides a set of tools for implementing finite + difference and finite-volume methods for the solution of partial + differential equations on block-structured adaptively refined + logically rectangular (i.e. Cartesian) grids.""" + + homepage = "https://commons.lbl.gov/display/chombo" + url = "http://bitbucket.org/drhansj/chombo-xsdk.git" + + # Use whatever path Brian V. and Terry L. agreed upon, but preserve version + version('3.2', git='http://bitbucket.org/drhansj/chombo-xsdk.git', commit='71d856c') + version('develop', git='http://bitbucket.org/drhansj/chombo-xsdk.git', tag='master') +# version('3.2', svn='https://anag-repo.lbl.gov/svn/Chombo/release/3.2') + + variant('mpi', default=True, description='Enable MPI parallel support') + variant('hdf5', default=True, description='Enable HDF5 support') + variant('dims', + default='3', + values=('1', '2', '3', '4', '5', '6'), + multi=False, + description='Number of PDE dimensions [1-6]' + ) + + patch('hdf5-16api.patch', when='@3.2', level=0) + patch('Make.defs.local.template.patch', when='@3.2', level=0) + + depends_on('blas') + depends_on('lapack') + depends_on('gmake', type='build') + depends_on('mpi', when='+mpi') + depends_on('hdf5', when='+hdf5') + depends_on('hdf5+mpi', when='+mpi+hdf5') + + def edit(self, spec, prefix): + + # Set fortran name mangling in Make.defs + defs_file = FileFilter('./lib/mk/Make.defs') + defs_file.filter('^\s*#\s*cppcallsfort\s*=\s*', + 'cppcallsfort = -DCH_FORT_UNDERSCORE') + + # Set remaining variables in Make.defs.local + # Make.defs.local.template.patch ensures lines for USE_TIMER, + # USE_LAPACK and lapackincflags are present + copyfile('./lib/mk/Make.defs.local.template', + './lib/mk/Make.defs.local') + + defs_file = FileFilter('./lib/mk/Make.defs.local') + + # Unconditional settings + defs_file.filter('^\s*#\s*DEBUG\s*=\s*', 'DEBUG = FALSE') + defs_file.filter('^\s*#\s*OPT\s*=\s*', 'OPT = TRUE') + defs_file.filter('^\s*#\s*PIC\s*=\s*', 'PIC = TRUE') + # timer code frequently fails compiles. So disable it. + defs_file.filter('^\s*#\s*USE_TIMER\s*=\s*', 'USE_TIMER = FALSE') + + # LAPACK setup + lapack_blas = spec['lapack'].libs + spec['blas'].libs + defs_file.filter('^\s*#\s*USE_LAPACK\s*=\s*', 'USE_LAPACK = TRUE') + defs_file.filter( + '^\s*#\s*lapackincflags\s*=\s*', + 'lapackincflags = -I%s' % spec['lapack'].prefix.include) + defs_file.filter( + '^\s*#\s*syslibflags\s*=\s*', + 'syslibflags = %s' % lapack_blas.ld_flags) + + # Compilers and Compiler flags + defs_file.filter('^\s*#\s*CXX\s*=\s*', 'CXX = %s' % spack_cxx) + defs_file.filter('^\s*#\s*FC\s*=\s*', 'FC = %s' % spack_fc) + if '+mpi' in spec: + defs_file.filter( + '^\s*#\s*MPICXX\s*=\s*', + 'MPICXX = %s' % self.spec['mpi'].mpicxx) + + # Conditionally determined settings + defs_file.filter( + '^\s*#\s*MPI\s*=\s*', + 'MPI = %s' % ('TRUE' if '+mpi' in spec else 'FALSE')) + defs_file.filter( + '^\s*#\s*DIM\s*=\s*', + 'DIM = %s' % spec.variants['dims'].value) + + # HDF5 settings + if '+hdf5' in spec: + defs_file.filter('^\s*#\s*USE_HDF5\s*=\s*', 'USE_HDF5 = TRUE') + defs_file.filter( + '^\s*#\s*HDFINCFLAGS\s*=.*', + 'HDFINCFLAGS = -I%s' % spec['hdf5'].prefix.include) + defs_file.filter( + '^\s*#\s*HDFLIBFLAGS\s*=.*', + 'HDFLIBFLAGS = %s' % spec['hdf5'].libs.ld_flags) + if '+mpi' in spec: + defs_file.filter( + '^\s*#\s*HDFMPIINCFLAGS\s*=.*', + 'HDFMPIINCFLAGS = -I%s' % spec['hdf5'].prefix.include) + defs_file.filter( + '^\s*#\s*HDFMPILIBFLAGS\s*=.*', + 'HDFMPILIBFLAGS = %s' % spec['hdf5'].libs.ld_flags) + + def build(self, spec, prefix): + with working_dir('lib'): + gmake('all') + + def install(self, spec, prefix): + with working_dir('lib'): + install_tree('include', prefix.include) + libfiles = glob.glob('lib*.a') + libfiles += glob.glob('lib*.so') + libfiles += glob.glob('lib*.dylib') + mkdirp(prefix.lib) + for lib in libfiles: + install(lib, prefix.lib) |