summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Lagoy <dustin.lagoy@gmail.com>2019-03-25 18:03:02 -0700
committerPeter Scheibel <scheibel1@llnl.gov>2019-03-25 20:03:02 -0500
commit4c68d2e14e29705d426c803a9f0ce16a22473dd3 (patch)
treeffb14e260d2f6535afbb4042dd3c734a06163377
parentc124b1f47142be406834ff80a4ddb43007818b84 (diff)
downloadspack-4c68d2e14e29705d426c803a9f0ce16a22473dd3.tar.gz
spack-4c68d2e14e29705d426c803a9f0ce16a22473dd3.tar.bz2
spack-4c68d2e14e29705d426c803a9f0ce16a22473dd3.tar.xz
spack-4c68d2e14e29705d426c803a9f0ce16a22473dd3.zip
py-netcdf4: avoid using system installs of dependencies (#10885)
Use environment variables to point setup.py to Spack installations of hdf5/netcdf
-rw-r--r--var/spack/repos/builtin/packages/py-netcdf4/package.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-netcdf4/package.py b/var/spack/repos/builtin/packages/py-netcdf4/package.py
index d89a73b331..7409e6dafb 100644
--- a/var/spack/repos/builtin/packages/py-netcdf4/package.py
+++ b/var/spack/repos/builtin/packages/py-netcdf4/package.py
@@ -23,3 +23,13 @@ class PyNetcdf4(PythonPackage):
depends_on('netcdf')
depends_on('hdf5@1.8.0:')
+
+ def setup_environment(self, spack_env, run_env):
+ """Ensure installed netcdf and hdf5 libraries are used"""
+ # Explicitly set these variables so setup.py won't erroneously pick up
+ # system versions
+ spack_env.set('USE_SETUPCFG', '0')
+ spack_env.set('HDF5_INCDIR', self.spec['hdf5'].prefix.include)
+ spack_env.set('HDF5_LIBDIR', self.spec['hdf5'].prefix.lib)
+ spack_env.set('NETCDF4_INCDIR', self.spec['netcdf'].prefix.include)
+ spack_env.set('NETCDF4_LIBDIR', self.spec['netcdf'].prefix.lib)