From a93a969eb54ae7bb620da2d7a5b8eded2fdd44f6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 6 Dec 2023 12:35:10 -0600 Subject: [PATCH] Do not link against several transitive dependencies of HDF5 (#2797) --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7269f4e632b..bf3555d8433 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,6 +155,11 @@ if(NOT DEFINED HDF5_PREFER_PARALLEL) endif() find_package(HDF5 REQUIRED COMPONENTS C HL) + +# Remove HDF5 transitive dependencies that are system libraries +list(FILTER HDF5_LIBRARIES EXCLUDE REGEX ".*lib(pthread|dl|m).*") +message(STATUS "HDF5 Libraries: ${HDF5_LIBRARIES}") + if(HDF5_IS_PARALLEL) if(NOT OPENMC_USE_MPI) message(FATAL_ERROR "Parallel HDF5 was detected, but MPI was not enabled.\