diff --git a/.github/workflows/ubuntu-ci-x86_64-gnu.yaml b/.github/workflows/ubuntu-ci-x86_64-gnu.yaml index 0f289f362..25add6e4e 100644 --- a/.github/workflows/ubuntu-ci-x86_64-gnu.yaml +++ b/.github/workflows/ubuntu-ci-x86_64-gnu.yaml @@ -70,9 +70,10 @@ jobs: spack stack create env --site linux.default --template ${TEMPLATE} --name ${ENVNAME} --compiler gcc spack env activate ${ENVDIR} - # Turn off variants "adp" and "jedi" for neptune-dev (NRL internal only) + # Turn off variants "adp", "sdp", and "jedi" for neptune-dev (NRL internal only) if [[ "${TEMPLATE}" == *"neptune-dev"* ]]; then sed -i 's/+adp/~adp/g' ${ENVDIR}/spack.yaml + sed -i 's/+sdp/~sdp/g' ${ENVDIR}/spack.yaml sed -i 's/+jedi/~jedi/g' ${ENVDIR}/spack.yaml fi diff --git a/.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml b/.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml index 71cef1605..b578870e1 100644 --- a/.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml +++ b/.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml @@ -70,9 +70,10 @@ jobs: spack stack create env --site linux.default --template ${TEMPLATE} --name ${ENVNAME} --compiler oneapi spack env activate ${ENVDIR} - # Turn off variants "adp" and "jedi" for neptune-dev (NRL internal only) + # Turn off variants "adp", "sdp", and "jedi" for neptune-dev (NRL internal only) if [[ "${TEMPLATE}" == *"neptune-dev"* ]]; then sed -i 's/+adp/~adp/g' ${ENVDIR}/spack.yaml + sed -i 's/+sdp/~sdp/g' ${ENVDIR}/spack.yaml sed -i 's/+jedi/~jedi/g' ${ENVDIR}/spack.yaml fi diff --git a/.github/workflows/ubuntu-ci-x86_64-oneapi.yaml b/.github/workflows/ubuntu-ci-x86_64-oneapi.yaml index ad01ff3f4..db8888c71 100644 --- a/.github/workflows/ubuntu-ci-x86_64-oneapi.yaml +++ b/.github/workflows/ubuntu-ci-x86_64-oneapi.yaml @@ -70,9 +70,10 @@ jobs: spack stack create env --site linux.default --template ${TEMPLATE} --name ${ENVNAME} --compiler oneapi spack env activate ${ENVDIR} - # Turn off variants "adp" and "jedi" for neptune-dev (NRL internal only) + # Turn off variants "adp", "sdp", and "jedi" for neptune-dev (NRL internal only) if [[ "${TEMPLATE}" == *"neptune-dev"* ]]; then sed -i 's/+adp/~adp/g' ${ENVDIR}/spack.yaml + sed -i 's/+sdp/~sdp/g' ${ENVDIR}/spack.yaml sed -i 's/+jedi/~jedi/g' ${ENVDIR}/spack.yaml fi diff --git a/configs/templates/neptune-dev-llvm/spack.yaml b/configs/templates/neptune-dev-llvm/spack.yaml index c0a70cd07..b15d7d189 100644 --- a/configs/templates/neptune-dev-llvm/spack.yaml +++ b/configs/templates/neptune-dev-llvm/spack.yaml @@ -13,12 +13,7 @@ spack: - neptune-env +debug +openmp +espc +ncview ^esmf@=9.0.0b11 - neptune-env ~debug ~openmp +espc +ncview ^esmf@=9.0.0b11 - neptune-env +debug ~openmp +espc +ncview ^esmf@=9.0.0b11 - # Until we can build the entire set of dependencies for - # neptune-python-env and jedi-neptune-env, we need to - # add the required packages for the NEPTUNE standalone - # model manually - #- neptune-python-env ^neptune-env ~debug +openmp +espc +ncview ^esmf@=9.0.0b11 - #- jedi-neptune-env +adp ^neptune-env ~debug +openmp +espc +ncview ^esmf@=9.0.0b11 + - py-numpy - crtm@3.1.3 diff --git a/configs/templates/neptune-dev/spack.yaml b/configs/templates/neptune-dev/spack.yaml index 24dc6d6ca..de2065fae 100644 --- a/configs/templates/neptune-dev/spack.yaml +++ b/configs/templates/neptune-dev/spack.yaml @@ -27,7 +27,7 @@ spack: - neptune-env ~debug ~openmp +espc +ncview ^esmf@=9.0.0b11 - neptune-env +debug ~openmp +espc +ncview ^esmf@=9.0.0b11 - neptune-python-env +gittools ^neptune-env ~debug +openmp +espc +ncview ^esmf@=9.0.0b11 - - jedi-neptune-env +adp +jedi ^neptune-env ~debug +openmp +espc +ncview ^esmf@=9.0.0b11 + - jedi-neptune-env +adp +sdp +jedi ^neptune-env ~debug +openmp +espc +ncview ^esmf@=9.0.0b11 - crtm@3.1.3 packages: diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/adp_preprocessors/package.py b/repos/spack_stack/spack_repo/spack_stack/packages/adp_preprocessors/package.py index 0cd5ab7f8..3f6f72a02 100644 --- a/repos/spack_stack/spack_repo/spack_stack/packages/adp_preprocessors/package.py +++ b/repos/spack_stack/spack_repo/spack_stack/packages/adp_preprocessors/package.py @@ -14,16 +14,19 @@ class AdpPreprocessors(MakefilePackage): """Unified, model-agnostic software system that processes atmospheric observations for the Navy's numerical weather prediction data assimilation systems""" homepage = "https://github.nrlmry.navy.mil/ADP/adp-preprocessors/wiki" - #git = "https://github.nrlmry.navy.mil/ADP/adp-preprocessors.git" - git = "https://github.nrlmry.navy.mil/climbfuji/adp-preprocessors.git" + git = "https://github.nrlmry.navy.mil/ADP/adp-preprocessors.git" maintainers("climbfuji") #license("UNKNOWN", checked_by="github_user1") - # Update commit once 1.2.0 is released - version("1.2.0", commit="c6f15e46496309c3893416ba4ccec7f003b93550") - version("1.1.0", commit="b2d9d4ffb472eff9ab973ef2a12f574d92c9754b") + # These are not official versions; 1.1.1 lives in @climbfuji's fork. + version("1.1.2", commit="729b0e7572a497b1103d0b8b1e6ff3972efd0d29") + version( + "1.1.1", + git="https://github.nrlmry.navy.mil/climbfuji/adp-preprocessors.git", + commit="c6f15e46496309c3893416ba4ccec7f003b93550" + ) # MakefilePackage dependencies depends_on("c", type="build") @@ -58,7 +61,7 @@ def build(self, spec, prefix): raise InstallError(f"Compiler {self.compiler.name} not configured") def install(self, spec, prefix): - for subdir in ['bin', 'lib', 'mod']: + for subdir in ['bin', 'etc', 'lib', 'mod']: copy_tree(join_path(self.stage.source_path, subdir), join_path(prefix, subdir)) def check(self): diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/jedi_neptune_env/package.py b/repos/spack_stack/spack_repo/spack_stack/packages/jedi_neptune_env/package.py index 708c8776f..f802a3bf6 100644 --- a/repos/spack_stack/spack_repo/spack_stack/packages/jedi_neptune_env/package.py +++ b/repos/spack_stack/spack_repo/spack_stack/packages/jedi_neptune_env/package.py @@ -20,6 +20,7 @@ class JediNeptuneEnv(BundlePackage): version("1.0.0") variant("adp", default=False, description="Build ADP preprocessors") + variant("sdp", default=False, description="Build SDP preprocessors") variant("jedi", default=False, description="Build JEDI components required for JEDI-NEPTUNE") @@ -30,6 +31,9 @@ class JediNeptuneEnv(BundlePackage): with when("+adp"): depends_on("adp-preprocessors", type="run") + with when("+sdp"): + depends_on("sdp-preprocessors", type="run") + with when("+jedi"): # https://github.com/JCSDA/spack-stack/issues/2015 # Changed type from "run" to "build" so that diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/sdp_preprocessors/package.py b/repos/spack_stack/spack_repo/spack_stack/packages/sdp_preprocessors/package.py new file mode 100644 index 000000000..6799c50f7 --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/sdp_preprocessors/package.py @@ -0,0 +1,95 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import subprocess +from pathlib import Path + + +from spack_repo.builtin.build_systems.makefile import MakefilePackage + +from spack.package import * + + +class SdpPreprocessors(MakefilePackage): + """Satellite data processor focusing on satellite radiances and GNSS RO.""" + + homepage = "https://github.nrlmry.navy.mil/NAVGEM/sdp/wiki" + git = "https://github.nrlmry.navy.mil/NAVGEM/sdp.git" + + maintainers("climbfuji") + + #license("UNKNOWN", checked_by="github_user1") + + version("main", branch="main") + # This is branch bugfix/spack_take2 as of 2027/07/16 + version("0.1.0", commit="6ba33e328c2d0d4c71b25e157e7f6cb435a67c99") + + # MakefilePackage dependencies + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("gmake", type="build") + + depends_on("mpi") + depends_on("fftw-api") + depends_on("lapack") + depends_on("hdf5@1.14: +fortran") + depends_on("netcdf-c") + depends_on("netcdf-fortran@4.4.4:") + depends_on("esmf@8.5.0:") + + def setup_build_environment(self, env: EnvironmentModifications) -> None: + env.set("HDF5_HOME", self.spec["hdf5"].prefix) + env.set("HDF5LIB", self.spec["hdf5"].prefix.lib) + env.set("NETCDFC_HOME", self.spec["netcdf-c"].prefix) + env.set("NETCDFFORTRAN_HOME", self.spec["netcdf-fortran"].prefix) + env.set("ZLIB_LIBDIR", self.spec["zlib-api"].prefix.lib) + # Build with only one thread to avoid race conditions + env.set("MAKE_PROCS", str(1)) + + def build(self, spec, prefix): + with working_dir("src"): + if self.compiler.name == "gcc": + make("-f", "Make_ar", "spack_gcc") + elif self.compiler.name == "intel-oneapi-compilers": + make("-f", "Make_ar", "spack_oneapi") + else: + raise InstallError(f"Compiler {self.compiler.name} not configured") + + def install(self, spec, prefix): + # "Install" in build tree, then copy over + with working_dir("src"): + make("-f", "Make_ar", "install") + # Check for expected files, since errors from make aren't caught reliably. + expected_executables = [ + "amsua_nogaps.exe", + "amsub_mhs_nogaps.exe", + "aqua_nogaps.exe", + "atms_nogaps.exe", + "atovin.exe", + "cris_nogaps.exe", + "geo_asr_nogaps.exe", + "geo_csr_nogaps.exe", + "gnss_gb_nogaps.exe", + "gps_nogaps.exe", + "iasi_nogaps.exe", + "mwi_nogaps.exe", + "omps_nogaps.exe", + "radiance_prep.exe", + "ssmis_nogaps.exe", + "ssmis_uas_nogaps.exe", + ] + for exe in expected_executables: + p = Path(join_path(self.stage.source_path, "bin", exe)) + if not p.exists(): + raise InstallError(f"Expected executable {exe} not found.") + # Copy relevant directories over to final location + for subdir in ['bin', 'etc', 'lib', 'mod']: + copy_tree(join_path(self.stage.source_path, subdir), join_path(prefix, subdir)) + + def check(self): + with working_dir("src/script"): + res = subprocess.run("./run_all_test.sh") + assert res.returncode == 0 + #test_script = which(join_path(self.stage.source_path, "src/script/run_all_test.sh")) + #test_script()