summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Lagoy <dustin.lagoy@gmail.com>2019-03-25 18:22:15 -0700
committerPeter Scheibel <scheibel1@llnl.gov>2019-03-25 20:22:15 -0500
commit14acfb65c4c045b8db4252fe98c13a47ccba42b5 (patch)
treec2c21272db0c1833f23e5a186cf463c601cfc9db
parent57523c3f0b1309fe355f1675b00f0bd0ab584e88 (diff)
downloadspack-14acfb65c4c045b8db4252fe98c13a47ccba42b5.tar.gz
spack-14acfb65c4c045b8db4252fe98c13a47ccba42b5.tar.bz2
spack-14acfb65c4c045b8db4252fe98c13a47ccba42b5.tar.xz
spack-14acfb65c4c045b8db4252fe98c13a47ccba42b5.zip
netcdf-cxx package: Add optional netCDF4 support (#10899)
-rw-r--r--var/spack/repos/builtin/packages/netcdf-cxx/package.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/netcdf-cxx/package.py b/var/spack/repos/builtin/packages/netcdf-cxx/package.py
index d45ef4bf2b..10353df52c 100644
--- a/var/spack/repos/builtin/packages/netcdf-cxx/package.py
+++ b/var/spack/repos/builtin/packages/netcdf-cxx/package.py
@@ -19,9 +19,20 @@ class NetcdfCxx(AutotoolsPackage):
depends_on('netcdf')
+ variant(
+ 'netcdf4', default=True, description='Compile with netCDF4 support')
+
@property
def libs(self):
shared = True
return find_libraries(
'libnetcdf_c++', root=self.prefix, shared=shared, recursive=True
)
+
+ def configure_args(self):
+ args = []
+ if '+netcdf4' in self.spec:
+ # There is no clear way to set this via configure, so set the flag
+ # explicitly
+ args.append('CPPFLAGS=-DUSE_NETCDF4')
+ return args