summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorSergey Kosukhin <sergey.kosukhin@mpimet.mpg.de>2021-04-07 18:49:16 +0200
committerGitHub <noreply@github.com>2021-04-07 09:49:16 -0700
commit253c0d0ebbab0fd27aa7e77f3360591ae8ef90cc (patch)
tree7a273709dcb553611595ec3f2f9851da93d29f0c /var
parentccc90e3a79353a7b83b9df437f6e2601a3060e36 (diff)
downloadspack-253c0d0ebbab0fd27aa7e77f3360591ae8ef90cc.tar.gz
spack-253c0d0ebbab0fd27aa7e77f3360591ae8ef90cc.tar.bz2
spack-253c0d0ebbab0fd27aa7e77f3360591ae8ef90cc.tar.xz
spack-253c0d0ebbab0fd27aa7e77f3360591ae8ef90cc.zip
hdf5: avoid compilation with -I/usr/include (#22808)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index 59e2f98600..60fe9dcdfa 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -6,6 +6,8 @@
import shutil
import sys
+from spack.util.environment import is_system_path
+
class Hdf5(AutotoolsPackage):
"""HDF5 is a data model, library, and file format for storing and managing
@@ -249,8 +251,14 @@ class Hdf5(AutotoolsPackage):
# combinations of other arguments. Enabling it just skips a
# sanity check in configure, so this doesn't merit a variant.
extra_args = ['--enable-unsupported',
- '--enable-symbols=yes',
- '--with-zlib=%s' % self.spec['zlib'].prefix]
+ '--enable-symbols=yes']
+
+ # Do not specify the prefix of zlib if it is in a system directory
+ # (see https://github.com/spack/spack/pull/21900).
+ zlib_prefix = self.spec['zlib'].prefix
+ extra_args.append('--with-zlib={0}'.format(
+ 'yes' if is_system_path(zlib_prefix) else zlib_prefix))
+
extra_args += self.enable_or_disable('threadsafe')
extra_args += self.enable_or_disable('cxx')
extra_args += self.enable_or_disable('hl')