Skip to content

Commit

Permalink
Build HDF5 on CCE & --sys-[target]
Browse files Browse the repository at this point in the history
  • Loading branch information
henryleberre committed Apr 5, 2024
1 parent bb21c03 commit cfd2481
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/frontier/test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

./mfc.sh test -j 4 -a --no-hdf5 -- -c frontier
./mfc.sh test -j 4 -a -- -c frontier
43 changes: 19 additions & 24 deletions toolchain/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand All @@ -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}"
"$<$<NOT:$<STREQUAL:${CMAKE_Fortran_COMPILER_ID},Cray>>:-DSILO_HDF5_DIR=${CMAKE_INSTALL_PREFIX}>"
"-DSILO_HDF5_DIR=${CMAKE_INSTALL_PREFIX}"
"$<$<STREQUAL:${CMAKE_Fortran_COMPILER_ID},Cray>:-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()
Expand Down
2 changes: 1 addition & 1 deletion toolchain/mfc/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).")
Expand Down
2 changes: 1 addition & 1 deletion toolchain/mfc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions toolchain/mfc/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit cfd2481

Please sign in to comment.