wrf: Fix patching of config file when using GCC for v3.9.1.1 (#35140)

The regex doesn't actually work because dollar signs and parentheses have to be
escaped.  Also, compiling with OpenMPI requires defining the macro
`MPI2SUPPORT`.
This commit is contained in:
Mosè Giordano 2023-01-26 10:59:54 +00:00 committed by GitHub
parent 84917cfa79
commit eeba92e788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,10 +287,16 @@ def do_configure_fixup(self):
config = FileFilter(join_path("arch", "configure.defaults"))
if self.spec.satisfies("@3.9.1.1 %gcc"):
# Compiling with OpenMPI requires using `-DMPI2SUPPORT`.
other_flags = " -DMPI2SUPPORT" if self.spec.satisfies("^openmpi") else ""
config.filter(
"^DM_FC.*mpif90 -f90=$(SFC)", "DM_FC = {0}".format(self.spec["mpi"].mpifc)
r"^DM_FC.*mpif90 -f90=\$\(SFC\)",
"DM_FC = {0}".format(self.spec["mpi"].mpifc) + other_flags,
)
config.filter(
r"^DM_CC.*mpicc -cc=\$\(SCC\)",
"DM_CC = {0}".format(self.spec["mpi"].mpicc) + other_flags,
)
config.filter("^DM_CC.*mpicc -cc=$(SCC)", "DM_CC = {0}".format(self.spec["mpi"].mpicc))
if self.spec.satisfies("%aocc"):
config.filter(