Commit 452cfde9 authored by Ben Boeckel's avatar Ben Boeckel

hdf5: link against MPI if a parallel HDF5 is found

See paraview/paraview#16814.
parent a8b6746b
......@@ -5,6 +5,17 @@ else()
endif()
if(VTK_USE_SYSTEM_HDF5)
set(vtkhdf5_LIBRARIES ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
if(NOT HDF5_IS_PARALLEL)
include(CheckSymbolExists)
set(CMAKE_REQUIRED_INCLUDES ${HDF5_INCLUDE_DIRS})
check_symbol_exists(H5_HAVE_PARALLEL hdf5.h HDF5_IS_PARALLEL)
unset(CMAKE_REQUIRED_INCLUDES)
endif()
if (HDF5_IS_PARALLEL)
include(vtkMPI)
list(APPEND vtkhdf5_LIBRARIES
${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES})
endif ()
endif()
vtk_module(vtkhdf5
EXCLUDE_FROM_WRAPPING
......
......@@ -38,23 +38,10 @@ if(EXISTS "${HDF5_CONFIG}")
add_definitions(${HDF5_EXTRA_FLAGS})
endif()
# Some HDF5 configurations don't properly detect parallel support so
# we need to do it manually ourselves
if(NOT HDF5_IS_PARALLEL)
include(CheckSymbolExists)
set(CMAKE_REQUIRED_INCLUDES ${XDMF_HDF5_INCLUDE_DIRS})
check_symbol_exists(H5_HAVE_PARALLEL hdf5.h HDF5_IS_PARALLEL)
unset(CMAKE_REQUIRED_INCLUDES)
endif()
#optional dependencies
#MPI
option(XDMF_BUILD_MPI "XDMF should use MPI" OFF)
mark_as_advanced(XDMF_BUILD_MPI)
if(HDF5_IS_PARALLEL AND NOT XDMF_BUILD_MPI)
message(STATUS "Xdmf2: Enabling MPI since a parallel HDF5 is being used.")
set(XDMF_BUILD_MPI ON)
endif()
if (XDMF_BUILD_MPI)
find_package(MPI REQUIRED)
include_directories(${MPI_C_INCLUDE_PATH})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment