diff options
author | Sergey Kosukhin <sergey.kosukhin@mpimet.mpg.de> | 2023-05-05 09:37:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 09:37:12 +0200 |
commit | 85730de05559f5aabf56e15f1b4062f593d441af (patch) | |
tree | bf61c321725fb07c2a0ef10901f21051ec743d0a /var | |
parent | bc88b581b48a11928d370e18138a4198f96b13af (diff) | |
download | spack-85730de05559f5aabf56e15f1b4062f593d441af.tar.gz spack-85730de05559f5aabf56e15f1b4062f593d441af.tar.bz2 spack-85730de05559f5aabf56e15f1b4062f593d441af.tar.xz spack-85730de05559f5aabf56e15f1b4062f593d441af.zip |
mpich: avoid '-fallow-argument-mismatch' in the compiler wrappers (#33323)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/mpich/package.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 33c17f60d8..b8d05a4840 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -380,22 +380,24 @@ with '-Wl,-commons,use_dylibs' and without results.append(" ".join(variants)) return results + def flag_handler(self, name, flags): + if name == "fflags": + # https://bugzilla.redhat.com/show_bug.cgi?id=1795817 + # https://github.com/spack/spack/issues/17934 + # TODO: we should add the flag depending on the real Fortran compiler spec and not the + # toolchain spec, which might be mixed. + if any(self.spec.satisfies(s) for s in ["%gcc@10:", "%apple-clang@11:", "%clang@11:"]): + # Note that the flag is not needed to build the package starting version 4.1 + # (see https://github.com/pmodels/mpich/pull/5840) but we keep adding the flag here + # to avoid its presence in the MPI compiler wrappers. + flags.append("-fallow-argument-mismatch") + + return flags, None, None + def setup_build_environment(self, env): env.unset("F90") env.unset("F90FLAGS") - # https://bugzilla.redhat.com/show_bug.cgi?id=1795817 - if self.spec.satisfies("%gcc@10:"): - env.set("FFLAGS", "-fallow-argument-mismatch") - env.set("FCFLAGS", "-fallow-argument-mismatch") - # Same fix but for macOS - avoids issue #17934 - if self.spec.satisfies("%apple-clang@11:"): - env.set("FFLAGS", "-fallow-argument-mismatch") - env.set("FCFLAGS", "-fallow-argument-mismatch") - if self.spec.satisfies("%clang@11:"): - env.set("FFLAGS", "-fallow-argument-mismatch") - env.set("FCFLAGS", "-fallow-argument-mismatch") - if "pmi=cray" in self.spec: env.set("CRAY_PMI_INCLUDE_OPTS", "-I" + self.spec["cray-pmi"].headers.directories[0]) env.set("CRAY_PMI_POST_LINK_OPTS", "-L" + self.spec["cray-pmi"].libs.directories[0]) |