From cfd2481adffa04704d38534d00eeb50fccf26b14 Mon Sep 17 00:00:00 2001 From: Henry Le Berre Date: Fri, 5 Apr 2024 13:19:19 -0400 Subject: [PATCH] Build HDF5 on CCE & --sys-[target] --- .github/workflows/frontier/test.sh | 2 +- toolchain/dependencies/CMakeLists.txt | 43 ++++++++++++--------------- toolchain/mfc/args.py | 2 +- toolchain/mfc/build.py | 2 +- toolchain/mfc/test/test.py | 4 +-- 5 files changed, 24 insertions(+), 29 deletions(-) diff --git a/.github/workflows/frontier/test.sh b/.github/workflows/frontier/test.sh index 8a90ba8a6..fab53ef8e 100644 --- a/.github/workflows/frontier/test.sh +++ b/.github/workflows/frontier/test.sh @@ -1,3 +1,3 @@ #!/bin/bash -./mfc.sh test -j 4 -a --no-hdf5 -- -c frontier +./mfc.sh test -j 4 -a -- -c frontier diff --git a/toolchain/dependencies/CMakeLists.txt b/toolchain/dependencies/CMakeLists.txt index d5f065cff..69454adb3 100644 --- a/toolchain/dependencies/CMakeLists.txt +++ b/toolchain/dependencies/CMakeLists.txt @@ -41,24 +41,19 @@ endif() # HDF5 if (MFC_HDF5) - if (NOT CMAKE_Fortran_COMPILER_ID STREQUAL "Cray") - ExternalProject_Add(hdf5 - GIT_REPOSITORY "https://github.com/HDFGroup/hdf5" - GIT_TAG hdf5-1_12_2 - GIT_SHALLOW ON - GIT_PROGRESS ON - CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" - -DBUILD_SHARED_LIBS=OFF - -DFORTRAN_LIBRARIES=ON - -DBUILD_TESTING=OFF - -DHDF5_BUILD_UTILS=OFF - -DHDF5_BUILD_TOOLS=ON - -DHDF5_BUILD_EXAMPLES=OFF - ) - else() - message(WARNING "The Fortran compiler vendor is Cray so HDF5 will not be built. We will use cray-hdf5 instead.") - add_custom_target(hdf5) - endif() + ExternalProject_Add(hdf5 + GIT_REPOSITORY "https://github.com/HDFGroup/hdf5" + GIT_TAG hdf5-1_12_2 + GIT_SHALLOW ON + GIT_PROGRESS ON + CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" + -DBUILD_SHARED_LIBS=OFF + -DFORTRAN_LIBRARIES=ON + -DBUILD_TESTING=OFF + -DHDF5_BUILD_UTILS=OFF + -DHDF5_BUILD_TOOLS=ON + -DHDF5_BUILD_EXAMPLES=OFF + ) endif() @@ -72,16 +67,16 @@ if (MFC_SILO) GIT_TAG af955eb5dd009caf00c41ca51611b37c052b042c GIT_SHALLOW ON GIT_PROGRESS ON - CMAKE_ARGS -DSILO_ENABLE_SHARED=OFF - -DSILO_ENABLE_SILOCK=OFF - -DSILO_ENABLE_BROWSER=OFF - -DHDF5_USE_STATIC_LIBRARIES=ON + CMAKE_ARGS -DSILO_ENABLE_SHARED=OFF + -DSILO_ENABLE_SILOCK=OFF + -DSILO_ENABLE_BROWSER=OFF + -DHDF5_USE_STATIC_LIBRARIES=ON "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" - "$<$>:-DSILO_HDF5_DIR=${CMAKE_INSTALL_PREFIX}>" + "-DSILO_HDF5_DIR=${CMAKE_INSTALL_PREFIX}" "$<$:-DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/../cmake>" ) - if (MFC_HDF5 AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL "Cray") + if (MFC_HDF5) add_dependencies(silo hdf5) endif() endif() diff --git a/toolchain/mfc/args.py b/toolchain/mfc/args.py index 428bd0fa3..70c1af39f 100644 --- a/toolchain/mfc/args.py +++ b/toolchain/mfc/args.py @@ -63,7 +63,7 @@ def add_common_arguments(p, mask = None): if "n" not in mask: for target in DEPENDENCY_TARGETS: - p.add_argument(f"--no-{target.name}", action="store_true", help=f"Do not build the {target.name} dependency. Use the system's instead.") + p.add_argument(f"--sys-{target.name}", action="store_true", help=f"Do not build the {target.name} dependency. Use the system's instead.") if "g" not in mask: p.add_argument("-g", "--gpus", nargs="+", type=int, default=None, help="(Optional GPU override) List of GPU #s to use (environment default if unspecified).") diff --git a/toolchain/mfc/build.py b/toolchain/mfc/build.py index fc32b34b6..067204f29 100644 --- a/toolchain/mfc/build.py +++ b/toolchain/mfc/build.py @@ -95,7 +95,7 @@ def is_buildable(self) -> bool: if ARG("no_build"): return False - if self.isDependency and ARG(f"no_{self.name}", False): + if self.isDependency and ARG(f"sys_{self.name}", False): return False return True diff --git a/toolchain/mfc/test/test.py b/toolchain/mfc/test/test.py index adca675da..1c5e6de74 100644 --- a/toolchain/mfc/test/test.py +++ b/toolchain/mfc/test/test.py @@ -189,9 +189,9 @@ def _handle_case(case: TestCase, devices: typing.Set[int]): h5dump = f"{HDF5.get_install_dirpath()}/bin/h5dump" - if ARG("no_hdf5"): + if ARG("sys_hdf5"): if not does_command_exist("h5dump"): - raise MFCException("--no-hdf5 was specified and h5dump couldn't be found.") + raise MFCException("--sys-hdf5 was specified and h5dump couldn't be found.") h5dump = shutil.which("h5dump")