summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorsebrowne <sebrown@sandia.gov>2021-05-14 00:59:43 -0600
committerGitHub <noreply@github.com>2021-05-14 08:59:43 +0200
commit19c7188cbf90ac68252162099b249a5eea5688cc (patch)
tree58c6bc3b0e4e35c1d15438e037b5529ec5a5fe20 /var
parentf47066967b844c0ace0ac1c9208a5c9ad9483d7b (diff)
downloadspack-19c7188cbf90ac68252162099b249a5eea5688cc.tar.gz
spack-19c7188cbf90ac68252162099b249a5eea5688cc.tar.bz2
spack-19c7188cbf90ac68252162099b249a5eea5688cc.tar.xz
spack-19c7188cbf90ac68252162099b249a5eea5688cc.zip
netcdf-c: refactor fsync variant (#23477)
Simplify logic by just enabling or disabling fsync as user specified (default to off currently). Also remove the 4.1 version check, since that version isn't actually supported in here. Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/netcdf-c/package.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/netcdf-c/package.py b/var/spack/repos/builtin/packages/netcdf-c/package.py
index 49c68122b2..f65e55eca0 100644
--- a/var/spack/repos/builtin/packages/netcdf-c/package.py
+++ b/var/spack/repos/builtin/packages/netcdf-c/package.py
@@ -67,7 +67,7 @@ class NetcdfC(AutotoolsPackage):
variant('shared', default=True, description='Enable shared library')
variant('dap', default=False, description='Enable DAP support')
variant('jna', default=False, description='Enable JNA support')
- variant('enable-fsync', default=False, description='Enable fsync support')
+ variant('fsync', default=False, description='Enable fsync support')
# It's unclear if cdmremote can be enabled if '--enable-netcdf-4' is passed
# to the configure script. Since netcdf-4 support is mandatory we comment
@@ -141,9 +141,7 @@ class NetcdfC(AutotoolsPackage):
'--enable-largefile',
'--enable-netcdf-4']
- # The flag was introduced in version 4.1.0
- if self.spec.satisfies('@4.1:'):
- config_args.append('--enable-fsync')
+ config_args.extend(self.enable_or_disable('fsync'))
# The flag was introduced in version 4.3.1
if self.spec.satisfies('@4.3.1:'):
@@ -189,12 +187,6 @@ class NetcdfC(AutotoolsPackage):
if hdf5_hl.satisfies('~shared'):
libs.append(hdf5_hl.libs.link_flags)
- if '+enable-fsync' in self.spec:
- # The flag was introduced in version 4.1.0. It was default
- # `on` until 4.3.0 when it now defaults to `off`.
- if self.spec.satisfies('@4.1:'):
- config_args.append('--enable-fsync')
-
if '+parallel-netcdf' in self.spec:
config_args.append('--enable-pnetcdf')
pnetcdf = self.spec['parallel-netcdf']