summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/netcdf-c/package.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/netcdf-c/package.py b/var/spack/repos/builtin/packages/netcdf-c/package.py
index 3207163747..de3f8950cc 100644
--- a/var/spack/repos/builtin/packages/netcdf-c/package.py
+++ b/var/spack/repos/builtin/packages/netcdf-c/package.py
@@ -77,6 +77,7 @@ class NetcdfC(AutotoolsPackage):
variant("jna", default=False, description="Enable JNA support")
variant("fsync", default=False, description="Enable fsync support")
variant("zstd", default=True, description="Enable ZStandard compression", when="@4.9.0:")
+ variant("optimize", default=True, description="Enable -O2 for a more optimized lib")
# 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
@@ -161,6 +162,9 @@ class NetcdfC(AutotoolsPackage):
"--enable-netcdf-4",
]
+ if "+optimize" in self.spec:
+ cflags.append("-O2")
+
config_args.extend(self.enable_or_disable("fsync"))
# The flag was introduced in version 4.3.1
@@ -169,9 +173,7 @@ class NetcdfC(AutotoolsPackage):
config_args += self.enable_or_disable("shared")
- if "~shared" in self.spec or "+pic" in self.spec:
- # We don't have shared libraries but we still want it to be
- # possible to use this library in shared builds
+ if "+pic" in self.spec:
cflags.append(self.compiler.cc_pic_flag)
config_args += self.enable_or_disable("dap")