Skip to content

Commit 1978ab8

Browse files
committed
configury: misc fixes
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 331fd6c commit 1978ab8

File tree

2 files changed

+61
-55
lines changed

2 files changed

+61
-55
lines changed

opal/mca/event/external/configure.m4

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ AC_DEFUN([MCA_opal_event_external_POST_CONFIG],[
5656
AC_DEFUN([MCA_opal_event_external_CONFIG],[
5757
AC_CONFIG_FILES([opal/mca/event/external/Makefile])
5858

59-
OPAL_VAR_SCOPE_PUSH([opal_event_external_CPPFLAGS_save opal_event_external_CFLAGS_save opal_event_external_LDFLAGS_save opal_event_external_LIBS_save opal_event_dir opal_event_external_support])
59+
OPAL_VAR_SCOPE_PUSH([opal_event_external_CPPFLAGS_save opal_event_external_CFLAGS_save opal_event_external_LDFLAGS_save opal_event_external_LIBS_save opal_event_dir opal_event_external_support opal_event_summary_msg])
6060

6161
# Make some processing below easier ($with_libevent==yes and
6262
# $with_libevent==no has already been filtered out).
6363
AS_IF([test "$with_libevent" = "external"],
6464
[with_libevent=])
6565

66+
opal_event_summary_msg="internal"
67+
6668
# Once we get to this point, $with_libevent is either: blank, a
6769
# directory location, or "internal".
6870

@@ -153,9 +155,11 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[
153155
]])],
154156
[AC_MSG_RESULT([yes])],
155157
[AC_MSG_RESULT([no])
158+
opal_event_summary_msg="internal (external libevent version is less that internal version 2.0.21)"
156159
AC_MSG_WARN([external libevent version is less than internal version (2.0.21)])
157160
AC_MSG_WARN([using internal libevent])
158161
opal_hwloc_external_support=no])])
162+
159163
CPPFLAGS=$opal_event_external_CPPFLAGS_save
160164
CFLAGS=$opal_event_external_CFLAGS_save
161165
LDFLAGS=$opal_event_external_LDFLAGS_save
@@ -185,12 +189,15 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[
185189
# what it is in the installed libevent :-\ ).
186190
file=$opal_event_dir/include/libevent/config.h
187191
OPAL_HAVE_WORKING_EVENTOPS=1
192+
opal_event_summary_msg="external"
188193
$1],
189194
[OPAL_HAVE_WORKING_EVENTOPS=0
190195
AS_IF([test "$with_libevent" != internal && test -n "$with_libevent"],
191196
[AC_MSG_WARN([external libevent requested but cannot be built])
192197
AC_MSG_ERROR([Cannot continue.])])
193198
$2])
194199

200+
OPAL_SUMMARY_ADD([[Miscellaneous]],[[Libevent support]], [], [$opal_event_summary_msg])
201+
195202
OPAL_VAR_SCOPE_POP
196203
])dnl

opal/mca/hwloc/external/configure.m4

Lines changed: 53 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ AC_DEFUN([MCA_opal_hwloc_external_POST_CONFIG],[
8484
AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
8585
AC_CONFIG_FILES([opal/mca/hwloc/external/Makefile])
8686

87-
OPAL_VAR_SCOPE_PUSH([opal_hwloc_external_CPPFLAGS_save opal_hwloc_external_CFLAGS_save opal_hwloc_external_LDFLAGS_save opal_hwloc_external_LIBS_save opal_hwloc_external_want opal_hwloc_external_tmp opal_hwloc_external_lstopo])
87+
OPAL_VAR_SCOPE_PUSH([opal_hwloc_external_CPPFLAGS_save opal_hwloc_external_CFLAGS_save opal_hwloc_external_LDFLAGS_save opal_hwloc_external_LIBS_save opal_hwloc_external_tmp opal_hwloc_external_lstopo opal_hwloc_summary_msg])
8888

8989
AC_ARG_WITH([hwloc-libdir],
9090
[AC_HELP_STRING([--with-hwloc-libdir=DIR],
@@ -98,16 +98,9 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
9898
AC_MSG_WARN([were specified, which does not make sense.])
9999
AC_MSG_ERROR([Cannot continue])])
100100

101-
# Do we want this external component? (slightly redundant logic,
102-
# but hopefully slightly more clear...)
103-
opal_hwloc_external_want=no
104-
AS_IF([test "$with_hwloc_libdir" != ""], [opal_hwloc_external_want=yes])
105-
AS_IF([test "$with_hwloc" = "internal"],
106-
[opal_hwloc_external_want=no],
107-
[opal_hwloc_external_want=yes])
108-
109-
# If we still want external support, try it
110-
AS_IF([test "$opal_hwloc_external_want" = "yes"],
101+
opal_hwloc_summary_msg="internal"
102+
# Try external support if needed
103+
AS_IF([test "$with_hwloc" != "internal"],
111104
[OPAL_CHECK_WITHDIR([hwloc-libdir], [$with_hwloc_libdir],
112105
[libhwloc.*])
113106

@@ -141,10 +134,9 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
141134
LDFLAGS="$LDFLAGS $opal_hwloc_external_LDFLAGS"
142135
LIBS="$LIBS $opal_hwloc_external_LIBS"
143136
AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include <hwloc.h>])
144-
AC_CHECK_FUNCS([hwloc_topology_dup])])
137+
AC_CHECK_FUNCS([hwloc_topology_dup])
145138

146-
AS_IF([test "$opal_hwloc_external_support" = "yes"],
147-
[AC_MSG_CHECKING([if external hwloc version is 1.5 or greater])
139+
AC_MSG_CHECKING([if external hwloc version is 1.5 or greater])
148140
AC_COMPILE_IFELSE(
149141
[AC_LANG_PROGRAM([[#include <hwloc.h>]],
150142
[[
@@ -156,6 +148,8 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
156148
[AC_MSG_RESULT([no])
157149
opal_hwloc_external_support=no])])
158150

151+
# If external hwloc is not explicitly requested, check external version
152+
# is not lower than the internal one
159153
AS_IF([test "$opal_hwloc_external_support" = "yes" &&
160154
test -z "$with_hwloc"],
161155
[AC_MSG_CHECKING([if external hwloc version is 2.0 or greater])
@@ -168,53 +162,58 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
168162
]])],
169163
[AC_MSG_RESULT([yes])],
170164
[AC_MSG_RESULT([no])
171-
AC_MSG_WARN([external hwloc version is less than internal version (2.0)])
165+
opal_hwloc_summary_msg="internal (external hlwoc version is less than internal version 2.0)"
166+
AC_MSG_WARN([external hwloc version is less than internal version 2.0])
172167
AC_MSG_WARN([using internal hwloc])
173168
opal_hwloc_external_support=no])])
174-
CPPFLAGS=$opal_hwloc_external_CPPFLAGS_save
175-
CFLAGS=$opal_hwloc_external_CFLAGS_save
176-
LDFLAGS=$opal_hwloc_external_LDFLAGS_save
177-
LIBS=$opal_hwloc_external_LIBS_save
169+
170+
AS_IF([test "$opal_hwloc_external_support" = "yes"],
171+
[AC_DEFINE_UNQUOTED([HWLOC_EXTERNAL_HWLOC_VERSION],
172+
[external],
173+
[Version of hwloc])
174+
175+
# See if the external hwloc supports XML
176+
AC_MSG_CHECKING([if external hwloc supports XML])
177+
AS_IF([test "$opal_hwloc_dir" != ""],
178+
[opal_hwloc_external_lstopo="$opal_hwloc_dir/bin/lstopo"],
179+
[OPAL_WHICH(lstopo, opal_hwloc_external_lstopo)])
180+
opal_hwloc_external_tmp=`$opal_hwloc_external_lstopo --help | $GREP "Supported output file formats" | grep xml`
181+
AS_IF([test "$opal_hwloc_external_tmp" = ""],
182+
[opal_hwloc_external_enable_xml=0
183+
AC_MSG_RESULT([no])],
184+
[opal_hwloc_external_enable_xml=1
185+
AC_MSG_RESULT([yes])])
186+
187+
AC_CHECK_HEADERS([infiniband/verbs.h])
188+
189+
# These flags need to get passed to the wrapper compilers
190+
# (this is unnecessary for the internal/embedded hwloc)
191+
192+
# Finally, add some flags to the wrapper compiler if we're
193+
# building with developer headers so that our headers can
194+
# be found.
195+
hwloc_external_WRAPPER_EXTRA_CPPFLAGS=$opal_hwloc_external_CPPFLAGS
196+
hwloc_external_WRAPPER_EXTRA_LDFLAGS=$opal_hwloc_external_LDFLAGS
197+
hwloc_external_WRAPPER_EXTRA_LIBS=$opal_hwloc_external_LIBS])
198+
199+
CPPFLAGS=$opal_hwloc_external_CPPFLAGS_save
200+
CFLAGS=$opal_hwloc_external_CFLAGS_save
201+
LDFLAGS=$opal_hwloc_external_LDFLAGS_save
202+
LIBS=$opal_hwloc_external_LIBS_save
178203
])
179204

180205
# Done!
181206
AS_IF([test "$opal_hwloc_external_support" = "yes"],
182-
[AC_DEFINE_UNQUOTED([HWLOC_EXTERNAL_HWLOC_VERSION],
183-
[external],
184-
[Version of hwloc])
185-
186-
# See if the external hwloc supports XML
187-
AC_MSG_CHECKING([if external hwloc supports XML])
188-
AS_IF([test "$opal_hwloc_dir" != ""],
189-
[opal_hwloc_external_lstopo="$opal_hwloc_dir/bin/lstopo"],
190-
[OPAL_WHICH(lstopo, opal_hwloc_external_lstopo)])
191-
opal_hwloc_external_tmp=`$opal_hwloc_external_lstopo --help | $GREP "Supported output file formats" | grep xml`
192-
AS_IF([test "$opal_hwloc_external_tmp" = ""],
193-
[opal_hwloc_external_enable_xml=0
194-
AC_MSG_RESULT([no])],
195-
[opal_hwloc_external_enable_xml=1
196-
AC_MSG_RESULT([yes])])
197-
198-
AC_CHECK_HEADERS([infiniband/verbs.h])
199-
200-
AS_IF([test "$opal_hwloc_dir" != ""],
201-
[opal_hwloc_external_CFLAGS_save=$CFLAGS
202-
CFLAGS="-I$opal_hwloc_dir/include $opal_hwloc_external_CFLAGS_save"])
203-
AS_IF([test "$opal_hwloc_dir" != ""],
204-
[CFLAGS=$opal_hwloc_external_CFLAGS_save])
205-
206-
# These flags need to get passed to the wrapper compilers
207-
# (this is unnecessary for the internal/embedded hwloc)
208-
209-
# Finally, add some flags to the wrapper compiler if we're
210-
# building with developer headers so that our headers can
211-
# be found.
212-
hwloc_external_WRAPPER_EXTRA_CPPFLAGS=$opal_hwloc_external_CPPFLAGS
213-
hwloc_external_WRAPPER_EXTRA_LDFLAGS=$opal_hwloc_external_LDFLAGS
214-
hwloc_external_WRAPPER_EXTRA_LIBS=$opal_hwloc_external_LIBS
215-
207+
[opal_hwloc_summary_msg="external"
216208
$1],
217-
[$2])
209+
[# Abort is external hwloc was explicitly requested but cannot be built
210+
AS_IF([test "$with_hwloc" != internal &&
211+
test -n "$with_hwloc"],
212+
[AC_MSG_WARN([external hwloc cannot be built])
213+
AC_MSG_ERROR([Cannot continue.])])
214+
$2])
215+
216+
OPAL_SUMMARY_ADD([[Miscellaneous]],[[HWLOC support]], [], [$opal_hwloc_summary_msg])
218217

219218
AC_SUBST(opal_hwloc_external_LDFLAGS)
220219
AC_SUBST(opal_hwloc_external_LIBS)

0 commit comments

Comments
 (0)