Skip to content
Snippets Groups Projects
Commit ccb3939d authored by Lars Bilke's avatar Lars Bilke Committed by Dmitri Naumov
Browse files

[cmake] Check for hdf5 mpi config at cmake time.

parent 4fcc8bb8
No related branches found
No related tags found
No related merge requests found
......@@ -212,19 +212,31 @@ else()
EXCLUDE_FROM_ALL YES
)
if(HDF5_ADDED)
target_include_directories(hdf5-static INTERFACE ${HDF5_BINARY_DIR})
list(APPEND DISABLE_WARNINGS_TARGETS hdf5-static)
set(HDF5_LIBRARIES hdf5-static)
if(ZLIB_ADDED)
list(APPEND HDF5_LIBRARIES zlibstatic)
endif()
set(HDF5_C_INCLUDE_DIR ${HDF5_SOURCE_DIR})
set(HDF5_INCLUDE_DIR ${HDF5_SOURCE_DIR})
set(HDF5_C_INCLUDE_DIR ${HDF5_SOURCE_DIR}/src)
set(HDF5_INCLUDE_DIR ${HDF5_SOURCE_DIR}/src)
target_include_directories(hdf5-static INTERFACE ${HDF5_BINARY_DIR} ${HDF5_INCLUDE_DIR})
else()
find_package(HDF5 REQUIRED)
endif()
endif()
if(OGS_USE_PETSC)
include(CheckCXXSymbolExists)
set(CMAKE_REQUIRED_INCLUDES "${HDF5_INCLUDE_DIR}" "${HDF5_BINARY_DIR}")
set(CMAKE_REQUIRED_LIBRARIES "${HDF5_LIBRARIES}")
check_cxx_symbol_exists(H5Pset_fapl_mpio hdf5.h HAVE_H5Pset_fapl_mpio)
unset(CMAKE_REQUIRED_INCLUDES)
if(NOT HAVE_H5Pset_fapl_mpio)
message(FATAL_ERROR "HDF5 was not build with MPI support! "
"(Enable with HDF5_ENABLE_PARALLEL)")
endif()
endif()
# Does not compile in Debug-mode, see #3175.
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND OGS_BUILD_TESTING)
set(XDMF_LIBNAME OgsXdmf CACHE STRING "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment