Add variants for overriding ESMF_OS and ESMF_COMM for ESMF package (#34808)

* Add variants for overriding ESMF_OS and ESMF_COMM for ESMF package

* Add doco for esmf_os/esmf_comm variants
This commit is contained in:
Alex Richert 2023-01-10 05:04:16 -08:00 committed by GitHub
parent 006969a8cd
commit cc333b600c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,11 @@ class Esmf(MakefilePackage):
)
variant("debug", default=False, description="Make a debuggable version of the library")
variant("shared", default=True, description="Build shared library")
# 'esmf_comm' and 'esmf_os' variants allow override values for their corresponding
# build environment variables. Documentation, including valid values, can be found at
# https://earthsystemmodeling.org/docs/release/latest/ESMF_usrdoc/node10.html#SECTION000105000000000000000
variant("esmf_comm", default="auto", description="Override for ESMF_COMM variable")
variant("esmf_os", default="auto", description="Override for ESMF_OS variable")
# Required dependencies
depends_on("zlib")
@ -251,6 +256,11 @@ def edit(self, spec, prefix):
if self.compiler.name == "cce" or "^cray-mpich" in self.spec:
os.environ["ESMF_OS"] = "Unicos"
# Allow override of ESMF_OS:
os_variant = spec.variants["esmf_os"].value
if os_variant != "auto":
os.environ["ESMF_OS"] = os_variant
#######
# MPI #
#######
@ -284,6 +294,11 @@ def edit(self, spec, prefix):
# Force use of the single-processor MPI-bypass library.
os.environ["ESMF_COMM"] = "mpiuni"
# Allow override of ESMF_COMM:
comm_variant = spec.variants["esmf_comm"].value
if comm_variant != "auto":
os.environ["ESMF_COMM"] = comm_variant
##########
# LAPACK #
##########