diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/ioda/ioda_yaml_root.patch b/repos/spack_stack/spack_repo/spack_stack/packages/ioda/ioda_yaml_root.patch new file mode 100644 index 000000000..954854cb3 --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/ioda/ioda_yaml_root.patch @@ -0,0 +1,65 @@ +diff --git a/cmake/ioda-import.cmake.in b/cmake/ioda-import.cmake.in +index 907fce15..c049b2c6 100644 +--- a/cmake/ioda-import.cmake.in ++++ b/cmake/ioda-import.cmake.in +@@ -6,7 +6,6 @@ + + include(CMakeFindDependencyMacro) + +- + # These instructions parallel ioda's top-level CMakeLists.txt dependencies + + # Required packages +@@ -80,24 +79,3 @@ if(NOT @PROJECT_NAME@_MODULES_Fortran_COMPILER_ID STREQUAL CMAKE_Fortran_COMPILE + "but this build for ${PROJECT_NAME} uses incompatible compiler ${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}") + endif() + +-# Export ioda YAML validation files directory +-if( IS_ABSOLUTE "@CMAKE_INSTALL_DATADIR@") +- set( IODA_YAML_ROOT "@CMAKE_INSTALL_DATADIR@/ioda/yaml" ) +-else() +- if ( DEFINED _IMPORT_PREFIX ) +- # We are in a CMake install tree +- set( IODA_YAML_ROOT "${_IMPORT_PREFIX}/@CMAKE_INSTALL_DATADIR@/ioda/yaml" ) +- else() +- # We are in a CMake build tree. Ergo, we can use the variable set in +- # IODA's top-level CMakeLists.txt that points to the YAML root path +- # in the source tree. +- # +- # Note: a small downside of this approach is that a source tree path is hardcoded +- # in the ioda-post-import.cmake file, even if it is never again used. Some +- # tools (like Spack) will complain about this path and may indicate that ioda +- # is a non-relocatable package, even though it is completely relocatable. +- set( IODA_YAML_ROOT "@IODA_YAML_ROOT@" ) +- endif() +-endif() +- +- +diff --git a/cmake/ioda-post-import.cmake.in b/cmake/ioda-post-import.cmake.in +index d5fe93a8..9de02495 100644 +--- a/cmake/ioda-post-import.cmake.in ++++ b/cmake/ioda-post-import.cmake.in +@@ -13,3 +13,23 @@ endif() + if( (TARGET _ioda_python) AND NOT (TARGET ioda::Python) ) + add_library( ioda::Python ALIAS _ioda_python ) + endif() ++ ++# Export ioda YAML validation files directory ++ ++# ioda_BINARY_DIR is only set if we are in a build tree somewhere ++# (either in a bundle or a standalone build). ++if( DEFINED ioda_BINARY_DIR ) ++ # We are in the build tree. ++ # CMAKE_CURRENT_LIST_DIR is the old var ++ set( IODA_YAML_ROOT "${ioda_BINARY_DIR}/share/test/testinput" ) ++else() ++ # We are outside of ioda's build tree. ++ if( IS_ABSOLUTE "@CMAKE_INSTALL_DATADIR@") ++ set( IODA_YAML_ROOT "@CMAKE_INSTALL_DATADIR@/ioda/yaml" ) ++ else() ++ # ioda_BASE_DIR is defined by the ecbuild-generated ioda-config.cmake. ++ # See https://github.com/ecmwf/ecbuild/blob/develop/cmake/project-config.cmake.in ++ set( IODA_YAML_ROOT "${ioda_BASE_DIR}/@CMAKE_INSTALL_DATADIR@/ioda/yaml" ) ++ endif() ++endif() ++ 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 index b22856ae2..1c61359f1 100644 --- a/repos/spack_stack/spack_repo/spack_stack/packages/ioda/package.py +++ b/repos/spack_stack/spack_repo/spack_stack/packages/ioda/package.py @@ -20,6 +20,7 @@ class Ioda(CMakePackage): version("2.9.0.20250826", commit="6e76616001067384f7d0ca4341ad78e81527af8b") patch("ioda_cmake_import.patch", when="@2.9.0.20250826") + patch("ioda_yaml_root.patch", when="@2.9.0.20250826") variant("doc", default=False, description="Build IODA documentation") # Let's always assume IODA_BUILD_LANGUAGE_FORTRAN=on. @@ -101,11 +102,11 @@ def check(self): else: ctest("--timeout", "120") - @run_after("install") - def fix_ioda_yaml_root_path(self): - with when("@2.9.0.20250826"): - filter_file( - join_path(self.build_directory, "share/test/testinput/"), - join_path(self.prefix, "share/ioda/yaml"), - join_path(self.prefix, "lib64/cmake/ioda/ioda-import.cmake"), - ) + #@run_after("install") + #def fix_ioda_yaml_root_path(self): + # with when("@2.9.0.20250826"): + # filter_file( + # join_path(self.build_directory, "share/test/testinput/"), + # join_path(self.prefix, "share/ioda/yaml"), + # join_path(self.prefix, "lib64/cmake/ioda/ioda-import.cmake"), + # ) 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 index ad1710471..ac522e46b 100644 --- a/repos/spack_stack/spack_repo/spack_stack/packages/oops/package.py +++ b/repos/spack_stack/spack_repo/spack_stack/packages/oops/package.py @@ -22,6 +22,7 @@ class Oops(CMakePackage): version("1.10.0.20250827", commit="91889ad09d3789f14a1184701dd80a4913d3ce3e") patch("include_algorithm.patch", when="@1.10.0.20250827") + patch("patch-1.10.0.atlas.mac.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)") diff --git a/repos/spack_stack/spack_repo/spack_stack/packages/oops/patch-1.10.0.atlas.mac.patch b/repos/spack_stack/spack_repo/spack_stack/packages/oops/patch-1.10.0.atlas.mac.patch new file mode 100644 index 000000000..7b54487ba --- /dev/null +++ b/repos/spack_stack/spack_repo/spack_stack/packages/oops/patch-1.10.0.atlas.mac.patch @@ -0,0 +1,34 @@ +diff --git a/src/oops/util/ParallelFieldSetIO.cc b/src/oops/util/ParallelFieldSetIO.cc +index 04e4c55c..0a07a9ba 100644 +--- a/src/oops/util/ParallelFieldSetIO.cc ++++ b/src/oops/util/ParallelFieldSetIO.cc +@@ -80,9 +80,6 @@ atlas::FieldSet ParallelFieldSetIO::ioFieldSet(const atlas::FieldSet& nativeFiel + case atlas::array::DataType::KIND_INT32: + ioFieldSet.add(functionSpace_.createField(fieldSetConfig)); + break; +- case atlas::array::DataType::KIND_INT64: +- ioFieldSet.add(functionSpace_.createField(fieldSetConfig)); +- break; + case atlas::array::DataType::KIND_REAL32: + ioFieldSet.add(functionSpace_.createField(fieldSetConfig)); + break; +@@ -105,9 +102,6 @@ void ParallelFieldSetIO::writeFieldByTypeAndRank(const atlas::Field& field, + case atlas::array::DataType::KIND_INT32: + dispatchWriteField(field, netcdfGeneralIDs, netcdfVarID); + break; +- case atlas::array::DataType::KIND_INT64: +- dispatchWriteField(field, netcdfGeneralIDs, netcdfVarID); +- break; + case atlas::array::DataType::KIND_REAL32: + dispatchWriteField(field, netcdfGeneralIDs, netcdfVarID); + break; +@@ -129,9 +123,6 @@ void ParallelFieldSetIO::readFieldByTypeAndRank(atlas::Field& field, + case atlas::array::DataType::KIND_INT32: + dispatchReadField(field, netcdfGeneralIDs, netcdfVarID); + break; +- case atlas::array::DataType::KIND_INT64: +- dispatchReadField(field, netcdfGeneralIDs, netcdfVarID); +- break; + case atlas::array::DataType::KIND_REAL32: + dispatchReadField(field, netcdfGeneralIDs, netcdfVarID); + break;