From 9f4e8e76541bb097babd7d7769fe27274d340705 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Fri, 23 Feb 2024 04:36:30 -0600 Subject: [PATCH] Use pkgconfig libelf --- CMakeLists.txt | 7 +++---- hermes_adapters/mpiio/CMakeLists.txt | 3 ++- hermes_adapters/posix/CMakeLists.txt | 2 +- hermes_adapters/stdio/CMakeLists.txt | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b0c831af..fa9839bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,10 +170,9 @@ include_directories(${Boost_INCLUDE_DIRS}) message("Boost: ${Boost_LIBRARIES}") # Libelf -find_package(LibElf REQUIRED) -if(LibElf_FOUND) - message(STATUS "found libelf at ${LibElf_INCLUDE_DIRS}") -endif() +pkg_check_modules(libelf REQUIRED libelf) +message(STATUS "found libelf at ${libelf_INCLUDE_DIRS}") +include_directories(${libelf_INCLUDE_DIRS}) # HDF5 if(HERMES_ENABLE_VFD) diff --git a/hermes_adapters/mpiio/CMakeLists.txt b/hermes_adapters/mpiio/CMakeLists.txt index b7b58a3cd..b6430fceb 100644 --- a/hermes_adapters/mpiio/CMakeLists.txt +++ b/hermes_adapters/mpiio/CMakeLists.txt @@ -18,7 +18,8 @@ set(INTERCEPTOR_DEPS add_library(hermes_mpiio SHARED ${CMAKE_CURRENT_SOURCE_DIR}/mpiio_api.cc) add_dependencies(hermes_mpiio ${INTERCEPTOR_DEPS}) -target_link_libraries(hermes_mpiio MPI::MPI_CXX stdc++fs elf dl ${INTERCEPTOR_DEPS}) +target_link_libraries(hermes_mpiio + MPI::MPI_CXX stdc++fs ${libelf_LIBRARIES} dl ${INTERCEPTOR_DEPS}) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install diff --git a/hermes_adapters/posix/CMakeLists.txt b/hermes_adapters/posix/CMakeLists.txt index f9158760a..d51640f46 100644 --- a/hermes_adapters/posix/CMakeLists.txt +++ b/hermes_adapters/posix/CMakeLists.txt @@ -11,7 +11,7 @@ set(INTERCEPTOR_DEPS add_library(hermes_posix SHARED ${CMAKE_CURRENT_SOURCE_DIR}/posix_api.cc) add_dependencies(hermes_posix ${INTERCEPTOR_DEPS}) -target_link_libraries(hermes_posix MPI::MPI_CXX stdc++fs elf dl ${INTERCEPTOR_DEPS}) +target_link_libraries(hermes_posix MPI::MPI_CXX stdc++fs ${libelf_LIBRARIES} dl ${INTERCEPTOR_DEPS}) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install diff --git a/hermes_adapters/stdio/CMakeLists.txt b/hermes_adapters/stdio/CMakeLists.txt index 7c9e23411..38e981fdd 100644 --- a/hermes_adapters/stdio/CMakeLists.txt +++ b/hermes_adapters/stdio/CMakeLists.txt @@ -11,7 +11,7 @@ set(INTERCEPTOR_DEPS add_library(hermes_stdio SHARED ${CMAKE_CURRENT_SOURCE_DIR}/stdio_api.cc) add_dependencies(hermes_stdio ${INTERCEPTOR_DEPS}) -target_link_libraries(hermes_stdio MPI::MPI_CXX stdc++fs elf dl ${INTERCEPTOR_DEPS}) +target_link_libraries(hermes_stdio MPI::MPI_CXX stdc++fs ${libelf_LIBRARIES} dl ${INTERCEPTOR_DEPS}) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install