From f7170e045f4395dd1baad9a4e66f8ceb45b172cb Mon Sep 17 00:00:00 2001 From: Harshula Jayasuriya Date: Mon, 4 Mar 2024 01:33:55 +1100 Subject: [PATCH] mom5: add new variant "type" * "type" will have options ACCESS-CM, ACCESS-OM, ACCESS-ESM, ACCESS-OM-BGC and MOM_solo. --- packages/mom5/package.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mom5/package.py b/packages/mom5/package.py index 961f143..b56777b 100644 --- a/packages/mom5/package.py +++ b/packages/mom5/package.py @@ -19,6 +19,7 @@ class Mom5(MakefilePackage): version("master", branch="master") variant("deterministic", default=False, description="Deterministic build.") + variant("type", default="ACCESS-OM", description="Build MOM5 to support a particular use case.", values=("ACCESS-CM", "ACCESS-ESM", "ACCESS-OM", "ACCESS-OM-BGC", "MOM_solo"), multi=False) variant("optimisation_report", default=False, description="Generate optimisation reports.") # Depend on virtual package "mpi". @@ -34,7 +35,6 @@ class Mom5(MakefilePackage): phases = ["edit", "build", "install"] _platform = "spack" - _mom_type = "ACCESS-OM" def url_for_version(self, version): return "https://github.com/ACCESS-NRI/mom5/tarball/{0}".format(version) @@ -317,7 +317,7 @@ def build(self, spec, prefix): # embedded in the binary. build( "--type", - self._mom_type, + self.spec.variants["type"].value, "--platform", self._platform, "--no_environ", @@ -331,8 +331,8 @@ def install(self, spec, prefix): join_path( "exec", self._platform, - self._mom_type, - "fms_" + self._mom_type + ".x" + self.spec.variants["type"].value, + "fms_" + self.spec.variants["type"].value + ".x" ), prefix.bin )