diff options
author | Paul Henning <40867327+pjh40@users.noreply.github.com> | 2021-06-22 00:36:28 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-21 23:36:28 -0700 |
commit | 3039237a0e7cee898d85a33b13ed6d5ab712b3f3 (patch) | |
tree | e3cb7689eede8de705f744aac9f422f81f09b3fe | |
parent | 5e48d2c16fbec95b200c28a1c02110dbd4feb3f6 (diff) | |
download | spack-3039237a0e7cee898d85a33b13ed6d5ab712b3f3.tar.gz spack-3039237a0e7cee898d85a33b13ed6d5ab712b3f3.tar.bz2 spack-3039237a0e7cee898d85a33b13ed6d5ab712b3f3.tar.xz spack-3039237a0e7cee898d85a33b13ed6d5ab712b3f3.zip |
hdf5: fix compiler detection in flag_handler (#24451)
The original implementation of `flag_handler` searched the
`self.compiler.cc` string for `clang` or `gcc` in order to add a flag
for those compilers. This approach fails when using a spack-installed
compiler that was itself built with gcc or clang, as those strings will
appear in the fully-qualified compiler executable paths. This commit
switches to searching for `%gcc` or `%clang` in `self.spec`.
Co-authored-by: Paul Henning <phenning@lanl.gov>
-rw-r--r-- | var/spack/repos/builtin/packages/hdf5/package.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 6c80b78e0d..0aa7e5b730 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -185,7 +185,7 @@ class Hdf5(AutotoolsPackage): # Quiet warnings/errors about implicit declaration of functions in C99 if name == "cflags": - if "clang" in self.compiler.cc or "gcc" in self.compiler.cc: + if "%clang" in self.spec or "%gcc" in self.spec: flags.append("-Wno-implicit-function-declaration") return (None, None, flags) |