Skip to content

Commit e373e54

Browse files
committed
build/dl: rework framework configure
Greatly simplify the dl framework configure by not trying to track libs and by setting the flags/libs as <framework>_<component>_flag, so that opal_mca pulls in all the wrapper flags automagically. Because the individual components link against dl or ltdl and components are always static, libopen-pal will depend on dl or ltdl and libmpi will inherit those dependencies. So we don't need all the LIB tracking we were doing. Update the package checks to use OAC_CHECK_PACKAGE instead of OPAL_CHECK_PACKAGE, although it is unlikely either will ever provide a pkg-config file. Remove the backdoor disable-dl-dlopen flag, which is a duplicate of --enable-mca-no-build=dl-dlopen. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent b542a9c commit e373e54

File tree

6 files changed

+22
-113
lines changed

6 files changed

+22
-113
lines changed

config/opal_configure_options.m4

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,6 @@ else
320320
OPAL_ENABLE_DLOPEN_SUPPORT=1
321321
AC_MSG_RESULT([yes])
322322
fi
323-
AC_DEFINE_UNQUOTED(OPAL_ENABLE_DLOPEN_SUPPORT, $OPAL_ENABLE_DLOPEN_SUPPORT,
324-
[Whether we want to enable dlopen support])
325323

326324

327325
#

opal/Makefile.am

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ SUBDIRS = \
3737
$(MCA_opal_FRAMEWORK_COMPONENT_STATIC_SUBDIRS) \
3838
. \
3939
$(MCA_opal_FRAMEWORK_COMPONENT_DSO_SUBDIRS)
40-
# libltdl is included by variable because if --disable-dlopen was
41-
# used, there will be no generated Makefile in that directory (and
42-
# therefore make distclean will fail).
4340
DIST_SUBDIRS = \
4441
include \
4542
cuda \

opal/mca/dl/configure.m4

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,7 @@ AC_DEFUN([MCA_opal_dl_CONFIG],[
4242
# happen if --disable-dlopen was *not* specified), do some more
4343
# logic.
4444
AS_IF([test "$MCA_opal_dl_STATIC_COMPONENTS" != ""],
45-
[ # We had a winner -- w00t!
46-
47-
OPAL_HAVE_DL_SUPPORT=1
48-
# If we added any -L flags to ADD_LDFLAGS, then we (might)
49-
# need to add those directories to LD_LIBRARY_PATH.
50-
# Otherwise, if we try to AC RUN_IFELSE anything here in
51-
# configure, it might die because it can't find the libraries
52-
# we just linked against.
53-
OPAL_VAR_SCOPE_PUSH([opal_dl_base_found_l opal_dl_base_token opal_dl_base_tmp opal_dl_base_dir])
54-
opal_dl_base_found_l=0
55-
eval "opal_dl_base_tmp=\$opal_dl_${opal_dl_winner}_ADD_LIBS"
56-
for opal_dl_base_token in $opal_dl_base_tmp; do
57-
case $opal_dl_base_token in
58-
-l*) opal_dl_base_found_l=1 ;;
59-
esac
60-
done
61-
AS_IF([test $opal_dl_base_found_l -eq 1],
62-
[eval "opal_dl_base_tmp=\$opal_dl_${opal_dl_winner}_ADD_LDFLAGS"
63-
for opal_dl_base_token in $opal_dl_base_tmp; do
64-
case $opal_dl_base_token in
65-
-L*)
66-
opal_dl_base_dir=`echo $opal_dl_base_token | cut -c3-`
67-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$opal_dl_base_dir
68-
AC_MSG_WARN([Adding to LD_LIBRARY_PATH: $opal_dl_base_dir])
69-
;;
70-
esac
71-
done])
72-
OPAL_VAR_SCOPE_POP
73-
])
45+
[OPAL_HAVE_DL_SUPPORT=1])
7446

7547
AC_DEFINE_UNQUOTED([OPAL_HAVE_DL_SUPPORT], [$OPAL_HAVE_DL_SUPPORT],
7648
[Whether the OPAL DL framework is functional or not])

opal/mca/dl/dlopen/configure.m4

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,17 @@ AC_DEFUN([MCA_opal_dl_dlopen_COMPILE_MODE], [
2626
AC_DEFUN([MCA_opal_dl_dlopen_CONFIG],[
2727
AC_CONFIG_FILES([opal/mca/dl/dlopen/Makefile])
2828

29-
dnl This is effectively a back-door for Open MPI developers to
30-
dnl force the use of the libltdl dl component.
31-
AC_ARG_ENABLE([dl-dlopen],
32-
[AS_HELP_STRING([--disable-dl-dlopen],
33-
[Disable the "dlopen" DL component (and probably force the use of the "libltdl" DL component). This option should really only be used by Open MPI developers. You are probably actually looking for the "--disable-dlopen" option, which disables all dlopen-like functionality from Open MPI.])
34-
])
35-
36-
opal_dl_dlopen_happy=no
37-
AS_IF([test "$enable_dl_dlopen" != "no"],
38-
[OPAL_CHECK_PACKAGE([opal_dl_dlopen],
29+
OAC_CHECK_PACKAGE([dlopen],
30+
[dl_dlopen],
3931
[dlfcn.h],
4032
[dl],
4133
[dlopen],
42-
[],
43-
[],
44-
[],
4534
[opal_dl_dlopen_happy=yes],
4635
[opal_dl_dlopen_happy=no])
47-
])
4836

4937
AS_IF([test "$opal_dl_dlopen_happy" = "yes"],
50-
[dl_dlopen_ADD_LIBS=$opal_dl_dlopen_LIBS
51-
dl_dlopen_WRAPPER_EXTRA_LIBS=$opal_dl_dlopen_LIBS
52-
$1],
38+
[$1],
5339
[$2])
5440

55-
AC_SUBST(opal_dl_dlopen_LIBS)
41+
AC_SUBST(dl_dlopen_LIBS)
5642
])

opal/mca/dl/libltdl/Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ sources = \
1919
noinst_LTLIBRARIES = libmca_dl_libltdl.la
2020

2121
libmca_dl_libltdl_la_SOURCES = $(sources)
22-
libmca_dl_libltdl_la_CPPFLAGS = $(opal_dl_libltdl_CPPFLAGS)
22+
libmca_dl_libltdl_la_CPPFLAGS = $(dl_libltdl_CPPFLAGS)
2323
libmca_dl_libltdl_la_LDFLAGS = \
24-
$(opal_dl_libltdl_LDFLAGS) \
24+
$(dl_libltdl_LDFLAGS) \
2525
-module -avoid-version
26-
libmca_dl_libltdl_la_LIBADD = $(opal_dl_libltdl_LIBS)
26+
libmca_dl_libltdl_la_LIBADD = $(dl_libltdl_LIBS)

opal/mca/dl/libltdl/configure.m4

Lines changed: 14 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@ AC_DEFUN([MCA_opal_dl_libltdl_COMPILE_MODE], [
2121
AC_MSG_RESULT([$$4])
2222
])
2323

24-
# MCA_opal_dl_libltdl_POST_CONFIG()
25-
# ---------------------------------
26-
AC_DEFUN([MCA_opal_dl_libltdl_POST_CONFIG],[
27-
# If we won, then do all the rest of the setup
28-
AS_IF([test "$1" = "1"],
29-
[
30-
# Add some stuff to CPPFLAGS so that the rest of the source
31-
# tree can be built
32-
LDFLAGS="$LDFLAGS $opal_dl_libltdl_ADD_LDFLAGS"
33-
LIBS="$LIBS $opal_dl_libltdl_ADD_LIBS"
34-
])
35-
])dnl
36-
3724
# MCA_dl_libltdl_CONFIG([action-if-can-compile],
3825
# [action-if-cant-compile])
3926
# ------------------------------------------------
@@ -49,41 +36,13 @@ AC_DEFUN([MCA_opal_dl_libltdl_CONFIG],[
4936
[AS_HELP_STRING([--with-libltdl-libdir=DIR],
5037
[Search for libltdl libraries in DIR])])
5138

52-
# Sanity check the --with values
53-
OPAL_CHECK_WITHDIR([libltdl], [$with_libltdl],
54-
[include/ltdl.h])
55-
OPAL_CHECK_WITHDIR([libltdl-libdir], [$with_libltdl_libdir],
56-
[libltdl.*])
57-
58-
# Defaults
59-
opal_check_libltdl_dir_msg="compiler default"
60-
opal_check_libltdl_libdir_msg="linker default"
61-
62-
# Save directory names if supplied
63-
AS_IF([test ! -z "$with_libltdl" && test "$with_libltdl" != "yes"],
64-
[opal_check_libltdl_dir=$with_libltdl
65-
opal_check_libltdl_dir_msg="$opal_check_libltdl_dir (from --with-libltdl)"])
66-
AS_IF([test ! -z "$with_libltdl_libdir" && test "$with_libltdl_libdir" != "yes"],
67-
[opal_check_libltdl_libdir=$with_libltdl_libdir
68-
opal_check_libltdl_libdir_msg="$opal_check_libltdl_libdir (from --with-libltdl-libdir)"])
69-
70-
opal_dl_libltdl_happy=no
71-
AS_IF([test "$with_libltdl" != "no"],
72-
[AC_MSG_CHECKING([for libltdl dir])
73-
AC_MSG_RESULT([$opal_check_libltdl_dir_msg])
74-
AC_MSG_CHECKING([for libltdl library dir])
75-
AC_MSG_RESULT([$opal_check_libltdl_libdir_msg])
76-
77-
OPAL_CHECK_PACKAGE([opal_dl_libltdl],
78-
[ltdl.h],
79-
[ltdl],
80-
[lt_dlopen],
81-
[],
82-
[$opal_check_libltdl_dir],
83-
[$opal_check_libltdl_libdir],
84-
[opal_dl_libltdl_happy=yes],
85-
[opal_dl_libltdl_happy=no])
86-
])
39+
OAC_CHECK_PACKAGE([libltdl],
40+
[dl_libltdl],
41+
[ltdl.h],
42+
[ltdl],
43+
[lt_dlopen],
44+
[opal_dl_libltdl_happy=yes],
45+
[opal_dl_libltdl_happy=no])
8746

8847
# If we have libltdl, do we have lt_dladvise?
8948
opal_dl_libltdl_have_lt_dladvise=0
@@ -92,9 +51,9 @@ AC_DEFUN([MCA_opal_dl_libltdl_CONFIG],[
9251
LDFLAGS_save=$LDFLAGS
9352
LIBS_save=$LIBS
9453

95-
CPPFLAGS="$opal_dl_libltdl_CPPFLAGS $CPPFLAGS"
96-
LDFLAGS="$opal_dl_libltdl_LDFLAGS $LDFLAGS"
97-
LIBS="$opal_dl_libltdl_LIBS $LIBS"
54+
CPPFLAGS="$dl_libltdl_CPPFLAGS $CPPFLAGS"
55+
LDFLAGS="$dl_libltdl_LDFLAGS $LDFLAGS"
56+
LIBS="$dl_libltdl_LIBS $LIBS"
9857
AC_CHECK_FUNC([lt_dladvise_init],
9958
[opal_dl_libltdl_have_lt_dladvise=1])
10059
CPPFLAGS=$CPPFLAGS_save
@@ -106,19 +65,16 @@ AC_DEFUN([MCA_opal_dl_libltdl_CONFIG],[
10665
[Whether we have lt_dladvise or not])
10766

10867
AS_IF([test "$opal_dl_libltdl_happy" = "yes"],
109-
[opal_dl_libltdl_ADD_CPPFLAGS=$opal_dl_libltdl_CPPFLAGS
110-
opal_dl_libltdl_ADD_LDFLAGS=$opal_dl_libltdl_LDFLAGS
111-
opal_dl_libltdl_ADD_LIBS=$opal_dl_libltdl_LIBS
112-
$1],
68+
[$1],
11369
[AS_IF([test ! -z "$with_libltdl" && \
11470
test "$with_libltdl" != "no"],
11571
[AC_MSG_WARN([Libltdl support requested (via --with-libltdl) but not found.])
11672
AC_MSG_ERROR([Cannot continue.])])
11773
$2])
11874

119-
AC_SUBST(opal_dl_libltdl_CPPFLAGS)
120-
AC_SUBST(opal_dl_libltdl_LDFLAGS)
121-
AC_SUBST(opal_dl_libltdl_LIBS)
75+
AC_SUBST(dl_libltdl_CPPFLAGS)
76+
AC_SUBST(dl_libltdl_LDFLAGS)
77+
AC_SUBST(dl_libltdl_LIBS)
12278

12379
OPAL_VAR_SCOPE_POP
12480
])

0 commit comments

Comments
 (0)