fms: add 32bit variant, add protections (#35010)

The GEOS Earth System Model currently requires the 32-bit variant of FMS. This PR adds that variant.
This commit is contained in:
Matthew Thompson 2023-01-21 04:27:13 -05:00 committed by GitHub
parent c3e3c392a6
commit cc01e33d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,15 +43,20 @@ class Fms(CMakePackage):
version( version(
"2020.04.01", sha256="2c409242de7dea0cf29f8dbf7495698b6bcac1eeb5c4599a728bdea172ffe37c" "2020.04.01", sha256="2c409242de7dea0cf29f8dbf7495698b6bcac1eeb5c4599a728bdea172ffe37c"
) )
version(
"2019.01.03", sha256="60a5181e883e141f2fdd4a30c535a788d609bcbbbca4af7e1ec73f66f4e58dc0"
)
variant( variant(
"64bit", "precision",
default=True, values=("32", "64"),
description="Build a version of the library with default 64 bit reals", description="Build a version of the library with default 32 or 64 bit reals or both",
default="32",
multi=True,
) )
conflicts(
"precision=32,64",
when="@:2022.03",
msg="FMS versions prior to 2022.04 do not support both 32 and 64 bit precision",
)
variant("gfs_phys", default=True, description="Use GFS Physics") variant("gfs_phys", default=True, description="Use GFS Physics")
variant("openmp", default=True, description="Use OpenMP") variant("openmp", default=True, description="Use OpenMP")
variant("quad_precision", default=True, description="quad precision reals") variant("quad_precision", default=True, description="quad precision reals")
@ -80,13 +85,14 @@ class Fms(CMakePackage):
def cmake_args(self): def cmake_args(self):
args = [ args = [
self.define_from_variant("64BIT"),
self.define_from_variant("GFS_PHYS"), self.define_from_variant("GFS_PHYS"),
self.define_from_variant("OPENMP"), self.define_from_variant("OPENMP"),
self.define_from_variant("ENABLE_QUAD_PRECISION", "quad_precision"), self.define_from_variant("ENABLE_QUAD_PRECISION", "quad_precision"),
self.define_from_variant("WITH_YAML", "yaml"), self.define_from_variant("WITH_YAML", "yaml"),
self.define_from_variant("CONSTANTS"), self.define_from_variant("CONSTANTS"),
self.define_from_variant("FPIC"), self.define_from_variant("FPIC"),
self.define("32BIT", "precision=32" in self.spec),
self.define("64BIT", "precision=64" in self.spec),
] ]
args.append(self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc)) args.append(self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc))