From 253c0d0ebbab0fd27aa7e77f3360591ae8ef90cc Mon Sep 17 00:00:00 2001 From: Sergey Kosukhin Date: Wed, 7 Apr 2021 18:49:16 +0200 Subject: hdf5: avoid compilation with -I/usr/include (#22808) --- var/spack/repos/builtin/packages/hdf5/package.py | 12 ++++++++++-- 1 file 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') -- cgit v1.2.3-70-g09d2