diff options
author | Olivier Cessenat <cessenat@gmail.com> | 2021-05-03 14:57:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-03 08:57:27 -0400 |
commit | f62b8077ab67557780da0d39c581e8bc8d49c324 (patch) | |
tree | f30573d7bcd8167efb4d233c55d1f08c5d560f19 | |
parent | 76578af912d217f774b9f9fc23da485c0b7c2b02 (diff) | |
download | spack-f62b8077ab67557780da0d39c581e8bc8d49c324.tar.gz spack-f62b8077ab67557780da0d39c581e8bc8d49c324.tar.bz2 spack-f62b8077ab67557780da0d39c581e8bc8d49c324.tar.xz spack-f62b8077ab67557780da0d39c581e8bc8d49c324.zip |
silo: fix zlib when using system external (#23392)
-rw-r--r-- | var/spack/repos/builtin/packages/silo/package.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/silo/package.py b/var/spack/repos/builtin/packages/silo/package.py index 9fc9ac020b..dd699d4c63 100644 --- a/var/spack/repos/builtin/packages/silo/package.py +++ b/var/spack/repos/builtin/packages/silo/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * +from spack.util.environment import is_system_path class Silo(AutotoolsPackage): @@ -97,19 +98,28 @@ class Silo(AutotoolsPackage): def configure_args(self): spec = self.spec config_args = [ - '--with-zlib=%s,%s' % (spec['zlib'].prefix.include, - spec['zlib'].prefix.lib), '--enable-install-lite-headers', '--enable-fortran' if '+fortran' in spec else '--disable-fortran', '--enable-silex' if '+silex' in spec else '--disable-silex', '--enable-shared' if '+shared' in spec else '--disable-shared', ] + # 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 + if is_system_path(zlib_prefix): + config_args.append('--with-zlib=yes') + else: + config_args.append( + '--with-zlib=%s,%s' % (zlib_prefix.include, + zlib_prefix.lib), + ) + if '+hdf5' in spec: - config_args.extend([ + config_args.append( '--with-hdf5=%s,%s' % (spec['hdf5'].prefix.include, spec['hdf5'].prefix.lib), - ]) + ) if '+silex' in spec: x = spec['libx11'] |