From cc01e33d53499c0052887b79d26746cbb48a77c1 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Sat, 21 Jan 2023 04:27:13 -0500 Subject: 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. --- var/spack/repos/builtin/packages/fms/package.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/fms/package.py b/var/spack/repos/builtin/packages/fms/package.py index eeaa46d096..1b14765977 100644 --- a/var/spack/repos/builtin/packages/fms/package.py +++ b/var/spack/repos/builtin/packages/fms/package.py @@ -43,15 +43,20 @@ class Fms(CMakePackage): version( "2020.04.01", sha256="2c409242de7dea0cf29f8dbf7495698b6bcac1eeb5c4599a728bdea172ffe37c" ) - version( - "2019.01.03", sha256="60a5181e883e141f2fdd4a30c535a788d609bcbbbca4af7e1ec73f66f4e58dc0" - ) variant( - "64bit", - default=True, - description="Build a version of the library with default 64 bit reals", + "precision", + values=("32", "64"), + 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("openmp", default=True, description="Use OpenMP") variant("quad_precision", default=True, description="quad precision reals") @@ -80,13 +85,14 @@ class Fms(CMakePackage): def cmake_args(self): args = [ - self.define_from_variant("64BIT"), self.define_from_variant("GFS_PHYS"), self.define_from_variant("OPENMP"), self.define_from_variant("ENABLE_QUAD_PRECISION", "quad_precision"), self.define_from_variant("WITH_YAML", "yaml"), self.define_from_variant("CONSTANTS"), 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)) -- cgit v1.2.3-70-g09d2