Skip to content

Commit 41a048f

Browse files
committed
Disable hwloc in case of missing autoreconf
Search for autoreconf package in the system before trying to fetch and build the hwloc library.
1 parent e3d2929 commit 41a048f

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
@@ -245,37 +245,45 @@ else()
245245
)
246246
endif()
247247

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

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

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

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

0 commit comments

Comments
 (0)