SHA256
1
0
forked from pool/mvapich2
mvapich2/mvapich2-allow-building-with-external-hwloc.patch
Nicolas Morey-Chaisemartin a2cc0110fb Accepting request 1007634 from home:NMoreyChaisemartin:branches:science:HPC
- Add mvapich2-allow-building-with-external-hwloc.patch
  to allow building against an external hwloc library
- Build mvapich2 HPC flavors against pmix and hwloc system libraries

OBS-URL: https://build.opensuse.org/request/show/1007634
OBS-URL: https://build.opensuse.org/package/show/science:HPC/mvapich2?expand=0&rev=89
2022-10-03 07:36:57 +00:00

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,