Skip to content

Commit

Permalink
Update package.py (v5.0.0) (NOAA-EMC#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA authored Jan 25, 2024
1 parent 5aa4807 commit 13d948f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions spack/package.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
Expand All @@ -18,8 +18,11 @@ class Ip(CMakePackage):
maintainers("AlexanderRichert-NOAA", "edwardhartnett", "Hang-Lei-NOAA")

version("develop", branch="develop")
version("5.0.0", sha256="54b2987bd4f94adc1f7595d2a384e646019c22d163bcd30840a916a6abd7df71")
version("4.4.0", sha256="858d9201ce0bc4d16b83581ef94a4a0262f498ed1ea1b0535de2e575da7a8b8c")
version("4.3.0", sha256="799308a868dea889d2527d96a0405af7b376869581410fe4cff681205e9212b4")
# Note that versions 4.0-4.2 contain constants_mod module, and should not be used when
# also compiling with packages containing Fortran modules of the same name, namely, FMS.
version("4.2.0", sha256="9b9f47106822044ff224c6dfd9f140c146dffc833904f2a0c5db7b5d8932e39e")
version("4.1.0", sha256="b83ca037d9a5ad3eb0fb1acfe665c38b51e01f6bd73ce9fb8bb2a14f5f63cdbe")
version("4.0.0", sha256="a2ef0cc4e4012f9cb0389fab6097407f4c623eb49772d96eb80c44f804aa86b8")
Expand All @@ -34,16 +37,16 @@ class Ip(CMakePackage):
variant("shared", default=False, description="Build shared library", when="@4.1:")
variant(
"precision",
default=["4", "d"],
values=["4", "d"],
default=("4", "d"),
values=("4", "d"),
multi=True,
description="Set precision (_4/_d library versions)",
when="@4.1:",
when="@4.1",
)
variant(
"precision",
default=["4", "d"],
values=["4", "d", "8"],
default=("4", "d"),
values=("4", "d", "8"),
multi=True,
description="Set precision (_4/_d/_8 library versions)",
when="@4.2:",
Expand All @@ -55,6 +58,8 @@ class Ip(CMakePackage):
when="@5.0:",
)

conflicts("+shared ~pic")

depends_on("sp", when="@:4")
depends_on("sp@:2.3.3", when="@:4.0")
depends_on("sp precision=4", when="@4.1:4 precision=4")
Expand All @@ -69,6 +74,8 @@ def cmake_args(self):

if self.spec.satisfies("@4:"):
args.append(self.define("BUILD_TESTING", self.run_tests))
else:
args.append(self.define("ENABLE_TESTS", "NO"))

if self.spec.satisfies("@4.1:"):
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
Expand Down Expand Up @@ -97,6 +104,7 @@ def setup_run_environment(self, env):
env.set("IP_LIB" + suffix, lib[0])
env.set("IP_INC" + suffix, join_path(self.prefix, "include_" + suffix))

@when("@4:")
def check(self):
with working_dir(self.builder.build_directory):
make("test")

0 comments on commit 13d948f

Please sign in to comment.