summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sjaardema <gsjaardema@gmail.com>2020-03-27 20:55:04 -0600
committerGitHub <noreply@github.com>2020-03-27 21:55:04 -0500
commit6e49f5f0e57c827a49737c0df18d50ba1a7cd866 (patch)
treedb57b899d924447dee78e1c2fd95de3e4d6c2568
parentf6f5604927aeb7cc2fd96d8e441b22bb706d990d (diff)
downloadspack-6e49f5f0e57c827a49737c0df18d50ba1a7cd866.tar.gz
spack-6e49f5f0e57c827a49737c0df18d50ba1a7cd866.tar.bz2
spack-6e49f5f0e57c827a49737c0df18d50ba1a7cd866.tar.xz
spack-6e49f5f0e57c827a49737c0df18d50ba1a7cd866.zip
netcdf-c: remove maxdims and maxvars variant (#15524)
* NETCDF: Remove maxdims maxvars variant I'm not sure of the correct protocol to do this, so decided to make a stab and hopefully it works or I'm told the correct way... The `maxdims` and `maxvars` variants for the NetCDF package were, to the best of my knowledge, only ever used for the Exodus library in the SEACAS package. In versions of NetCDF prior to 4.4.0, Exodus required that the `NC_MAX_DIMS` and `NC_MAX_VARS` be increased over the default values. This requirement was removed in 4.4.0 and later. I do not know of any way to make a variant depend on the version and since the `maxdims` and `maxvars` variants are integer values and not boolean, then every build of NetCDF will have these variants. Typically `maxdims=1024 maxvars=8192` and the build will patch the `netcdf.h` include file for every build even though it is (almost) never needed. The SEACAS package has a NetCDF version requirement of >4.6.2, so it no longer specifies the `maxdims` or `maxvars` variant and I could find no other package in spack that uses this variant either, so removal should not break anything *in* spack. However, there is no guarantee that some other external package doesn't use the variant, so I'm not sure of the correct way to remove the variant. For this PR, I simply removed the variants. If there is a way to specify use of the variant tied to a specific version, I couldn't find it anywhere... * Address review comment Removed `is_integral` and `import numbers` since `is_integral` was only place it was used. * Add blank line for flake8
-rw-r--r--var/spack/repos/builtin/packages/netcdf-c/package.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/var/spack/repos/builtin/packages/netcdf-c/package.py b/var/spack/repos/builtin/packages/netcdf-c/package.py
index 01f2acf425..e7ce1696a8 100644
--- a/var/spack/repos/builtin/packages/netcdf-c/package.py
+++ b/var/spack/repos/builtin/packages/netcdf-c/package.py
@@ -5,16 +5,6 @@
from spack import *
-import numbers
-
-
-def is_integral(x):
- """Any integer value"""
- try:
- return isinstance(int(x), numbers.Integral) and not isinstance(x, bool)
- except ValueError:
- return False
-
class NetcdfC(AutotoolsPackage):
"""NetCDF (network Common Data Form) is a set of software libraries and
@@ -76,22 +66,6 @@ class NetcdfC(AutotoolsPackage):
# variant('cdmremote', default=False,
# description='Enable CDM Remote 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.',
- values=is_integral
- )
- variant(
- 'maxvars',
- default=8192,
- description='Defines the maximum variables of NetCDF files.',
- values=is_integral
- )
-
# The patch for 4.7.0 touches configure.ac. See force_autoreconf below.
depends_on('autoconf', type='build', when='@4.7.0')
depends_on('automake', type='build', when='@4.7.0')
@@ -157,20 +131,6 @@ class NetcdfC(AutotoolsPackage):
# The patch for 4.7.0 touches configure.ac.
return self.spec.satisfies('@4.7.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 configure_args(self):
cflags = []
cppflags = []