Skip to content

Commit cc53fea

Browse files
committed
Merge pull request #1621 from bgoglin/hwloc-for-2.0
linux: actually enable libudev based on the result of AC_CHECK_LIB
2 parents da695a6 + a2a721f commit cc53fea

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

opal/mca/hwloc/hwloc1112/hwloc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ bug fixes (and other actions) for each version of hwloc since version
1717
in v0.9.1).
1818

1919

20+
Version 1.11.4
21+
--------------
22+
* Fix Linux build with -m32 with respect to libudev.
23+
Thanks to Paul Hargrove for reporting the issue.
24+
25+
2026
Version 1.11.3
2127
--------------
2228
* Fix /proc/mounts parsing on Linux by using mntent.h.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Cherry-picked commits after 1.11.2:
22

33
open-mpi/hwloc@d2d07b9a2268699e13e1644b4f2ef7a53ef7396c
4+
open-mpi/hwloc@9549fd59af04dca2e2340e17f0e685f8c552d818

opal/mca/hwloc/hwloc1112/hwloc/config/hwloc.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,10 @@ EOF])
714714
# Linux libudev support
715715
if test "x$enable_libudev" != xno; then
716716
AC_CHECK_HEADERS([libudev.h], [
717-
AC_CHECK_LIB([udev], [udev_device_new_from_subsystem_sysname], [HWLOC_LIBS="$HWLOC_LIBS -ludev"])
717+
AC_CHECK_LIB([udev], [udev_device_new_from_subsystem_sysname], [
718+
HWLOC_LIBS="$HWLOC_LIBS -ludev"
719+
AC_DEFINE([HWLOC_HAVE_LIBUDEV], [1], [Define to 1 if you have libudev.])
720+
])
718721
])
719722
fi
720723

opal/mca/hwloc/hwloc1112/hwloc/src/topology-linux.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#ifdef HAVE_UNISTD_H
2828
#include <unistd.h>
2929
#endif
30-
#ifdef HAVE_LIBUDEV_H
30+
#ifdef HWLOC_HAVE_LIBUDEV
3131
#include <libudev.h>
3232
#endif
3333
#include <sys/types.h>
@@ -46,7 +46,7 @@ struct hwloc_linux_backend_data_s {
4646
char *root_path; /* NULL if unused */
4747
int root_fd; /* The file descriptor for the file system root, used when browsing, e.g., Linux' sysfs and procfs. */
4848
int is_real_fsroot; /* Boolean saying whether root_fd points to the real filesystem root of the system */
49-
#ifdef HAVE_LIBUDEV_H
49+
#ifdef HWLOC_HAVE_LIBUDEV
5050
struct udev *udev; /* Global udev context */
5151
#endif
5252
char *dumped_hwdata_dirname;
@@ -4596,7 +4596,7 @@ hwloc_linux_block_class_fillinfos(struct hwloc_backend *backend,
45964596
*tmp = '\0';
45974597
hwloc_obj_add_info(obj, "LinuxDeviceID", line);
45984598

4599-
#ifdef HAVE_LIBUDEV_H
4599+
#ifdef HWLOC_HAVE_LIBUDEV
46004600
if (data->udev) {
46014601
struct udev_device *dev;
46024602
const char *prop;
@@ -5106,7 +5106,7 @@ hwloc_linux_backend_disable(struct hwloc_backend *backend)
51065106
free(data->root_path);
51075107
close(data->root_fd);
51085108
#endif
5109-
#ifdef HAVE_LIBUDEV_H
5109+
#ifdef HWLOC_HAVE_LIBUDEV
51105110
if (data->udev)
51115111
udev_unref(data->udev);
51125112
#endif
@@ -5177,7 +5177,7 @@ hwloc_linux_component_instantiate(struct hwloc_disc_component *component,
51775177
#endif
51785178
data->root_fd = root;
51795179

5180-
#ifdef HAVE_LIBUDEV_H
5180+
#ifdef HWLOC_HAVE_LIBUDEV
51815181
data->udev = NULL;
51825182
if (data->is_real_fsroot) {
51835183
data->udev = udev_new();

0 commit comments

Comments
 (0)