WRF: add the ability to compile with Intel. (#28382)

This commit is contained in:
Timothy Brown 2022-01-17 05:48:47 -07:00 committed by GitHub
parent 6add69d658
commit e17434b9e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,6 +287,22 @@ def do_configure_fixup(self):
)
ofh.write(line)
if self.spec.satisfies("@4.2 %intel"):
# In version 4.2 the file to be patched is called
# configure.defaults, while in earlier versions
# it's configure_new.defaults
rename(
"./arch/configure.defaults",
"./arch/configure.defaults.bak",
)
with open("./arch/configure.defaults.bak", "rt") as ifh:
with open("./arch/configure.defaults", "wt") as ofh:
for line in ifh:
if line.startswith("DM_"):
line = line.replace("mpif90", self.spec['mpi'].mpifc)
line = line.replace("mpicc", self.spec['mpi'].mpicc)
ofh.write(line)
def configure(self, spec, prefix):
# Remove broken default options...