Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions repos/spack_repo/builtin/packages/esmf/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
26 changes: 16 additions & 10 deletions repos/spack_repo/builtin/packages/netcdf_c/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:"):
Expand Down