Skip to content

Commit d2c36f2

Browse files
authored
Merge pull request #9736 from awlauria/mca_direct_v5
v5.0.x: configure: fix --enable-mca-direct
2 parents d12fa38 + d390771 commit d2c36f2

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

config/opal_mca.m4

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ AC_DEFUN([OPAL_MCA],[
9595
if test "$enable_mca_no_build" = "yes"; then
9696
AC_MSG_RESULT([yes])
9797
AC_MSG_ERROR([*** The enable-mca-no-build flag requires an explicit list
98-
*** of type-component pairs. For example, --enable-mca-no-build=pml-ob1])
98+
of type-component pairs. For example, --enable-mca-no-build=pml-ob1])
9999
else
100100
ifs_save="$IFS"
101101
IFS="${IFS}$PATH_SEPARATOR,"
@@ -125,11 +125,7 @@ AC_DEFUN([OPAL_MCA],[
125125
# in the form DIRECT_[type]=[component]
126126
#
127127
AC_MSG_CHECKING([which components should be direct-linked into the library])
128-
if test "$enable_mca_direct" = "yes" ; then
129-
AC_MSG_RESULT([yes])
130-
AC_MSG_ERROR([*** The enable-mca-direct flag requires an explicit list of
131-
*** type-component pairs. For example, --enable-mca-direct=pml-ob1,coll-basic])
132-
elif test ! -z "$enable_mca_direct" && test "$enable_mca_direct" != "" ; then
128+
if test -n "$enable_mca_direct" ; then
133129
#
134130
# we need to add this into the static list, unless the static list
135131
# is everything
@@ -147,15 +143,21 @@ AC_DEFUN([OPAL_MCA],[
147143
IFS="${IFS}$PATH_SEPARATOR,"
148144
msg=
149145
for item in $enable_mca_direct; do
150-
type="`echo $item | cut -f1 -d-`"
151-
comp="`echo $item | cut -f2- -d-`"
146+
type="`echo $item | cut -s -f1 -d-`"
147+
comp="`echo $item | cut -s -f2- -d-`"
152148
if test -z $type || test -z $comp ; then
153-
AC_MSG_ERROR([*** The enable-mca-direct flag requires a
154-
*** list of type-component pairs. Invalid input detected.])
155-
else
156-
AS_VAR_SET([AS_TR_SH([DIRECT_$type])], [AS_TR_SH([$comp])])
157-
msg="$item $msg"
149+
AC_MSG_ERROR([enable-mca-direct requires a list of type-component pairs (ex. --enable-mca-direct=pml-ob1,smsc-xpmem)])
158150
fi
151+
152+
var_name=AS_TR_SH([DIRECT_${type}])
153+
AS_VAR_COPY([var_value], [$var_name])
154+
155+
if test -n "$var_value" ; then
156+
AC_MSG_ERROR([enable-mca-direct can only enable a single component per framwork: specified both ${type}-${var_value} and ${type}-${comp}.])
157+
fi
158+
159+
AS_VAR_SET([$var_name], AS_TR_SH([${comp}]))
160+
msg="$item $msg"
159161
done
160162
IFS="$ifs_save"
161163
fi
@@ -458,6 +460,18 @@ AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
458460
[static_components], [dso_components],
459461
[static_ltlibs])])])])])
460462
463+
AS_VAR_SET_IF([OPAL_EVAL_ARG([DIRECT_$2])], [
464+
AC_MSG_CHECKING([if direct-selection component exists for $2 framework])
465+
direct_component_happy=no
466+
for component in $all_components ; do
467+
AS_IF([test $component = "$DIRECT_$2"], [direct_component_happy=yes])
468+
done
469+
if test $direct_component_happy = no ; then
470+
AC_MSG_ERROR([direct component $DIRECT_$2 requested but not found in $all_components])
471+
fi
472+
AC_MSG_RESULT([$DIRECT_$2])
473+
])
474+
461475
MCA_$1_$2_ALL_COMPONENTS="$all_components"
462476
MCA_$1_$2_STATIC_COMPONENTS="$static_components"
463477
MCA_$1_$2_DSO_COMPONENTS="$dso_components"

opal/util/minmax.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#ifndef OPAL_MINMAX_H
1717
#define OPAL_MINMAX_H
1818

19+
#include "opal_stdint.h"
20+
1921
#define OPAL_DEFINE_MINMAX(type, suffix) \
2022
static inline const type opal_min_##suffix(const type a, const type b) \
2123
{ \

0 commit comments

Comments
 (0)