Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to build parallel HDF5 #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ endif(USE_SYSTEM_LIBS)
option(ENABLE_EXODUS "Enable Exodus and dependencies" ${ENABLE_EXODUS_DEFAULT})
cmake_dependent_option(ENABLE_HDF5 "Enable HDF5" ${ENABLE_HDF5_DEFAULT}
"ENABLE_EXODUS" OFF)
cmake_dependent_option(ENABLE_NETCDF "Enable HDF5" ${ENABLE_NETCF_DEFAULT}
cmake_dependent_option(ENABLE_NETCDF "Enable netcdf" ${ENABLE_NETCF_DEFAULT}
"ENABLE_EXODUS" OFF)
cmake_dependent_option(ENABLE_SZIP "Enable szip" ${ENABLE_SZIP_DEFAULT}
"ENABLE_HDF5" OFF)
Expand Down Expand Up @@ -136,6 +136,11 @@ else()
set(LEGION_BUILD_EXAMPLES ON)
endif()

option(HDF5_ENABLE_PARALLEL "enable parallel HDF5" OFF)
if(${LEGION_USE_HDF5} AND ${HDF5_ENABLE_PARALLEL})
message(FATAL_ERROR "LEGION_USE_HDF5 and HDF5_ENABLE_PARALLEL cannot both be set.")
endif()

option(ENABLE_CINCH_UTILS "Enable cinch-utils and dependencies" ON)

option(ENABLE_HPX "Enable HPX" OFF)
Expand Down
6 changes: 6 additions & 0 deletions cmake/hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ set(HDF5_URL ${PROJECT_SOURCE_DIR}/files)
set(HDF5_GZ hdf5-1.8.15-patch1.tar.gz)
set(HDF5_MD5 "4467c25ed9c0b126b194a4d9d66c29ac")

if(HDF5_ENABLE_PARALLEL)
find_package(MPI REQUIRED)
endif()

message(STATUS "Building ${HDF5_NAME}")
ExternalProject_Add(${HDF5_NAME}
DEPENDS ${ZLIB_PACKAGE_NAME} ${SZIP_PACKAGE_NAME}
Expand All @@ -22,9 +26,11 @@ ExternalProject_Add(${HDF5_NAME}
-DBUILD_TESTING:BOOL=OFF
-DHDF5_BUILD_HL_LIB:BOOL=ON
-DHDF5_BUILD_CPP_LIB:BOOL=OFF
-DHDF5_BUILD_EXAMPLES:BOOL=OFF
-DHDF5_BUILD_FORTRAN:BOOL=OFF
-DHDF5_BUILD_TOOLS:BOOL=OFF
-DHDF5_PACKAGE_EXTLIBS:BOOL=ON
-DHDF5_ENABLE_PARALLEL:BOOL=${HDF5_ENABLE_PARALLEL}
-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
-DZLIB_USE_EXTERNAL:STRING=ON
-DZLIB_FOUND:STRING=ON
Expand Down
7 changes: 6 additions & 1 deletion cmake/netcdf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ set(NETCDF_MD5 "5c9dad3705a3408d27f696e5b31fb88c" )

ExternalProject_get_property(${HDF5_NAME} INSTALL_DIR)
set(HDF5_INSTALL_DIR ${INSTALL_DIR})
if(HDF5_ENABLE_PARALLEL)
set(NETCDF_C_COMPILER ${MPI_C_COMPILER})
else()
set(NETCDF_C_COMPILER ${CMAKE_C_COMPILER})
endif()

message(STATUS "Building ${NETCDF_NAME}")
ExternalProject_Add(${NETCDF_NAME}
Expand All @@ -17,7 +22,7 @@ ExternalProject_Add(${NETCDF_NAME}
PATCH_COMMAND patch -p0 < ${PROJECT_SOURCE_DIR}/patches/netcdf.patch
CMAKE_ARGS
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_C_COMPILER:FILEPATH=${NETCDF_C_COMPILER}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS} ${SZIP_LIBRARY}
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
Expand Down