From 76500e6cf87178d5a83fb2b8bde83b49cab7d205 Mon Sep 17 00:00:00 2001 From: Joshua Hursey Date: Mon, 18 May 2020 15:10:46 -0400 Subject: [PATCH] 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 --- config/orte_check_lsf.m4 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/config/orte_check_lsf.m4 b/config/orte_check_lsf.m4 index eefc819852..50f269f912 100644 --- a/config/orte_check_lsf.m4 +++ b/config/orte_check_lsf.m4 @@ -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])