Update Package : ExodusII (#1504)

* Added support for the 'maxdims' and 'maxvars' flags for 'NetCDF'.

* Added the '+mpi' variant and improved dependencies for 'exodusii'.
Improved the 'exodusii' package so that it's less reliant on patches.

* Added better type checking to variant values in the 'netcdf' package.

* Corrected the required CMake version for the 'exodusii' package.

* Fixed the dependencies of the '+mpi' variant of the 'exodusii' package.
This commit is contained in:
Joseph Ciurej
2016-10-11 14:53:02 -07:00
committed by Todd Gamblin
parent 6dc8bbcb3a
commit 37d125b890
4 changed files with 66 additions and 41 deletions

View File

@@ -27,8 +27,8 @@
class Netcdf(Package):
"""NetCDF is a set of software libraries and self-describing,
machine-independent data formats that support the creation, access,
and sharing of array-oriented scientific data.
machine-independent data formats that support the creation, access,
and sharing of array-oriented scientific data.
"""
@@ -41,6 +41,13 @@ class Netcdf(Package):
variant('mpi', default=True, description='Enables MPI parallelism')
variant('hdf4', default=False, description='Enable HDF4 support')
# These variants control the number of dimensions (i.e. coordinates and
# attributes) and variables (e.g. time, entity ID, number of coordinates)
# that can be used in any particular NetCDF file.
variant('maxdims', default=1024,
description='Defines the maximum dimensions of NetCDF files.')
variant('maxvars', default=8192,
description='Defines the maximum variables of NetCDF files.')
depends_on("m4", type='build')
depends_on("hdf", when='+hdf4')
@@ -56,6 +63,20 @@ class Netcdf(Package):
# https://github.com/Unidata/netcdf-c/issues/250
depends_on('hdf5@:1.8', when='@:4.4.0')
def patch(self):
try:
max_dims = int(self.spec.variants['maxdims'].value)
max_vars = int(self.spec.variants['maxvars'].value)
except (ValueError, TypeError):
raise TypeError('NetCDF variant values max[dims|vars] must be '
'integer values.')
ff = FileFilter(join_path('include', 'netcdf.h'))
ff.filter(r'^(#define\s+NC_MAX_DIMS\s+)\d+(.*)$',
r'\1{0}\2'.format(max_dims))
ff.filter(r'^(#define\s+NC_MAX_VARS\s+)\d+(.*)$',
r'\1{0}\2'.format(max_vars))
def install(self, spec, prefix):
# Workaround until variant forwarding works properly
if '+mpi' in spec and spec.satisfies('^hdf5~mpi'):