1
1

Fix LSF configure check for libevent conflict

* Want to make sure that the result from `wc` is trimmed of spaces,
   so the `0` check returns properly
 * Add a few more comments, and fix wording in the warning message.

Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
This commit is contained in:
Joshua Hursey 2020-05-18 15:10:46 -04:00
parent 7dba35f785
commit 76500e6cf8

View File

@ -144,21 +144,25 @@ AC_DEFUN([ORTE_CHECK_LSF],[
# If the external libevent component used 'event_core' instead of 'event'
orte_check_lsf_event_conflict=na
# Split libs into an array, see if -levent is in that list
orte_check_lsf_libevent_present=`echo $LIBS | awk '{split([$]0, a, " "); {for (k in a) {if (a[[k]] == "-levent") {print a[[k]]}}}}' | wc -l`
orte_check_lsf_libevent_present=`echo "$LIBS" | awk '{split([$]0, a, " "); {for (k in a) {if (a[[k]] == "-levent") {print a[[k]]}}}}' | wc -l | tr -d '[[:space:]]'`
# (1) LSF check must have failed above. We need to know why...
AS_IF([test "$orte_check_lsf_happy" = "no"],
[AS_IF([test "$opal_event_external_support" = "yes" && test "$orte_check_lsf_libevent_present" != 0],
[# (2) If there is a -levent in the $LIBS then that might be the problem
AS_IF([test "$opal_event_external_support" = "yes" && test "$orte_check_lsf_libevent_present" != "0"],
[AS_IF([test "$orte_check_lsf_libdir" = "" ],
[],
[LDFLAGS="$LDFLAGS -L$orte_check_lsf_libdir"])
# Note that we do not want to set LIBS here to include -llsf since
# the check is not for an LSF library, but for the conflict with
# LDFLAGS.
# (3) Check to see if the -levent is from Libevent (check for a symbol it has)
AC_CHECK_LIB([event], [evthread_set_condition_callbacks],
[AC_MSG_CHECKING([for libevent conflict])
AC_MSG_RESULT([No. The correct libevent.so was linked.])
orte_check_lsf_event_conflict=no],
[AC_MSG_CHECKING([for libevent conflict])
AC_MSG_RESULT([Yes. A wrong libevent.so was linked.])
[# (4) The libevent.so is not from Libevent. Warn the user.
AC_MSG_CHECKING([for libevent conflict])
AC_MSG_RESULT([Yes. Detected a libevent.so that is not from Libevent.])
orte_check_lsf_event_conflict=yes])
],
[AC_MSG_CHECKING([for libevent conflict])
@ -175,6 +179,8 @@ AC_DEFUN([ORTE_CHECK_LSF],[
AC_MSG_WARN([A system-installed Libevent library was detected and the Open MPI])
AC_MSG_WARN([build system chose to use the 'external' component expecting to])
AC_MSG_WARN([link against the Libevent in the linker search path.])
AC_MSG_WARN([If LSF is present on the system and in the default search path then])
AC_MSG_WARN([it _may be_ the source of the conflict.])
AC_MSG_WARN([LSF provides a libevent.so that is not from Libevent in its])
AC_MSG_WARN([library path. At this point the linker is attempting to resolve])
AC_MSG_WARN([Libevent symbols using the LSF library because of the lack of])