Skip to content

Commit 9c0a2bb

Browse files
authored
Merge pull request #7734 from jjhursey/fix-lsf-libevent
Move to `libevent_core` and add checks for libevent.so conflict with LSF
2 parents 9996b9f + 33afdb6 commit 9c0a2bb

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

opal/mca/event/external/configure.m4

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# and Technology (RIST). All rights reserved.
77
#
88
# Copyright (c) 2017-2018 Intel, Inc. All rights reserved.
9+
# Copyright (c) 2020 IBM Corporation. All rights reserved.
910
# $COPYRIGHT$
1011
#
1112
# Additional copyrights may follow
@@ -107,20 +108,49 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[
107108

108109
OPAL_CHECK_PACKAGE([opal_event_external],
109110
[event2/event.h],
110-
[event],
111+
[event_core],
111112
[event_config_new],
112113
[-levent_pthreads],
113114
[$opal_event_dir],
114115
[$opal_event_libdir],
115116
[opal_event_external_support=yes],
116117
[opal_event_external_support=no])
117118

119+
# Check to see if the above check failed because it conflicted with LSF's libevent.so
120+
# This can happen if LSF's library is in the LDFLAGS envar or default search
121+
# path. The 'event_fini' function is only defined in LSF's libevent.so and not
122+
# in Libevent's libevent.so
123+
AS_IF([test "$opal_event_external_support" = "no"],
124+
[AC_CHECK_LIB([event], [event_fini],
125+
[AC_MSG_WARN([===================================================================])
126+
AC_MSG_WARN([Possible conflicting libevent.so libraries detected on the system.])
127+
AC_MSG_WARN([])
128+
AC_MSG_WARN([LSF provides a libevent.so that is not from Libevent in its])
129+
AC_MSG_WARN([library path. It is possible that you have installed Libevent])
130+
AC_MSG_WARN([on the system, but the linker is picking up the wrong version.])
131+
AC_MSG_WARN([])
132+
AC_MSG_WARN([Configure may continue and attempt to use the 'internal' libevent])
133+
AC_MSG_WARN([instead of the 'external' libevent if you did not explicitly request])
134+
AC_MSG_WARN([the 'external' component.])
135+
AC_MSG_WARN([])
136+
AC_MSG_WARN([If your intention was to use the 'external' libevent then you need])
137+
AC_MSG_WARN([to address this linker path ordering issue. One way to do so is])
138+
AC_MSG_WARN([to make sure the libevent system library path occurs before the])
139+
AC_MSG_WARN([LSF library path.])
140+
AC_MSG_WARN([===================================================================])
141+
opal_event_external_support=no
142+
])
143+
])
144+
145+
AS_IF([test "$opal_event_external_support" = "yes"],
146+
[LDFLAGS="$opal_event_external_LDFLAGS $LDFLAGS"
147+
CPPFLAGS="$opal_event_external_CPPFLAGS $CPPFLAGS"])
148+
118149
AS_IF([test "$opal_event_external_support" = "yes"],
119150
[# Ensure that this libevent has the symbol
120151
# "evthread_set_lock_callbacks", which will only exist if
121152
# libevent was configured with thread support.
122-
LIBS="$opal_event_external_LDFLAGS $LIBS"
123-
AC_CHECK_LIB([event], [evthread_set_lock_callbacks],
153+
AC_CHECK_LIB([event_core], [evthread_set_lock_callbacks],
124154
[],
125155
[AC_MSG_WARN([External libevent does not have thread support])
126156
AC_MSG_WARN([Open MPI requires libevent to be compiled with])

0 commit comments

Comments
 (0)