diff --git a/.github/workflows/ubuntu-ci-x86_64-gnu.yaml b/.github/workflows/ubuntu-ci-x86_64-gnu.yaml index 32bbb9e39..7bb6742ca 100644 --- a/.github/workflows/ubuntu-ci-x86_64-gnu.yaml +++ b/.github/workflows/ubuntu-ci-x86_64-gnu.yaml @@ -82,9 +82,10 @@ jobs: spack stack create env --site linux.default --template ${TEMPLATE} --name ${ENVNAME} --compiler gcc spack env activate ${ENVDIR} - # Turn off variant "adp" for neptune-dev (NRL internal only) + # Turn off variants "adp" 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/+jedi/~jedi/g' ${ENVDIR}/spack.yaml fi unset SPACK_DISABLE_LOCAL_CONFIG diff --git a/.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml b/.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml index cf27ce5f8..d8370ed5c 100644 --- a/.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml +++ b/.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml @@ -82,9 +82,10 @@ jobs: spack stack create env --site linux.default --template ${TEMPLATE} --name ${ENVNAME} --compiler oneapi spack env activate ${ENVDIR} - # Turn off variant "adp" for neptune-dev (NRL internal only) + # Turn off variants "adp" 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/+jedi/~jedi/g' ${ENVDIR}/spack.yaml fi unset SPACK_DISABLE_LOCAL_CONFIG diff --git a/.github/workflows/ubuntu-ci-x86_64-oneapi.yaml b/.github/workflows/ubuntu-ci-x86_64-oneapi.yaml index 4dded738e..23fe94ef6 100644 --- a/.github/workflows/ubuntu-ci-x86_64-oneapi.yaml +++ b/.github/workflows/ubuntu-ci-x86_64-oneapi.yaml @@ -82,9 +82,10 @@ jobs: spack stack create env --site linux.default --template ${TEMPLATE} --name ${ENVNAME} --compiler oneapi spack env activate ${ENVDIR} - # Turn off variant "adp" for neptune-dev (NRL internal only) + # Turn off variants "adp" 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/+jedi/~jedi/g' ${ENVDIR}/spack.yaml fi unset SPACK_DISABLE_LOCAL_CONFIG diff --git a/configs/common/packages_gcc.yaml b/configs/common/packages_gcc.yaml index 1f3925485..d89f64e65 100644 --- a/configs/common/packages_gcc.yaml +++ b/configs/common/packages_gcc.yaml @@ -20,3 +20,6 @@ packages: ectrans: require: - +fftw + oops: + require: + - ~mkl \ No newline at end of file diff --git a/configs/common/packages_oneapi.yaml b/configs/common/packages_oneapi.yaml index 30db8f8c7..6ef85cb5c 100644 --- a/configs/common/packages_oneapi.yaml +++ b/configs/common/packages_oneapi.yaml @@ -19,40 +19,43 @@ packages: # Individual package settings antlr: require: - - '%gcc' + - '%c,cxx=gcc' bison: require: - - '%gcc' + - '%c,cxx=gcc' cmake: require: - - '%gcc' + - '%c,cxx=gcc' ectrans: require: - +mkl ~fftw gmake: require: - - '%gcc' + - '%c=gcc' libbsd: require: - - '%gcc' + - '%c=gcc' libmd: require: - - '%gcc' + - '%c=gcc' met: require: - +shared-intel nco: require: - - '%gcc' + - '%c,cxx=gcc' + oops: + require: + - +mkl parallel-netcdf: require: - +shared-intel py-maturin: require: - - '%gcc' + - '%c=gcc' py-scipy: require: - 'cxxflags="-O1"' qt: require: - - '%gcc' + - '%c,cxx=gcc' diff --git a/configs/templates/neptune-dev/spack.yaml b/configs/templates/neptune-dev/spack.yaml index 96e1dfc9e..15bdd438c 100644 --- a/configs/templates/neptune-dev/spack.yaml +++ b/configs/templates/neptune-dev/spack.yaml @@ -12,8 +12,8 @@ spack: - neptune-env +debug +openmp +espc +ncview ^esmf@=8.9.1 - neptune-env ~debug ~openmp +espc +ncview ^esmf@=8.9.1 - neptune-env +debug ~openmp +espc +ncview ^esmf@=8.9.1 - - neptune-python-env ^neptune-env ~debug +openmp +espc +ncview ^esmf@=8.9.1 - - jedi-neptune-env +adp ^neptune-env ~debug +openmp +espc +ncview ^esmf@=8.9.1 + - neptune-python-env ^neptune-env ~debug +openmp +espc +ncview ^esmf@=8.9.1 + - jedi-neptune-env +adp +jedi ^neptune-env ~debug +openmp +espc +ncview ^esmf@=8.9.1 - crtm@3.1.2 - crtm@v2.4.1-jedi.2 diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/ioda/ioda_cmake_import.patch b/repos/spack_stack/spack_repo/spack_stack/packages/ioda/ioda_cmake_import.patch new file mode 100644 index 000000000..0fc3e334d --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/ioda/ioda_cmake_import.patch @@ -0,0 +1,18 @@ +--- a/cmake/ioda-import.cmake.in ++++ b/cmake/ioda-import.cmake.in +@@ -65,6 +65,15 @@ + if(@odc_FOUND@) + find_dependency( odc 1.0.2 REQUIRED ) + endif() ++ ++if(@bufr_FOUND@) ++ find_dependency( bufr 12.0.1 REQUIRED ) ++endif() ++ ++if(@bufr_query_FOUND@) ++ find_dependency( bufr_query 0.0.4 REQUIRED ) ++endif() ++ + # Header-only. Not exposed. + #find_dependency( Boost 1.64.0 ) + diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/ioda/package.py b/repos/spack_stack/spack_repo/spack_stack/packages/ioda/package.py new file mode 100644 index 000000000..241b895d1 --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/ioda/package.py @@ -0,0 +1,79 @@ +# Copyright 2013-2022 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) + +from spack_repo.builtin.build_systems.cmake import CMakePackage, generator + +from spack.package import * + + +class Ioda(CMakePackage): + """Interface for Observation Data Access""" + + homepage = "https://github.com/JCSDA/ioda" + git = "https://github.com/JCSDA/ioda.git" + + maintainers("climbfuji") + + version("develop", branch="develop", no_cache=True) + version("2.9.0.20250826", commit="6e76616001067384f7d0ca4341ad78e81527af8b") + + patch("ioda_cmake_import.patch", when="@2.9.0.20250826") + + variant("doc", default=False, description="Build IODA documentation") + # Let's always assume IODA_BUILD_LANGUAGE_FORTRAN=on. + # variant('fortran', default=True, description='Build the ioda Fortran interface') + variant("odc", default=True, description="Build ODC bindings") + # ioda has no explicit OpenMP calls, but header files from Eigen and oops do use openmp. + variant("openmp", default=True, description="Build with OpenMP support") + # Let's always BUILD_PYTHON_BINDINGS. + # variant('python', default=True, description='Build the ioda Python interface') + + generator("make") + + # Project doesn't list "c" as a dependency in CMakeLists.txt, but cmake step fails w/o it + depends_on("c", type=("build")) + depends_on("cxx", type=("build")) + depends_on("fortran", type=("build")) + + depends_on("boost@1.64.0:") + depends_on("bufr") + depends_on("bufr@12.0.1:", when="@2.9:") + # This is optional, and it needs netcdf-cxx - which versions? + depends_on("bufr-query@0.0.4:", when="@2.9:") + depends_on("cmake", type=("build")) + depends_on("cmake@3.14:", type=("build"), when="@2.9:") + depends_on("ecbuild", type=("build")) + depends_on("ecbuild@3.3.2:", type=("build"), when="@2.9:") + depends_on("eckit") + depends_on("eckit@1.23.0:", when="@2.9:") + depends_on("eigen") + depends_on("fckit") + depends_on("fckit@0.10.1:", when="@2.9:") + depends_on("gsl-lite") + depends_on("hdf5@1.12.0: +mpi") + depends_on("hdf5@1.14.0: +mpi", when="@2.9:") + depends_on("jedi-cmake", type=("build")) + depends_on("llvm-openmp", when="+openmp %apple-clang", type=("build", "link", "run")) + depends_on("mpi") + depends_on("nccmp") + # netcdf-cxx needed for bufr-query, but which version? + depends_on("netcdf-cxx", when="@2.9:") + depends_on("odc", when="+odc") + depends_on("odc@1.4.6:", when="@2.9: +odc") + depends_on("oops+openmp", when="+openmp") + depends_on("oops~openmp", when="~openmp") + depends_on("oops@1.10", when="@2.9:") + depends_on("python") + depends_on("python@3.9:3.11", when="@2.9:") + depends_on("py-pybind11") + depends_on("py-pycodestyle") + depends_on("udunits") + depends_on("udunits@2.2.0:", when="@2.9:") + + def cmake_args(self): + res = [ + self.define_from_variant("ENABLE_IODA_DOC", "doc"), + ] + return res diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/ioda_converters/package.py b/repos/spack_stack/spack_repo/spack_stack/packages/ioda_converters/package.py new file mode 100644 index 000000000..5880bce31 --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/ioda_converters/package.py @@ -0,0 +1,46 @@ +# Copyright 2013-2022 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) + +from spack_repo.builtin.build_systems.cmake import CMakePackage, generator + +from spack.package import * + + +class IodaConverters(CMakePackage): + """Interface for Observation Data Access""" + + homepage = "https://github.com/JCSDA/ioda-converters" + git = "https://github.com/JCSDA/ioda-converters.git" + + maintainers("climbfuji") + + version("develop", branch="develop", no_cache=True) + version("0.0.1.20250830", commit="a91f432d9d50940910605e689cd1cf93a1ce3798") + + generator("make") + + # Project doesn't list "c" as a dependency in CMakeLists.txt, but cmake step fails w/o it + depends_on("c", type=("build")) + depends_on("cxx", type=("build")) + depends_on("fortran", type=("build")) + + extends("python") + + depends_on("ecbuild", type=("build")) + depends_on("ecbuild@3.3.2:", type=("build"), when="@0.0.1:") + + depends_on("bufr@12:") + depends_on("eccodes") + depends_on("eckit") + depends_on("eigen@3") + depends_on("gsl-lite") + depends_on("ioda") + depends_on("jedi-cmake", type=("build")) + depends_on("mpi") + depends_on("netcdf-cxx") + depends_on("netcdf-fortran") + depends_on("oops") + depends_on("py-cartopy") + depends_on("py-pybind11") 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 51689bf64..19bff422e 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 @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.bundle import BundlePackage + from spack.package import * @@ -20,6 +21,8 @@ class JediNeptuneEnv(BundlePackage): variant("adp", default=False, description="Build ADP preprocessors") + variant("jedi", default=False, description="Build JEDI components required for JEDI-NEPTUNE") + depends_on("jedi-base-env", type="run") depends_on("neptune-env", type="run") depends_on("neptune-python-env", type="run") @@ -27,4 +30,10 @@ class JediNeptuneEnv(BundlePackage): with when("+adp"): depends_on("adp-preprocessors", type="run") - # There is no need for install() since there is no code. + with when("+jedi"): + depends_on("oops@1.10.0.20250827", type="run") + depends_on("crtm@v2.4.1-jedi.2", type="run") + depends_on("ioda@2.9.0.20250826", type="run") + depends_on("ioda-converters@0.0.1.20250830", type="run") + depends_on("ropp-ufo@11.0.20251022", type="run") + depends_on("ufo@1.10.0.20250821 +crtm-v2 +ropp", type="run") diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/oops/include_algorithm.patch b/repos/spack_stack/spack_repo/spack_stack/packages/oops/include_algorithm.patch new file mode 100644 index 000000000..771ae3990 --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/oops/include_algorithm.patch @@ -0,0 +1,10 @@ +--- a/src/oops/base/ParameterTraitsObsVariables.h ++++ b/src/oops/base/ParameterTraitsObsVariables.h +@@ -7,6 +7,7 @@ + + #pragma once + ++#include + #include + #include + diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/oops/package.py b/repos/spack_stack/spack_repo/spack_stack/packages/oops/package.py new file mode 100644 index 000000000..b94385a1c --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/oops/package.py @@ -0,0 +1,70 @@ +# Copyright 2013-2022 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) + +from spack_repo.builtin.build_systems.cmake import CMakePackage, generator + +from spack.package import * + + +class Oops(CMakePackage): + """Object Oriented Prediction System""" + + homepage = "https://github.com/JCSDA/oops" + git = "https://github.com/JCSDA/oops.git" + + maintainers("climbfuji") + + version("develop", branch="develop", no_cache=True) + # This commit plus the patch below accounts for commit + # 2340e9b664f82de9fa01c136c3a31d87e4a0bec9 in NRL GitHub + version("1.10.0.20250827", commit="91889ad09d3789f14a1184701dd80a4913d3ce3e") + + patch("include_algorithm.patch", when="@1.10.0.20250827") + + variant("l95", default=True, description="Build LORENZ95 toy model") + variant("mkl", default=False, description="Use MKL for LAPACK implementation (if available)") + variant("openmp", default=True, description="Build oops with OpenMP support") + variant("qg", default=True, description="Build QG toy model") + variant('gptl', default=False, description='Use GPTL profiling library (if available)') + + generator("make") + + # Project doesn't list "c" as a dependency in CMakeLists.txt, but cmake step fails w/o it + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + + depends_on("boost@1.64:") + depends_on("cmake", type=("build")) + depends_on("cmake@3.12:", type=("build"), when="@1.10:") + depends_on("ecbuild", type=("build")) + depends_on("ecbuild@3.3.2:", type=("build"), when="@1.10:") + depends_on("eckit") + depends_on("eckit@1.24.4:", when="@1.10:") + depends_on("ecmwf-atlas") + depends_on("ecmwf-atlas@0.35.0:", when="@1.10:") + depends_on("eigen") + depends_on("fckit") + depends_on("fckit@0.11.0:", when="@1.10:") + depends_on('gptl', when='+gptl') + depends_on("jedi-cmake", type=("build")) + depends_on("lapack", when="~mkl") + depends_on("mkl", when="+mkl") + depends_on("llvm-openmp", when="+openmp %apple-clang", type=("build", "link", "run")) + depends_on("mpi") + depends_on("netcdf-c+mpi") + depends_on("netcdf-fortran") + depends_on("nlohmann-json") + depends_on("nlohmann-json-schema-validator") + + def cmake_args(self): + res = [ + self.define_from_variant("ENABLE_LORENZ95_MODEL", "l95"), + self.define_from_variant("ENABLE_QG_MODEL", "qg"), + self.define_from_variant("ENABLE_MKL", "mkl"), + self.define_from_variant("OPENMP", "openmp"), + self.define_from_variant("ENABLE_GPTL", "gptl"), + ] + return res diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/ropp_ufo/package.py b/repos/spack_stack/spack_repo/spack_stack/packages/ropp_ufo/package.py new file mode 100644 index 000000000..1a99bc190 --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/ropp_ufo/package.py @@ -0,0 +1,34 @@ +# Copyright 2013-2022 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) + +from spack_repo.builtin.build_systems.cmake import CMakePackage, generator + +from spack.package import * + + +class RoppUfo(CMakePackage): + """Unified Forward Operator Interface for Radio Occultation Pre-processing package (ROPP)""" + + # DH* TODO CHANGE BACK TO JCSDA-INTERNAL ONCE THE NRL VERSION WAS MERGED BACK + homepage = "https://github.nrlmry.navy.mil/jcsda/ropp-ufo" + git = "https://github.nrlmry.navy.mil/jcsda/ropp-ufo.git" + + maintainers("climbfuji") + + version("develop", branch="develop", no_cache=True) + # this is the ropp-submodule branch ... update once merged + version("11.0.20251022", commit="02e21ef0696e67675184797427af265c06973ecf", submodules=True) + + # Project doesn't list "c" as a dependency in CMakeLists.txt, but cmake step fails w/o it + depends_on("c", type=("build")) + depends_on("fortran", type=("build")) + + depends_on("cmake", type=("build")) + depends_on("cmake@3.12:", type=("build"), when="@11:") + depends_on("ecbuild", type=("build")) + depends_on("ecbuild@3.3.2:", type=("build"), when="@11:") + depends_on("jedi-cmake", type=("build")) + depends_on("netcdf-c") + depends_on("netcdf-fortran") diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/ufo/package.py b/repos/spack_stack/spack_repo/spack_stack/packages/ufo/package.py new file mode 100644 index 000000000..9cb0e8752 --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/ufo/package.py @@ -0,0 +1,98 @@ +# Copyright 2013-2022 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) + +from spack_repo.builtin.build_systems.cmake import CMakePackage, generator + +from spack.package import * + + +class Ufo(CMakePackage): + """Unified Forward Operator""" + + homepage = "https://github.com/JCSDA/ufo" + git = "https://github.com/JCSDA/ufo.git" + + maintainers("climbfuji") + + version("develop", branch="develop", no_cache=True) + version("1.10.0.20250821", commit="1ca49e253caa6d6a507f41ffa6875e0db7cc0751") + + patch( + "https://github.com/jcsda/ufo/commit/ce4cbf8d9dbfd11ac5f2d4add61aa1c1bbc075fc.patch?full_index=1", + sha256="b12aa105e8058409e5897fcc1d18054f4aef7fdb444bbb0341c1af6e0025197b", + when="@1.10.0.20250821", + ) + + variant("crtm-v2", default=True, description="Build CRTM v2 operator") + variant("crtm-v3", default=False, description="Build CRTM v3 operator") + # JCSDA-internal repository needed. + variant("geos-aero", default=False, description="Build GEOS-AERO AOD operator") + # Package gsw not yet available in spack + variant("gsw", default=False, description="Build marine observation operators") + # JCSDA-internal repository is public, but there is no "release" of the code yet. + variant( + "oasim", default=False, description="Build with Ocean Atmosphere Spectral Irradiance Model" + ) + # NRL-internal repository needed. + variant("ropp", default=False, description="Build ROPP operator") + # JCSDA-internal repository needed. + variant("rttov", default=False, description="Build RTTOV operator") + + conflicts("+crtm-v2 +crtm-v3", msg="UFO: choose either CRTM v2 or v3, not both.") + + conflicts("+geos-aero", msg="UFO: GEOS-AERO to be implemented.") + conflicts("+gsw", msg="UFO: GSW to be implemented.") + conflicts("+oasim", msg="UFO: OASIM to be implemented.") + conflicts("+rttov", msg="UFO: RTTOV to be implemented.") + + # Project doesn't list "c" as a dependency in CMakeLists.txt, but cmake step fails w/o it + depends_on("c", type=("build")) + depends_on("cxx", type=("build")) + depends_on("fortran", type=("build")) + + # DH* TODO FIX THIS (ALSO IN IODA ETC - CHECK ALL) + # -- Download test data from https://bin.ssec.wisc.edu/pub/s4/CRTM/file/crtm_coefficients_2.4.1_skylab_4.0.tar.gz + + depends_on("boost") + depends_on("cmake", type=("build")) + depends_on("cmake@3.12:", type=("build"), when="@1.10:") + depends_on("ecbuild", type=("build")) + depends_on("ecbuild@3.3.2:", type=("build"), when="@1.10:") + depends_on("eckit") + depends_on("eckit@1.24.4:", when="@1.10:") + depends_on("eigen") + depends_on("fckit") + depends_on("fckit@0.11.0:", when="@1.10:") + depends_on("gsl-lite") + depends_on("ioda") + depends_on("ioda@2.9", when="@1.10:") + depends_on("jedi-cmake", type=("build")) + depends_on("mpi") + depends_on("netcdf-c+mpi") + depends_on("netcdf-fortran") + depends_on("oops") + depends_on("oops@1.10", when="@1.10") + + depends_on("crtm@v2", when="+crtm-v2") + # DOES THIS INCLUDE THE ONEAPI IFX OPENMP BUG FIX? DH* TODO + depends_on("crtm@=v2.4.1-jedi.2", when="@1.10 +crtm-v2") + + depends_on("crtm@3", when="+crtm-v3") + depends_on("crtm@=3.1.2", when="@1.10 +crtm-v3") + + # depends_on('geos-aero', when='+geos-aero') + # depends_on('geos-aero@0.0.0', when='@1.7.0 +geos-aero') + + # depends_on('oasim', when='+oasim') + # depends_on('oasim@0.0.0', when='@1.7.0 +oasim') + + # depends_on("gsw", when="+gsw") + # depends_on("gsw@3.0.7", when="@1.7: +gsw") + + depends_on('ropp-ufo', when='+ropp') + depends_on('ropp-ufo@11.0', when='@1.10 +ropp') + + # depends_on('rttov', when='+rttov') + # depends_on('rttov@12.1.0', when='@1.7.0 +rttov')