summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/wrf/package.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/wrf/package.py b/var/spack/repos/builtin/packages/wrf/package.py
index f197d9b956..1318a4367d 100644
--- a/var/spack/repos/builtin/packages/wrf/package.py
+++ b/var/spack/repos/builtin/packages/wrf/package.py
@@ -229,7 +229,10 @@ class Wrf(Package):
env.set("JASPERINC", self.spec["jasper"].prefix.include)
env.set("JASPERLIB", self.spec["jasper"].prefix.lib)
- if self.spec.satisfies("%gcc@10:"):
+ # These flags should be used also in v3, but FCFLAGS/FFLAGS aren't used
+ # consistently in that version of WRF, so we have to force them through
+ # `flag_handler` below.
+ if self.spec.satisfies("@4.0: %gcc@10:"):
args = "-w -O2 -fallow-argument-mismatch -fallow-invalid-boz"
env.set("FCFLAGS", args)
env.set("FFLAGS", args)
@@ -239,6 +242,13 @@ class Wrf(Package):
env.set("HDF5", self.spec["hdf5"].prefix)
env.prepend_path("PATH", ancestor(self.compiler.cc))
+ def flag_handler(self, name, flags):
+ # Same flags as FCFLAGS/FFLAGS above, but forced through the compiler
+ # wrapper when compiling v3.9.1.1.
+ if self.spec.satisfies("@3.9.1.1 %gcc@10:") and name == "fflags":
+ flags.extend(["-w", "-O2", "-fallow-argument-mismatch", "-fallow-invalid-boz"])
+ return (flags, None, None)
+
def patch(self):
# Let's not assume csh is intalled in bin
files = glob.glob("*.csh")