Skip to content

Commit 74df40b

Browse files
authored
Merge pull request #1239 from PatKamin/v0.11.x
[0.11.x] Disable hwloc in case of missing autoreconf
2 parents cbaf24a + 610c846 commit 74df40b

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

Diff for: CMakeLists.txt

+32-24
Original file line numberDiff line numberDiff line change
@@ -243,37 +243,45 @@ else()
243243
)
244244
endif()
245245

246-
if(UMF_DISABLE_HWLOC)
247-
message(STATUS "hwloc is disabled, hence OS provider, memtargets, "
248-
"topology discovery, examples won't be available!")
249-
else()
250-
if(NOT DEFINED UMF_HWLOC_REPO)
251-
set(UMF_HWLOC_REPO "https://github.com/open-mpi/hwloc.git")
246+
if(NOT UMF_DISABLE_HWLOC AND (NOT UMF_LINK_HWLOC_STATICALLY))
247+
pkg_check_modules(LIBHWLOC hwloc>=2.3.0)
248+
if(NOT LIBHWLOC_FOUND)
249+
find_package(LIBHWLOC 2.3.0 COMPONENTS hwloc)
250+
if(LIBHWLOC_LIBRARIES)
251+
set(LIBHWLOC_AVAILABLE TRUE)
252+
endif()
252253
endif()
253254

254-
if(NOT DEFINED UMF_HWLOC_TAG)
255-
set(UMF_HWLOC_TAG hwloc-2.10.0)
255+
if(LIBHWLOC_AVAILABLE OR LIBHWLOC_FOUND)
256+
# add PATH to DLL on Windows
257+
set(DLL_PATH_LIST
258+
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}")
259+
else()
260+
set(UMF_LINK_HWLOC_STATICALLY ON)
256261
endif()
262+
endif()
257263

258-
if(NOT UMF_LINK_HWLOC_STATICALLY)
259-
pkg_check_modules(LIBHWLOC hwloc>=2.3.0)
260-
if(NOT LIBHWLOC_FOUND)
261-
find_package(LIBHWLOC 2.3.0 COMPONENTS hwloc)
262-
if(LIBHWLOC_LIBRARIES)
263-
set(LIBHWLOC_AVAILABLE TRUE)
264-
endif()
265-
endif()
266-
267-
if(LIBHWLOC_AVAILABLE OR LIBHWLOC_FOUND)
268-
# add PATH to DLL on Windows
269-
set(DLL_PATH_LIST
270-
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}")
271-
else()
272-
set(UMF_LINK_HWLOC_STATICALLY ON)
273-
endif()
264+
if(UMF_LINK_HWLOC_STATICALLY AND LINUX)
265+
find_program(AUTORECONF_EXECUTABLE autoreconf)
266+
if(NOT AUTORECONF_EXECUTABLE)
267+
message(WARNING "autoreconf is not installed. Disabling hwloc.")
268+
set(UMF_DISABLE_HWLOC ON)
269+
set(UMF_LINK_HWLOC_STATICALLY OFF)
274270
endif()
271+
endif()
275272

273+
if(UMF_DISABLE_HWLOC)
274+
message(STATUS "hwloc is disabled, hence OS provider, memtargets, "
275+
"topology discovery, examples won't be available!")
276+
else()
276277
if(UMF_LINK_HWLOC_STATICALLY)
278+
if(NOT DEFINED UMF_HWLOC_REPO)
279+
set(UMF_HWLOC_REPO "https://github.com/open-mpi/hwloc.git")
280+
endif()
281+
282+
if(NOT DEFINED UMF_HWLOC_TAG)
283+
set(UMF_HWLOC_TAG hwloc-2.10.0)
284+
endif()
277285
message(
278286
STATUS
279287
"Will fetch hwloc from ${UMF_HWLOC_REPO} (tag: ${UMF_HWLOC_TAG})"

0 commit comments

Comments
 (0)