Skip to content

Commit

Permalink
libltdl: remove embedded libltdl
Browse files Browse the repository at this point in the history
Per #311, Libtool v2.4.4 exposes a bug in either Libtool
and/or autoreconf (after discussions with Libtool and Autoconf
maintainers, it's not clear which) when embedding libltdl.

After some discussion in the Open MPI community, we have decided to
both remove our embedded libltdl and (mostly) treat libltdl like any
other external library:

* If --disable-dlopen is specified, it behaves as it always has:
  libltdl support is wholly disabled, and all plugins are slurped into
  their higher-level libraries.
* If --enable-dlopen is specified, configure will abort if it cannot
  find properly libltdl support.
* If neither of these are specified, configure will behave differently
  between a developer build (i.e., where a .git directory is present
  in the source tree) and non-developer build:
  * In a developer build, --enable-dlopen is assumed (i.e., configure
    will abort if libltdl support cannot be found).
  * In a non-developer build:
    * If configure finds libltdl support, it will build dlopen support
      and build plugins as DSOs.
    * If configure does not find libltdl support, it will disable dlopen
      support and slurp plugins into higher level libraries.

Fixes #311.
  • Loading branch information
jsquyres committed Jan 30, 2015
1 parent 583db9d commit 79425da
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 276 deletions.
46 changes: 16 additions & 30 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
University of Stuttgart. All rights reserved.
Copyright (c) 2004-2007 The Regents of the University of California.
All rights reserved.
Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
Copyright (c) 2006-2011 Mellanox Technologies. All rights reserved.
Copyright (c) 2006-2012 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2007 Myricom, Inc. All rights reserved.
Expand Down Expand Up @@ -812,19 +812,27 @@ INSTALLATION OPTIONS

--enable-dlopen
Build all of Open MPI's components as standalone Dynamic Shared
Objects (DSO's) that are loaded at run-time (this is the default).
Objects (DSO's) that are loaded at run-time. configure will abort
if proper DSO support cannot be found on the build system (i.e., the
GNU Libltdl library and header files).

The opposite of this option, --disable-dlopen, causes two things:

1. All of Open MPI's components will be built as part of Open MPI's
normal libraries (e.g., libmpi).
2. Open MPI will not attempt to open any DSO's at run-time.

Note that this option does *not* imply that OMPI's libraries will be
built as static objects (e.g., libmpi.a). It only specifies the
location of OMPI's components: standalone DSOs or folded into the
Open MPI libraries. You can control whether Open MPI's libraries
are build as static or dynamic via --enable|disable-static and
--enable|disable-shared.
Note that --disable-dlopen does *not* imply that OMPI's libraries
will be built as static objects (e.g., libmpi.a). It only specifies
the location of OMPI's components: standalone DSOs or folded into
the Open MPI libraries. You can control whether Open MPI's
libraries are build as static or dynamic via --enable|disable-static
and --enable|disable-shared.

If neither --enable-dlopen nor --disable-dlopen are specified, Open
MPI will enable dlopen support if it can find proper DSO support on
the build system, or behave as if --disable-dlopen was specified if
it cannot find proper DSO support on the build system.

--with-platform=FILE
Load configure options for the build from FILE. Options on the
Expand Down Expand Up @@ -1136,28 +1144,6 @@ MISCELLANEOUS SUPPORT LIBRARIES
hwloc can discover PCI devices and locality, which can be useful for
Open MPI in assigning message passing resources to MPI processes.

--with-libltdl(=value)
This option specifies where to find the GNU Libtool libltdl support
library. The following values are permitted:

internal: Use Open MPI's internal copy of libltdl.
external: Use an external libltdl installation (rely on default
compiler and linker paths to find it)
<no value>: Same as "internal".
<directory>: Specify the location of a specific libltdl
installation to use

By default (or if --with-libltdl is specified with no VALUE), Open
MPI will build and use the copy of libltdl that it has in its source
tree. However, if the VALUE is "external", Open MPI will look for
the relevant libltdl header file and library in default compiler /
linker locations. Or, VALUE can be a directory tree where the
libltdl header file and library can be found. This option allows
operating systems to include Open MPI and use their default libltdl
installation instead of Open MPI's bundled libltdl.

Note that this option is ignored if --disable-dlopen is specified.

--disable-libompitrace
Disable building the simple "libompitrace" library (see note above
about libompitrace)
Expand Down
16 changes: 1 addition & 15 deletions autogen.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
# Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
Expand Down Expand Up @@ -1265,7 +1265,6 @@ sub patch_autotools_output {
verbose "==> Remove stale files\n";
find_and_delete(qw/config.guess config.sub depcomp compile install-sh ltconfig
ltmain.sh missing mkinstalldirs libtool/);
system("rm -rf opal/libltdl");

# Remove the old m4 file and write the new one
verbose "==> Writing m4 file with autogen.pl results\n";
Expand All @@ -1292,22 +1291,9 @@ sub patch_autotools_output {

#---------------------------------------------------------------------------

# For FreeBSD (carried over from autogen.sh); apparently some versions
# of automake don't so this (prior to 1.9.7...?).
system("chmod u+w opal/libltdl/configure");

#---------------------------------------------------------------------------

++$step;
verbose "\n$step. Patching autotools output on top-level tree :-(\n\n";

# Patch preopen error in libltdl
if (-f "opal/libltdl/loaders/preopen.c") {
verbose "=== Patching preopen error masking in libltdl\n";
safe_system("$patch_prog -N -p0 < config/libltdl-preopen-error.diff");
unlink("opal/libltdl/loaders/preopen.c.rej");
}

patch_autotools_output(".");

#---------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions config/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2010 Oracle and/or its affiliates. All rights
# reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
Expand All @@ -23,7 +23,6 @@
EXTRA_DIST = \
distscript.csh \
opal_get_version.m4sh \
libltdl-preopen-error.diff \
ltmain_pgi_tp.diff \
opal_mca_priority_sort.pl

Expand Down
27 changes: 0 additions & 27 deletions config/libltdl-preopen-error.diff

This file was deleted.

12 changes: 8 additions & 4 deletions config/opal_configure_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009 IBM Corporation. All rights reserved.
dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights
Expand Down Expand Up @@ -292,13 +292,17 @@ AC_ARG_ENABLE([dlopen],
Disabling dlopen implies --disable-mca-dso.
(default: enabled)])])
if test "$enable_dlopen" = "no" ; then
enable_mca_dso="no"
enable_mca_static="yes"
OPAL_ENABLE_DLOPEN_SUPPORT=0
AC_MSG_RESULT([no])
else
elif test "$enable_dlopen" = "yes"; then
OPAL_ENABLE_DLOPEN_SUPPORT=1
AC_MSG_RESULT([yes])
elif test $OPAL_DEVEL -eq 1; then
OPAL_ENABLE_DLOPEN_SUPPORT=1
AC_MSG_RESULT([yes (devel build default)])
else
OPAL_ENABLE_DLOPEN_SUPPORT=-1
AC_MSG_RESULT([if available])
fi


Expand Down
Loading

0 comments on commit 79425da

Please sign in to comment.