From a73a89f6cfb28542eccde4f5c4f45c791ec67a57 Mon Sep 17 00:00:00 2001 From: Joshua Hursey Date: Tue, 5 May 2020 12:08:52 -0400 Subject: [PATCH 1/3] event/external: Fix typo in LDFLAGS vs LIBS var before check * This should have been `LDFLAGS` not `LIBS`. Either works, but `LDFLAGS` is more correct. We should also include `CPPFLAGS` just in case the header is important to the check. Signed-off-by: Joshua Hursey (cherry picked from commit 22d8fa197b73eff7afc6d5fd11a99ced396c388a) --- opal/mca/event/external/configure.m4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opal/mca/event/external/configure.m4 b/opal/mca/event/external/configure.m4 index 15313db50a..0bdd87c8b2 100644 --- a/opal/mca/event/external/configure.m4 +++ b/opal/mca/event/external/configure.m4 @@ -6,6 +6,7 @@ # and Technology (RIST). All rights reserved. # # Copyright (c) 2017-2018 Intel, Inc. All rights reserved. +# Copyright (c) 2020 IBM Corporation. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -115,11 +116,15 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[ [opal_event_external_support=yes], [opal_event_external_support=no]) + AS_IF([test "$opal_event_external_support" = "yes"], + [LDFLAGS="$opal_event_external_LDFLAGS $LDFLAGS" + CPPFLAGS="$opal_event_external_CPPFLAGS $CPPFLAGS"], + []) + AS_IF([test "$opal_event_external_support" = "yes"], [# Ensure that this libevent has the symbol # "evthread_set_lock_callbacks", which will only exist if # libevent was configured with thread support. - LIBS="$opal_event_external_LDFLAGS $LIBS" AC_CHECK_LIB([event], [evthread_set_lock_callbacks], [], [AC_MSG_WARN([External libevent does not have thread support]) From 959353b421838f6dd8a057c56fb58435ceafcafd Mon Sep 17 00:00:00 2001 From: Joshua Hursey Date: Tue, 5 May 2020 11:51:51 -0400 Subject: [PATCH 2/3] Add checks for libevent.so conflict with LSF * LSF ships a `libevent.so` that is no related to the `libevent.so` shipped with Libevent. * Add some checks to the configure logic to detect scenarios where this conflict can be detected, and provide the user with a descriptive warning message. - When detected by `event/external` this is just a warning since the internal component may be able to be used instead. - This happens when the user supplies the LSF path via the `LDFLAGS` envar instead of via `--with-lsf-libdir`. - When detected by a LSF component and LSF was explicitly requested then this becomes an error. Otherwise it will just print the warning and that component will fail to build. * Note for `master` the `orter_check_lsf.m4` portion of this cherry-pick was moved to `prrte/config/prrte_check_lsf.m4` Signed-off-by: Joshua Hursey (cherry picked from commit fc4199e3ba567a672ce1da0dc46efbfd996d71f6) --- opal/mca/event/external/configure.m4 | 29 ++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/opal/mca/event/external/configure.m4 b/opal/mca/event/external/configure.m4 index 0bdd87c8b2..6e38b7d1e9 100644 --- a/opal/mca/event/external/configure.m4 +++ b/opal/mca/event/external/configure.m4 @@ -116,10 +116,35 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[ [opal_event_external_support=yes], [opal_event_external_support=no]) + # Check to see if the above check failed because it conflicted with LSF's libevent.so + # This can happen if LSF's library is in the LDFLAGS envar or default search + # path. The 'event_fini' function is only defined in LSF's libevent.so and not + # in Libevent's libevent.so + AS_IF([test "$opal_event_external_support" = "no"], + [AC_CHECK_LIB([event], [event_fini], + [AC_MSG_WARN([===================================================================]) + AC_MSG_WARN([Possible conflicting libevent.so libraries detected on the system.]) + AC_MSG_WARN([]) + AC_MSG_WARN([LSF provides a libevent.so that is not from Libevent in its]) + AC_MSG_WARN([library path. It is possible that you have installed Libevent]) + AC_MSG_WARN([on the system, but the linker is picking up the wrong version.]) + AC_MSG_WARN([]) + AC_MSG_WARN([Configure may continue and attempt to use the 'internal' libevent]) + AC_MSG_WARN([instead of the 'external' libevent if you did not explicitly request]) + AC_MSG_WARN([the 'external' component.]) + AC_MSG_WARN([]) + AC_MSG_WARN([If your intention was to use the 'external' libevent then you need]) + AC_MSG_WARN([to address this linker path ordering issue. One way to do so is]) + AC_MSG_WARN([to make sure the libevent system library path occurs before the]) + AC_MSG_WARN([LSF library path.]) + AC_MSG_WARN([===================================================================]) + opal_event_external_support=no + ]) + ]) + AS_IF([test "$opal_event_external_support" = "yes"], [LDFLAGS="$opal_event_external_LDFLAGS $LDFLAGS" - CPPFLAGS="$opal_event_external_CPPFLAGS $CPPFLAGS"], - []) + CPPFLAGS="$opal_event_external_CPPFLAGS $CPPFLAGS"]) AS_IF([test "$opal_event_external_support" = "yes"], [# Ensure that this libevent has the symbol From 33afdb66497e3382d2e962c360460c9fa11d97d1 Mon Sep 17 00:00:00 2001 From: Joshua Hursey Date: Wed, 6 May 2020 11:35:22 -0400 Subject: [PATCH 3/3] Move from legacy -levent to recommended -levent_core * `libevent_core.so` contains the core functionality that we depend upon - `libevent.so` library has been identified as the legacy target. - `libevent_core.so` exists as far back as Libevent 2.0.5 (oldest supported by OMPI) * `libevent_pthreads.so` can work with either `-levent` or `-levent_core` Signed-off-by: Joshua Hursey (cherry picked from commit 886f41fe3381a338eac215f26360980c612e6bb8) --- opal/mca/event/external/configure.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opal/mca/event/external/configure.m4 b/opal/mca/event/external/configure.m4 index 6e38b7d1e9..daaac5fa27 100644 --- a/opal/mca/event/external/configure.m4 +++ b/opal/mca/event/external/configure.m4 @@ -108,7 +108,7 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[ OPAL_CHECK_PACKAGE([opal_event_external], [event2/event.h], - [event], + [event_core], [event_config_new], [-levent_pthreads], [$opal_event_dir], @@ -150,7 +150,7 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[ [# Ensure that this libevent has the symbol # "evthread_set_lock_callbacks", which will only exist if # libevent was configured with thread support. - AC_CHECK_LIB([event], [evthread_set_lock_callbacks], + AC_CHECK_LIB([event_core], [evthread_set_lock_callbacks], [], [AC_MSG_WARN([External libevent does not have thread support]) AC_MSG_WARN([Open MPI requires libevent to be compiled with])