Skip to content

Commit

Permalink
Adding separate variables for HWLOC version and release
Browse files Browse the repository at this point in the history
Signed-off-by: Vedant <[email protected]>
  • Loading branch information
vrnimje committed Dec 11, 2023
1 parent fdec3ed commit ee9ace6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cmake/HPX_SetupHwloc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

# cmake-format: off
if(NOT HPX_WITH_FETCH_HWLOC)
find_package(Hwloc)
if(NOT Hwloc_FOUND)
Expand All @@ -22,14 +21,16 @@ if(NOT HPX_WITH_FETCH_HWLOC)
)
endif()
else()
set(HPX_WITH_HWLOC_VERSION "2.9")
set(HPX_WITH_HWLOC_RELEASE "2.9.3")
hpx_info(
"HPX_WITH_FETCH_HWLOC=${HPX_WITH_FETCH_HWLOC}, Hwloc will be fetched using CMake's FetchContent"
"HPX_WITH_FETCH_HWLOC=${HPX_WITH_FETCH_HWLOC}, Hwloc v${HPX_WITH_HWLOC_RELEASE} will be fetched using CMake's FetchContent"
)
if(UNIX)
include(FetchContent)
fetchcontent_declare(
HWLoc
URL https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.3.tar.gz
URL https://download.open-mpi.org/release/hwloc/v${HPX_WITH_HWLOC_VERSION}/hwloc-${HPX_WITH_HWLOC_RELEASE}.tar.gz
TLS_VERIFY true
)
if(NOT HWLoc_POPULATED)
Expand All @@ -52,7 +53,7 @@ else()
elseif("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win64")
fetchcontent_declare(
HWLoc
URL https://download.open-mpi.org/release/hwloc/v2.9/hwloc-win64-build-2.9.3.zip
URL https://download.open-mpi.org/release/hwloc/v${HPX_WITH_HWLOC_VERSION}/hwloc-win64-build-${HPX_WITH_HWLOC_RELEASE}.zip
TLS_VERIFY true
)
if(NOT HWLoc_POPULATED)
Expand All @@ -76,7 +77,7 @@ else()
else()
fetchcontent_declare(
HWLoc
URL https://download.open-mpi.org/release/hwloc/v2.9/hwloc-win64-build-2.9.3.zip
URL https://download.open-mpi.org/release/hwloc/v${HPX_WITH_HWLOC_VERSION}/hwloc-win32-build-${HPX_WITH_HWLOC_RELEASE}.zip
TLS_VERIFY true
)
if(NOT HWLoc_POPULATED)
Expand All @@ -96,12 +97,9 @@ else()
${HWLOC_ROOT}/lib/libhwloc.dll.a
CACHE INTERNAL ""
)
endif() # End hwloc installation
endif()

add_library(Hwloc::hwloc INTERFACE IMPORTED)
target_include_directories(Hwloc::hwloc INTERFACE ${Hwloc_INCLUDE_DIR})
target_link_libraries(Hwloc::hwloc INTERFACE ${Hwloc_LIBRARY})
message(${Hwloc_INCLUDE_DIR})
message(${Hwloc_LIBRARY})
endif()
# cmake-format: on

0 comments on commit ee9ace6

Please sign in to comment.