WRF 4.5.2 support is added for AOCC compilers (#44584)

Co-authored-by: Raviteja K <rkuppili@amd.com>
This commit is contained in:
AMD Toolchain Support 2024-06-12 07:15:08 +05:30 committed by GitHub
parent e11f83f34b
commit fc2ee5cae8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,6 +70,11 @@ class Wrf(Package):
maintainers("MichaelLaufer", "ptooley") maintainers("MichaelLaufer", "ptooley")
tags = ["windows"] tags = ["windows"]
version(
"4.5.2",
sha256="408ba6aa60d9cd51d6bad2fa075a3d37000eb581b5d124162885b049c892bbdc",
url="https://github.com/wrf-model/WRF/releases/download/v4.5.2/v4.5.2.tar.gz",
)
version( version(
"4.5.1", "4.5.1",
sha256="9d557c34c105db4d41e727843ecb19199233c7cf82c5369b34a2ce8efe65e2d1", sha256="9d557c34c105db4d41e727843ecb19199233c7cf82c5369b34a2ce8efe65e2d1",
@ -159,13 +164,13 @@ class Wrf(Package):
patch("patches/4.0/tirpc_detect.patch", when="@4.0") patch("patches/4.0/tirpc_detect.patch", when="@4.0")
patch("patches/4.0/add_aarch64.patch", when="@4.0") patch("patches/4.0/add_aarch64.patch", when="@4.0")
patch("patches/4.2/arch.Config.pl.patch", when="@4.2:") patch("patches/4.2/arch.Config.pl.patch", when="@4.2:4.5.1")
patch("patches/4.2/arch.configure.defaults.patch", when="@=4.2") patch("patches/4.2/arch.configure.defaults.patch", when="@=4.2")
patch("patches/4.2/4.2.2_arch.configure.defaults.patch", when="@4.2.2") patch("patches/4.2/4.2.2_arch.configure.defaults.patch", when="@4.2.2")
patch("patches/4.2/arch.conf_tokens.patch", when="@4.2:") patch("patches/4.2/arch.conf_tokens.patch", when="@4.2:")
patch("patches/4.2/arch.postamble.patch", when="@4.2") patch("patches/4.2/arch.postamble.patch", when="@4.2")
patch("patches/4.2/configure.patch", when="@4.2:4.3.3") patch("patches/4.2/configure.patch", when="@4.2:4.3.3")
patch("patches/4.2/external.io_netcdf.makefile.patch", when="@4.2:") patch("patches/4.2/external.io_netcdf.makefile.patch", when="@4.2:4.5.1")
patch("patches/4.2/var.gen_be.Makefile.patch", when="@4.2:") patch("patches/4.2/var.gen_be.Makefile.patch", when="@4.2:")
patch("patches/4.2/Makefile.patch", when="@4.2") patch("patches/4.2/Makefile.patch", when="@4.2")
patch("patches/4.2/tirpc_detect.patch", when="@4.2") patch("patches/4.2/tirpc_detect.patch", when="@4.2")
@ -173,7 +178,7 @@ class Wrf(Package):
patch("patches/4.2/add_aarch64_acfl.patch", when="@4.2:4.3.1 %arm target=aarch64:") patch("patches/4.2/add_aarch64_acfl.patch", when="@4.2:4.3.1 %arm target=aarch64:")
patch("patches/4.2/configure_aocc_2.3.patch", when="@4.2 %aocc@:2.4.0") patch("patches/4.2/configure_aocc_2.3.patch", when="@4.2 %aocc@:2.4.0")
patch("patches/4.2/configure_aocc_3.0.patch", when="@4.2 %aocc@3.0.0:3.2.0") patch("patches/4.2/configure_aocc_3.0.patch", when="@4.2 %aocc@3.0.0:3.2.0")
patch("patches/4.2/hdf5_fix.patch", when="@4.2: %aocc") patch("patches/4.2/hdf5_fix.patch", when="@4.2:4.5.1 %aocc")
patch("patches/4.2/derf_fix.patch", when="@=4.2 %aocc") patch("patches/4.2/derf_fix.patch", when="@=4.2 %aocc")
patch( patch(
"patches/4.2/add_tools_flags_acfl2304.patch", "patches/4.2/add_tools_flags_acfl2304.patch",
@ -183,7 +188,7 @@ class Wrf(Package):
patch("patches/4.3/add_aarch64.patch", when="@4.3.2:4.4.2 %gcc target=aarch64:") patch("patches/4.3/add_aarch64.patch", when="@4.3.2:4.4.2 %gcc target=aarch64:")
patch("patches/4.3/add_aarch64_acfl.patch", when="@4.3.2:4.4.2 %arm target=aarch64:") patch("patches/4.3/add_aarch64_acfl.patch", when="@4.3.2:4.4.2 %arm target=aarch64:")
patch("patches/4.4/arch.postamble.patch", when="@4.4:") patch("patches/4.4/arch.postamble.patch", when="@4.4:4.5.1")
patch("patches/4.4/configure.patch", when="@4.4:4.4.2") patch("patches/4.4/configure.patch", when="@4.4:4.4.2")
patch("patches/4.4/ifx.patch", when="@4.4: %oneapi") patch("patches/4.4/ifx.patch", when="@4.4: %oneapi")
@ -200,7 +205,7 @@ class Wrf(Package):
) )
patch("patches/4.2/configure_fujitsu.patch", when="@4 %fj") patch("patches/4.2/configure_fujitsu.patch", when="@4 %fj")
patch("patches/4.3/Makefile.patch", when="@4.3:") patch("patches/4.3/Makefile.patch", when="@4.3:4.5.1")
patch("patches/4.3/arch.postamble.patch", when="@4.3:4.3.3") patch("patches/4.3/arch.postamble.patch", when="@4.3:4.3.3")
patch("patches/4.3/fujitsu.patch", when="@4.3: %fj") patch("patches/4.3/fujitsu.patch", when="@4.3: %fj")
# Syntax errors in physics routines # Syntax errors in physics routines
@ -259,7 +264,13 @@ def setup_run_environment(self, env):
env.append_path("PATH", self.prefix.tools) env.append_path("PATH", self.prefix.tools)
def setup_build_environment(self, env): def setup_build_environment(self, env):
env.set("NETCDF", self.spec["netcdf-c"].prefix) # From 4.5.2 the split-netcdf patches are not needed,
# just tell the build system where netcdf and netcdf-c are:
if self.spec.satisfies("@4.5.2:"):
env.set("NETCDF", self.spec["netcdf-fortran"].prefix)
env.set("NETCDF_C", self.spec["netcdf-c"].prefix)
else:
env.set("NETCDF", self.spec["netcdf-c"].prefix)
if "+pnetcdf" in self.spec: if "+pnetcdf" in self.spec:
env.set("PNETCDF", self.spec["parallel-netcdf"].prefix) env.set("PNETCDF", self.spec["parallel-netcdf"].prefix)
# Add WRF-Chem module # Add WRF-Chem module
@ -381,6 +392,9 @@ def do_configure_fixup(self):
config.filter("^DM_FC.*mpif90", "DM_FC = {0}".format(self.spec["mpi"].mpifc)) config.filter("^DM_FC.*mpif90", "DM_FC = {0}".format(self.spec["mpi"].mpifc))
config.filter("^DM_CC.*mpicc", "DM_CC = {0}".format(self.spec["mpi"].mpicc)) config.filter("^DM_CC.*mpicc", "DM_CC = {0}".format(self.spec["mpi"].mpicc))
if self.spec.satisfies("@:4.0.3 %intel@2018:"):
config.filter(r"-openmp", "-qopenmp")
@run_before("configure") @run_before("configure")
def fortran_check(self): def fortran_check(self):
if not self.compiler.fc: if not self.compiler.fc: