netcdf-cxx package: set ldflags for hdf5 and netcdf (#11026)

Ensure that netcdf-cxx uses the Spack-installed hdf5 and netcdf4
rather than system-installed versions.
This commit is contained in:
Dustin Lagoy 2019-04-02 17:04:09 -07:00 committed by Peter Scheibel
parent bc4c372ebd
commit 229ed5c228

View File

@ -35,4 +35,11 @@ def configure_args(self):
# There is no clear way to set this via configure, so set the flag
# explicitly
args.append('CPPFLAGS=-DUSE_NETCDF4')
# Add these to LDFLAGS explicitly, so the linker doesn't accidentally
# use system versions
ldflags = [
self.spec['netcdf'].libs.search_flags,
self.spec['hdf5'].libs.search_flags,
]
args.append('LDFLAGS=' + ' '.join(ldflags))
return args