Skip to content

Commit 37965a7

Browse files
authored
CRTM: add version 3.1.3 and logic to run minimal ctests (#39)
1. Add crtm@3.1.3 2. Add logic to run a basic test as part of spack install --test=root crtm; running other tests requires fixing crtm-fix: added logic to move all fixed files into flat directory structure incompatible with crtm package spack-stack#1910 (after spack-stack-2.1.0) I plan to keep these changes in our fork/branch of spack-packages until JCSDA/spack-stack#1910 is resolved and crtm@3.2.0 is released and added. Version 3.1.3 is a patch release specifically created for us for testing with ifx.
1 parent a9e95ea commit 37965a7

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

repos/spack_repo/builtin/packages/crtm/package.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Crtm(CMakePackage):
3131

3232
license("CC0-1.0")
3333

34+
version("3.1.3", sha256="4f72bb281d266063c902caa6613e508d6d80367c10ee4881dd67e08c146c9c33")
3435
version("3.1.2", sha256="a96598e5611c263fa80d6d6375a12d70d74389b261a8070515a6698e41563281")
3536
version(
3637
"3.1.1-build1", sha256="1ed49e594da5d3769cbaa52cc7fc19c1bb0325ee6324f6057227c31e2d95ca67"
@@ -76,7 +77,8 @@ class Crtm(CMakePackage):
7677
depends_on("fortran", type="build")
7778

7879
depends_on("cmake@3.15:", type="build")
79-
depends_on("git-lfs")
80+
depends_on("cmake@3.20:", when="@3.1.3:", type="build")
81+
depends_on("git-lfs", when="@:3.1.2")
8082
depends_on("netcdf-fortran", when="@2.4.0:")
8183
depends_on("netcdf-fortran", when="@v2.3")
8284
depends_on("netcdf-fortran", when="@v2.4")
@@ -87,6 +89,8 @@ class Crtm(CMakePackage):
8789
depends_on("crtm-fix@2.4.0.1_emc", when="@2.4.0.1 +fix")
8890
depends_on("crtm-fix@3.1.1", when="@3.1.1 +fix")
8991
depends_on("crtm-fix@3.1.2", when="@3.1.2 +fix")
92+
# Note. crtm@3.1.3 uses crtm-fix@3.1.2
93+
depends_on("crtm-fix@3.1.2", when="@3.1.3 +fix")
9094

9195
depends_on("ecbuild", type=("build"), when="@v2.3")
9296
depends_on("ecbuild", type=("build"), when="@v2.4")
@@ -124,9 +128,24 @@ def patch(self):
124128
if not self.run_tests:
125129
filter_file(r"add_subdirectory\(test\)", "# disable testing", "CMakeLists.txt")
126130

131+
@run_before("cmake")
132+
def link_fixed_files(self):
133+
if self.spec.satisfies("@3.1.2: +fix"):
134+
symlink(
135+
join_path(self.spec["crtm-fix"].prefix, "fix"),
136+
join_path(self.stage.source_path, "fix"),
137+
)
138+
127139
@when("@3.1.1-build1")
128140
@run_after("install")
129141
def cmake_config_softlinks(self):
130142
cmake_config_files = glob.glob(join_path(self.prefix, "cmake/crtm/*"))
131143
for srcpath in cmake_config_files:
132144
os.symlink(srcpath, join_path(self.prefix, "cmake", os.path.basename(srcpath)))
145+
146+
def check(self):
147+
# Until issues with fixed data organization are resolved, just run the basic test
148+
# see https://github.com/JCSDA/spack-stack/issues/1910
149+
ctest = Executable(self.spec["cmake"].prefix.bin.ctest)
150+
with working_dir(self.build_directory):
151+
ctest("--timeout", "120", "-R", "test_check_crtm")

0 commit comments

Comments
 (0)