mvapich2/mvapich2-allow-building-with-external-hwloc.patch

71 lines
2.4 KiB
Diff

commit 2a05bb1eba231f7b95ddb3fdeec21146b99e43f1
Author: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Date: Wed Jul 6 15:21:38 2022 +0200
mvapich2: allow building with external hwloc
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
diff --git Makefile.am Makefile.am
index 17788bb3ba49..c8cfeb941de7 100644
--- Makefile.am
+++ Makefile.am
@@ -203,9 +203,11 @@ if BUILD_OSU_MVAPICH
if BUILD_HWLOC_v1
SUBDIRS += contrib/hwloc_v1
else
+if BUILD_HWLOC_v2
SUBDIRS += contrib/hwloc_v2
endif
endif
+endif
# build the current directory and then the examples directory after everything else
SUBDIRS += . examples
@@ -222,8 +224,12 @@ if BUILD_HWLOC_v1
AM_CPPFLAGS += -Icontrib/hwloc_v1/include/ -I$(top_srcdir)/contrib/hwloc_v1/include
lib_lib@MPILIBNAME@_la_LIBADD += contrib/hwloc_v1/src/libhwloc_embedded.la
else
+if BUILD_HWLOC_v2
AM_CPPFLAGS += -Icontrib/hwloc_v2/include/ -I$(top_srcdir)/contrib/hwloc_v2/include
-lib_lib@MPILIBNAME@_la_LIBADD += contrib/hwloc_v2/hwloc/libhwloc_embedded.la
+lib_lib@MPILIBNAME@_la_LIBADD += contrib/hwloc_v2/src/libhwloc_embedded.la
+else
+lib_lib@MPILIBNAME@_la_LDFLAGS += -lhwloc
+endif
endif
endif
diff --git configure.ac configure.ac
index d073cb1bef5e..b82de7a9a5fb 100644
--- configure.ac
+++ configure.ac
@@ -539,18 +539,24 @@ dnl based on the environment.
AC_ARG_WITH(hwloc,
AC_HELP_STRING([--with-hwloc=version],
[Specify the hwloc version to use with MVAPICH2
- (Options: v1, v2) (Default: v1)]),,
+ (Options: v1, v2, external) (Default: v1)]),,
with_hwloc=v1)
AM_CONDITIONAL([BUILD_HWLOC_v1], [test x$with_hwloc = xv1])
AM_CONDITIONAL([BUILD_HWLOC_v2], [test x$with_hwloc = xv2])
+AM_CONDITIONAL([BUILD_HWLOC_EXT], [test x$with_hwloc = xexternal])
if test "$with_hwloc" = "v1" ; then
AC_CONFIG_SUBDIRS([contrib/hwloc_v1])
AC_DEFINE([_USE_HWLOC_V1_], 1, [Define when using HWLOC V1])
else
- AC_CONFIG_SUBDIRS([contrib/hwloc_v2])
- AC_DEFINE([_USE_HWLOC_V2_], 1, [Define when using HWLOC V2])
+ if test "$with_hwloc" = "v2" ; then
+ AC_CONFIG_SUBDIRS([contrib/hwloc_v2])
+ AC_DEFINE([_USE_HWLOC_V2_], 1, [Define when using HWLOC V2])
+ else
+ AC_DEFINE([_USE_HWLOC_EXT_], 1, [Define when using HWLOC External])
+ AC_DEFINE([_USE_HWLOC_V2_], 1, [Define when using HWLOC V2])
+ fi
fi
AC_ARG_WITH(device,