Skip to content

Commit

Permalink
Merge pull request #63 from andrsd/hdf5-parallel-fix
Browse files Browse the repository at this point in the history
Fix compilation against parallel hdf5
  • Loading branch information
andrsd authored May 27, 2024
2 parents 18cbb66 + c9b190b commit 6db8200
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ include(Sanitization)
option(FPROPS_WITH_PYTHON "Build python wrapper" YES)
option(FPROPS_BUILD_TESTS "Build tests" NO)

set(HDF5_PREFER_PARALLEL YES)
find_package(HDF5 1.8 COMPONENTS C HL REQUIRED)
if (HDF5_IS_PARALLEL)
find_package(MPI REQUIRED)
endif()
find_package(Eigen3 3.3.4 REQUIRED)
find_package(fmt 8.0 REQUIRED)
if (FPROPS_WITH_PYTHON)
Expand All @@ -28,9 +32,9 @@ endif()

if (FPROPS_BUILD_TESTS)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
)
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
mark_as_advanced(FORCE
Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ target_include_directories(
${HDF5_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
)
if (HDF5_IS_PARALLEL)
target_include_directories(
libfprops
PRIVATE
${MPI_C_INCLUDE_DIRS}
)
endif()

target_link_libraries(
libfprops
Expand Down

0 comments on commit 6db8200

Please sign in to comment.