Skip to content

Commit

Permalink
Adapt hwloc to the new scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
tcojean committed Aug 8, 2023
1 parent 1d26b71 commit df8b21c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 8 additions & 12 deletions third_party/hwloc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
message(STATUS "Configuring and building HWLOC")
set(TPL_HWLOC_PATH "${PROJECT_BINARY_DIR}/third_party/hwloc")
set(TPL_HWLOC_PATH "${PROJECT_BINARY_DIR}/third_party/hwloc/src")
ginkgo_load_and_configure_package(hwloc_external "https://download.open-mpi.org/release/hwloc/v2.4/hwloc-2.4.1.tar.gz"
"SHA1=b94950e8958e1125ca75ecac0bc0259ee3d108c4"
""
"${TPL_HWLOC_PATH}/src/configure" "--disable-nvml" "--disable-cuda" "--disable-rsmi"
"${TPL_HWLOC_PATH}"
"./configure" "--prefix=${TPL_HWLOC_PATH}/install"
"--disable-nvml" "--disable-cuda" "--disable-rsmi"
)

add_library(hwloc SHARED IMPORTED GLOBAL)
add_dependencies(hwloc hwloc_external)
file(MAKE_DIRECTORY ${TPL_HWLOC_PATH}/lib/)
file(GLOB HWLOC_LIBS "${TPL_HWLOC_PATH}/build/hwloc/.libs/libhwloc.so*")
configure_file("${TPL_HWLOC_PATH}/build/include/hwloc/autogen/config.h" "${TPL_HWLOC_PATH}/src/include/hwloc/autogen/config.h" COPYONLY)
foreach(lib ${HWLOC_LIBS})
get_filename_component(lib_name ${lib} NAME)
configure_file("${lib}" "${TPL_HWLOC_PATH}/lib/${lib_name}" COPYONLY)
endforeach()
# NOTE: if changing this (e.g. to `.a`), please update the special case in
# `cmake/information_helpers.cmake`
set(HWLOC_LIBRARIES "${TPL_HWLOC_PATH}/lib/libhwloc.so" CACHE FILEPATH "The path to HWLOC library libhwloc.so" FORCE)
set(HWLOC_INCLUDE_DIRS "${TPL_HWLOC_PATH}/src/include" CACHE PATH "The directory containing the hwloc header, hwloc.h" FORCE)
set(HWLOC_LIBRARIES "${TPL_HWLOC_PATH}/install/lib/libhwloc.so"
CACHE FILEPATH "The path to HWLOC library libhwloc.so" FORCE)
set(HWLOC_INCLUDE_DIRS "${TPL_HWLOC_PATH}/install/include"
CACHE PATH "The directory containing the hwloc header, hwloc.h" FORCE)
set_target_properties(hwloc PROPERTIES IMPORTED_LOCATION ${HWLOC_LIBRARIES})
set_target_properties(hwloc PROPERTIES INTERFACE_LINK_LIBRARIES ${HWLOC_LIBRARIES})
set_target_properties(hwloc PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HWLOC_INCLUDE_DIRS}")
4 changes: 2 additions & 2 deletions third_party/papi_sde/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ginkgo_load_and_configure_package(papi_external
"SHA1=540c18a14eeafb83cd60cbbf0a96706111dbff3b"
"${TPL_PAPI_PATH}/src"
"./configure" "--prefix=${TPL_PAPI_PATH}/install"
"--with-components=sde" "--with-libsde=yes" "--with-tests=no"
"--with-static-lib=no" "--with-shared-lib=yes"
"--with-components=sde" "--with-libsde=yes" "--with-tests=no"
"--with-static-lib=no" "--with-shared-lib=yes"
)

add_library(PAPI SHARED IMPORTED GLOBAL)
Expand Down

0 comments on commit df8b21c

Please sign in to comment.