diff --git a/repos/spack_repo/builtin/packages/esmf/package.py b/repos/spack_repo/builtin/packages/esmf/package.py index 1714009b66c..3ea4e55a16a 100644 --- a/repos/spack_repo/builtin/packages/esmf/package.py +++ b/repos/spack_repo/builtin/packages/esmf/package.py @@ -31,6 +31,8 @@ class Esmf(MakefilePackage, PythonExtension): # Develop is a special name for spack and is always considered the newest version version("develop", branch="develop") # generate chksum with 'spack checksum esmf@x.y.z' + # Todo: replace commit with hash once tagged + version("8.9.1", commit="6a091126030012504e2d42a21eb8764066f0bb6a") version("8.9.0", sha256="586e0101d76ff9842d9ad43567fae50317ee794d80293430d9f1847dec0eefa5") version("8.8.1", sha256="b0acb59d4f000bfbdfddc121a24819bd2a50997c7b257b0db2ceb96f3111b173") version("8.8.0", sha256="f89327428aeef6ad34660b5b78f30d1c55ec67efb8f7df1991fdaa6b1eb3a27c") diff --git a/repos/spack_repo/builtin/packages/netcdf_c/cmakelists_mpi_symbols.patch b/repos/spack_repo/builtin/packages/netcdf_c/cmakelists_mpi_symbols.patch new file mode 100644 index 00000000000..441ff22f6f5 --- /dev/null +++ b/repos/spack_repo/builtin/packages/netcdf_c/cmakelists_mpi_symbols.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1911,8 +1911,11 @@ + CHECK_FUNCTION_EXISTS(mktemp HAVE_MKTEMP) + CHECK_FUNCTION_EXISTS(random HAVE_RANDOM) + CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) +-CHECK_FUNCTION_EXISTS(MPI_Comm_f2c HAVE_MPI_COMM_F2C) +-CHECK_FUNCTION_EXISTS(MPI_Info_f2c HAVE_MPI_INFO_F2C) ++if(MPI_C_COMPILER_INCLUDE_DIRS) ++ set (CMAKE_REQUIRED_INCLUDES "${MPI_C_COMPILER_INCLUDE_DIRS}") ++endif() ++CHECK_SYMBOL_EXISTS(MPI_Comm_f2c "mpi.h" HAVE_MPI_COMM_F2C) ++CHECK_SYMBOL_EXISTS(MPI_Info_f2c "mpi.h" HAVE_MPI_INFO_F2C) + CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE) + CHECK_FUNCTION_EXISTS(getpagesize HAVE_GETPAGESIZE) + CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF) diff --git a/repos/spack_repo/builtin/packages/netcdf_c/package.py b/repos/spack_repo/builtin/packages/netcdf_c/package.py index 1271a3c68cd..1849d3a2609 100644 --- a/repos/spack_repo/builtin/packages/netcdf_c/package.py +++ b/repos/spack_repo/builtin/packages/netcdf_c/package.py @@ -124,6 +124,20 @@ class NetcdfC(CMakePackage, AutotoolsPackage): when="@4.9.0:4.9.2", ) + # https://github.com/Unidata/netcdf-c/issues/3199 + patch("cmakelists_mpi_symbols.patch", when="build_system=cmake") + + def patch(self): + """Fix bad code in ncgen/CMakeLists.txt that removes + the rpath for dependencies like hdf5.""" + if self.spec.satisfies("build_system=cmake"): + filter_file( + "SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)", + "#SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)", + "ncgen/CMakeLists.txt", + string=True, + ) + variant("mpi", default=True, description="Enable parallel I/O for netcdf-4") variant("parallel-netcdf", default=False, description="Enable parallel I/O for classic files") variant("hdf4", default=False, description="Enable HDF4 support") @@ -288,16 +302,6 @@ class NetcdfC(CMakePackage, AutotoolsPackage): build_system("cmake", "autotools", default=default_build_system) - def patch(self): - """Fix bad code in ncgen/CMakeLists.txt that removes - the rpath for dependencies like hdf5.""" - filter_file( - "SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)", - "#SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)", - "ncgen/CMakeLists.txt", - string=True - ) - def setup_run_environment(self, env: EnvironmentModifications) -> None: if self.spec.satisfies("@4.9.0:+shared"): # Both HDF5 and NCZarr backends honor the same environment variable: @@ -358,6 +362,8 @@ def cmake_args(self): self.define("ENABLE_LARGE_FILE_SUPPORT", True), self.define_from_variant("NETCDF_ENABLE_LOGGING", "logging"), ] + if any(self.spec.satisfies(s) for s in ["+mpi", "+parallel-netcdf", "^hdf5+mpi~shared"]): + base_cmake_args.append(self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc)) if "+parallel-netcdf" in self.pkg.spec: base_cmake_args.append(self.define("ENABLE_PNETCDF", True)) if self.pkg.spec.satisfies("@4.3.1:"):