From bec3e750d1a3b4ce9b6305d0259ce4fd76304cca Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 29 Jan 2015 15:59:16 -0800 Subject: [PATCH] libltdl: remove embedded libltdl Per open-mpi/ompi#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 proper 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). --disable-dlopen must be specified if you do not have libltdl support. * In a non-developer build: * If configure finds libltdl support, it will behave as if --enable-dlopen was specified. * If configure does not find libltdl support, it will behave as if --disable-dlopen was specified. The developer build behavior is because dlopen support is usually highly valued (e.g., being able to repeatedly build individual plugins), and libltdl-devel may not be installed by default on Linux distros and OSX. Hence, without this special developer-build provision, developers may inadvertently build without dlopen support. Fixes #311. --- .gitignore | 2 - HACKING | 23 +- README | 46 ++-- autogen.pl | 16 +- config/Makefile.am | 3 +- config/libltdl-preopen-error.diff | 27 --- config/opal_check_cuda.m4 | 33 ++- config/opal_configure_options.m4 | 12 +- config/opal_setup_libltdl.m4 | 215 +++++------------- configure.ac | 13 +- .../nightly/reports/check_devel_headers.pl | 6 +- ompi/debuggers/Makefile.am | 5 +- ompi/debuggers/dlopen_test.c | 7 +- opal/Makefile.am | 13 +- opal/mca/base/mca_base_component_find.c | 9 +- opal/mca/base/mca_base_component_repository.c | 10 +- opal/util/lt_interface.c | 15 +- 17 files changed, 147 insertions(+), 308 deletions(-) delete mode 100644 config/libltdl-preopen-error.diff mode change 100755 => 100644 contrib/nightly/reports/check_devel_headers.pl diff --git a/.gitignore b/.gitignore index d79ef330c48..511ef69eac0 100644 --- a/.gitignore +++ b/.gitignore @@ -291,8 +291,6 @@ ompi/tools/wrappers/mpicxx-wrapper-data.txt ompi/tools/wrappers/mpif77-wrapper-data.txt ompi/tools/wrappers/mpif90-wrapper-data.txt -opal/libltdl - opal/asm/atomic-asm.S opal/asm/atomic-test opal/asm/generated/atomic-*.s diff --git a/HACKING b/HACKING index 99168b5fffe..9a060155330 100644 --- a/HACKING +++ b/HACKING @@ -8,7 +8,7 @@ Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, University of Stuttgart. All rights reserved. Copyright (c) 2004-2005 The Regents of the University of California. All rights reserved. -Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved. +Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. Copyright (c) 2013 Intel, Inc. All rights reserved. $COPYRIGHT$ @@ -83,18 +83,23 @@ developer's checkout, you have three main options: Use of GNU Autoconf, Automake, and Libtool (and m4) =================================================== -This procedure is *ONLY* necessary if you are building from a -developer's tree. If you have an Open MPI distribution tarball, this -procedure is unnecessary -- you can (and should) skip reading this -section. +You need to read/care about this section *ONLY* if you are building +from a developer's tree (i.e., a Git clone of the Open MPI source +tree). If you have an Open MPI distribution tarball, the contents of +this section are optional -- you can (and probably should) skip +reading this section. If you are building Open MPI from a developer's tree, you must first install fairly recent versions of the GNU tools Autoconf, Automake, and Libtool (and possibly GNU m4, because recent versions of Autoconf -have specific GNU m4 version requirements). The specific versions -required depend on if you are using the trunk or a release branch (and -which release branch you are using). The specific versions can be -found at: +have specific GNU m4 version requirements). Starting with Open MPI +v1.9, by default, your Libtool installation must also include libltdl +support (to include "developer" support, meaning that ltdl.h must be +available). + +The specific versions required depend on if you are using the Git +master branch or a release branch (and which release branch you are +using). The specific versions can be found here: http://www.open-mpi.org/source/building.php diff --git a/README b/README index d08de98710f..89a556a4d10 100644 --- a/README +++ b/README @@ -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. @@ -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 @@ -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) - : Same as "internal". - : 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) diff --git a/autogen.pl b/autogen.pl index d680d32c76d..79e616f6c99 100755 --- a/autogen.pl +++ b/autogen.pl @@ -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. @@ -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"; @@ -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("."); #--------------------------------------------------------------------------- diff --git a/config/Makefile.am b/config/Makefile.am index 3217f8fbfdf..5b534c77939 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -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. @@ -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 diff --git a/config/libltdl-preopen-error.diff b/config/libltdl-preopen-error.diff deleted file mode 100644 index 0112c746921..00000000000 --- a/config/libltdl-preopen-error.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- opal/libltdl/loaders/preopen.c.~1~ 2010-03-03 14:13:28.000000000 -0500 -+++ opal/libltdl/loaders/preopen.c 2010-03-05 17:57:11.000000000 -0500 -@@ -185,7 +185,24 @@ - } - } - -+#if 0 -+ /* Open MPI: This line is commented out because Open MPI does not -+ use the preopen functionality in libltdl at all -- so we never -+ need to see errors from this module. Additionally, this module -+ is usually invoked last in the sequence when trying to -+ lt_dlopenadvise() a DSO -- so if there was a real error when -+ opening that DSO (e.g., a symbol not found), setting the -+ FILE_NOT_FOUND error here will mask the real error. -+ -+ This error has been reported upstream to the Libtool maintainers; -+ they acknowledge that it is a problem but no one has come up with -+ a good general solution yet. This Open MPI-specific solution is -+ workable for us, but not workable as a general solution. Hence, -+ we patch in this "if 0" block in autogen.pl after Libtool -+ installs libltdl in the opal/ tree. -+ */ - LT__SETERROR (FILE_NOT_FOUND); -+#endif - - done: - return module; diff --git a/config/opal_check_cuda.m4 b/config/opal_check_cuda.m4 index 397f9fadd15..014efbd79d7 100644 --- a/config/opal_check_cuda.m4 +++ b/config/opal_check_cuda.m4 @@ -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-2010 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 @@ -24,6 +24,7 @@ dnl Additional copyrights may follow dnl dnl $HEADER$ dnl + AC_DEFUN([OPAL_CHECK_CUDA],[ # # Check to see if user wants CUDA support @@ -69,10 +70,11 @@ AS_IF([test "$with_cuda" = "no" -o "x$with_cuda" = "x"], opal_cuda_incdir="$with_cuda/include" AC_MSG_RESULT([found ($opal_cuda_incdir/cuda.h)])])])])]) -# We cannot have CUDA support without dlopen support. Check for that and -# error out if the user has also set --disable-dlopen. -AS_IF([test "$enable_dlopen" = "no" -a "$opal_check_cuda_happy" = "yes"], - [AC_MSG_ERROR([--with-cuda cannot be used with --disable-dlopen. Remove one of them and reconfigure.])]) +dnl We cannot have CUDA support without dlopen support. HOWEVER, we +dnl have not determined whether we have libltdl support yet (i.e., +dnl whether we have dlopen support or not). So we have to defer this +dnl check until later (see the OPAL_CHECK_CUDA_AFTER_LIBLTDL m4 macro, +dnl below). :-( # If we have CUDA support, check to see if we have CUDA 4.1 support AS_IF([test "$opal_check_cuda_happy"="yes"], @@ -139,3 +141,24 @@ AC_DEFINE_UNQUOTED([OPAL_CUDA_GDR_SUPPORT],$CUDA_VERSION_60_OR_GREATER, [Whether we have CUDA GDR support available]) ]) + +dnl +dnl CUDA support requires libltdl support. But we do not check for +dnl libltdl support until lafter the initial OPAL_CHECK_CUDA is called. +dnl So put the CUDA+libltdl check in a separate macro that can be called +dnl after the main libltdl check in the top-level configure.ac. +dnl +AC_DEFUN([OPAL_CHECK_CUDA_AFTER_LIBLTDL],[ + + # We cannot have CUDA support without dlopen support. When this + # macro is invoked, we will know if we have libltdl (i.e., dlopen) + # support. + + # Error out if the user wants CUDA but we do not have libltdl + # support. + AS_IF([test $OPAL_ENABLE_DLOPEN_SUPPORT -eq 0 && \ + test "$opal_check_cuda_happy" = "yes"], + [AC_MSG_WARN([--with-cuda was specified, but dlopen support has been disabled.]) + AC_MSG_WARN([You must enable dlopen support and reconfigure.]) + AC_MSG_ERROR([Cannot continue.])]) +]) diff --git a/config/opal_configure_options.m4 b/config/opal_configure_options.m4 index b76550d3465..b5dc1af4503 100644 --- a/config/opal_configure_options.m4 +++ b/config/opal_configure_options.m4 @@ -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 @@ -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 diff --git a/config/opal_setup_libltdl.m4 b/config/opal_setup_libltdl.m4 index f89de1a19bf..9dc8b363a54 100644 --- a/config/opal_setup_libltdl.m4 +++ b/config/opal_setup_libltdl.m4 @@ -9,7 +9,7 @@ dnl Copyright (c) 2004-2007 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) 2006-2008 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights dnl reserved. @@ -22,174 +22,63 @@ dnl $HEADER$ dnl AC_DEFUN([OPAL_SETUP_LIBLTDL],[ - OPAL_VAR_SCOPE_PUSH([HAPPY]) - - opal_show_subtitle "GNU libltdl setup" - - # AC_CONFIG_SUBDIRS appears to be broken for non-gcc compilers (i.e., - # passing precious variables down to the sub-configure). - # - # Finally, make ltdl follow the same shared/static convention that was - # user for the main OMPI libraries. So manually examine - # $enable_shared and $enable_static and pass down the corresponding - # flags. - - LIBLTDL_SUBDIR= OPAL_HAVE_LTDL_ADVISE=0 - OPAL_LIBLTDL_INTERNAL=0 - - AS_IF([test "$OPAL_ENABLE_DLOPEN_SUPPORT" = "0"], - [AC_MSG_WARN([libltdl support disabled (by --disable-dlopen)]) - LIBLTDL= - LDTLINCL= - OPAL_WRAPPER_FLAGS_ADD(LIBS, "$LIBS")], - [ - # Default to building the internal copy. After this, - # paffinity_hwloc_location is guaranteed to be set to one of: - # "internal", a directory name (i.e., whatever the user - # supplied), or "no". - libltdl_location=$with_libltdl - AS_IF([test -z "$libltdl_location" -o "$libltdl_location" = "yes"], - [libltdl_location=internal]) - - AC_MSG_CHECKING([location of libltdl]) - case $libltdl_location in - no) - AC_MSG_WARN([--without-libltdl specified in conjunction with]) - AC_MSG_WARN([--enable-dlopen (or --disable-dlopen was not specified)]) - AC_MSG_WARN([Cannot have dlopen without libltdl]) - AC_MSG_ERROR([Cannot continue]) - ;; - internal) - AC_MSG_RESULT([internal copy]) - _OPAL_SETUP_LIBLTDL_INTERNAL - ;; - external) - AC_MSG_RESULT([external copy (unspecified)]) - # If we're using an extern libltdl, then reset the - # LTDLINCL that was set earlier (ie., there's no need to - # -I into our internal libltdl tree). - LIBLTDL= - LDTLINCL= - libltdl_location= - libltdl_need_external=1 - ;; - *) - AC_MSG_RESULT([external copy ($libltdl_location)]) - OPAL_CHECK_WITHDIR([libltdl], [$libltdl_location], - [include/ltdl.h]) - # If we're using an extern libltdl, then reset the - # LTDLINCL that was set earlier (ie., there's no need to - # -I into our internal libltdl tree). - LIBLTDL= - LDTLINCL= - libltdl_need_external=1 - ;; - esac - AS_IF([test "$libltdl_need_external" = "1"], - [OPAL_CHECK_PACKAGE([libltdl], - [ltdl.h], - [ltdl], - [lt_dlopen], - [], - [$libltdl_location], - [], - [], - [AC_MSG_WARN([External libltdl installation not found]) - AC_MSG_WARN([or not usable.]) - AC_MSG_ERROR([Cannot continue.])]) - CPPFLAGS="$CPPFLAGS $libltdl_CPPFLAGS" - LDFLAGS="$LDFLAGS $libltdl_LDFLAGS" - LIBS="$LIBS $libltdl_LIBS" + # If --enable-dlopen was passed, OPAL_ENABLE_DLOPEN_SUPPORT==1 + # If --disable-dlopen was passed, OPAL_ENABLE_DLOPEN_SUPPORT==0 + # If neither was passed, OPAL_ENABLE_DLOPEN_SUPPORT==-1 + + AS_IF([test $OPAL_ENABLE_DLOPEN_SUPPORT -ne 0], + [ # See if we can find the Right stuff for libltdl + OPAL_CHECK_PACKAGE([libltdl], + [ltdl.h], + [ltdl], + [lt_dlopen], + [], + [], + [], + [OPAL_ENABLE_DLOPEN_SUPPORT=1], + [AS_IF([test $OPAL_ENABLE_DLOPEN_SUPPORT -eq 1], + [AC_MSG_WARN([Cannot find libltdl support,]) + AC_MSG_WARN([but --enable-dlopen was specified]) + AC_MSG_WARN([or this is a developer build.]) + AC_MSG_ERROR([Cannot continue.])]) + OPAL_ENABLE_DLOPEN_SUPPORT=0]) + ]) + + AS_IF([test $OPAL_ENABLE_DLOPEN_SUPPORT -eq 1], + [CPPFLAGS="$CPPFLAGS $libltdl_CPPFLAGS" + LDFLAGS="$LDFLAGS $libltdl_LDFLAGS" + LIBS="$LIBS $libltdl_LIBS" + + # Check for lt_dladvise_init; warn if we don't have it + # (because it's just a good thing to have). + AC_CHECK_FUNC([lt_dladvise_init], + [OPAL_HAVE_LTDL_ADVISE=1], + [AC_MSG_WARN([*********************************************]) + AC_MSG_WARN([Could not find lt_dladvise_init in libltdl]) + AC_MSG_WARN([This could mean that your libltdl version]) + AC_MSG_WARN([is old. If you could upgrade, that would be great.]) + AC_MSG_WARN([*********************************************]) + ]) + + AC_MSG_CHECKING([for lt_dladvise]) + AS_IF([test $OPAL_HAVE_LTDL_ADVISE -eq 1], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + ]) + + # If we have no dlopen support, we have to tell the OPAL MCA setup + # macro that we need to build all the components as static. + AS_IF([test $OPAL_ENABLE_DLOPEN_SUPPORT -eq 0], + [enable_mca_dso=no + enable_mca_static=yes]) - # Check for lt_dladvise_init; warn if we don't have - # it - AC_CHECK_FUNC([lt_dladvise_init], - [OPAL_HAVE_LTDL_ADVISE=1], - [AC_MSG_WARN([*********************************************]) - AC_MSG_WARN([Could not find lt_dladvise_init in the]) - AC_MSG_WARN([external libltdl installation.]) - AC_MSG_WARN([This could mean that your libltdl version]) - AC_MSG_WARN([is old. We recommend that you re-configure]) - AC_MSG_WARN([Open MPI with --with-libltdl=internal to]) - AC_MSG_WARN([use the internal libltdl copy in Open MPI.]) - AC_MSG_WARN([]) - AC_MSG_WARN([Sleeping 10 seconds to give you a]) - AC_MSG_WARN([chance to read this message.]) - AC_MSG_WARN([*********************************************]) - sleep 10 - ]) - ]) - ]) - - AC_SUBST(LTDLINCL) - AC_SUBST(LIBLTDL) - AC_SUBST(LIBLTDL_SUBDIR) - - AC_MSG_CHECKING([for lt_dladvise]) - AS_IF([test $OPAL_HAVE_LTDL_ADVISE -eq 1], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) AC_DEFINE_UNQUOTED(OPAL_HAVE_LTDL_ADVISE, $OPAL_HAVE_LTDL_ADVISE, - [Whether libltdl appears to have the lt_dladvise interface]) - + [Whether libltdl has the lt_dladvise interface]) AC_DEFINE_UNQUOTED(OPAL_WANT_LIBLTDL, $OPAL_ENABLE_DLOPEN_SUPPORT, [Whether to include support for libltdl or not]) - AC_DEFINE_UNQUOTED(OPAL_LIBLTDL_INTERNAL, $OPAL_LIBLTDL_INTERNAL, - [Whether we are using the internal libltdl or not]) AM_CONDITIONAL(OPAL_HAVE_DLOPEN, - [test "$OPAL_ENABLE_DLOPEN_SUPPORT" = "1"]) - OPAL_VAR_SCOPE_POP([HAPPY]) -])dnl - - -# -# Setup to build the internal copy of libltdl -# -AC_DEFUN([_OPAL_SETUP_LIBLTDL_INTERNAL],[ - OPAL_VAR_SCOPE_PUSH([CFLAGS_save CPPFLAGS_save]) - - opal_subdir_args="$opal_subdir_args --enable-ltdl-convenience --disable-ltdl-install" - if test "$enable_shared" = "yes"; then - opal_subdir_args="$opal_subdir_args --enable-shared" - else - opal_subdir_args="$opal_subdir_args --disable-shared" - fi - if test "$enable_static" = "yes"; then - opal_subdir_args="$opal_subdir_args --enable-static" - else - opal_subdir_args="$opal_subdir_args --disable-static" - fi - - CFLAGS_save=$CFLAGS - CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS" - - # VPATH support will be included by default in CONFIG_SUBDIR - OPAL_CONFIG_SUBDIR(opal/libltdl, [$opal_subdir_args], - [HAPPY=1], [HAPPY=0]) - if test $HAPPY -eq 1; then - LIBLTDL_SUBDIR=libltdl - OPAL_LIBLTDL_INTERNAL=1 - - CPPFLAGS_save=$CPPFLAGS - CPPFLAGS="-I$srcdir -I$srcdir/opal/libltdl" - AC_EGREP_HEADER([lt_dladvise_init], [opal/libltdl/ltdl.h], - [OPAL_HAVE_LTDL_ADVISE=1]) - CPPFLAGS=$CPPFLAGS_save - - # --export-dynamic allows exported symbols to be resolved via - # --dlsym and friends. - LDFLAGS="-export-dynamic $LDFLAGS" - else - AC_MSG_WARN([Failed to build GNU libltdl. This usually means that something]) - AC_MSG_WARN([is incorrectly setup with your environment. There may be useful information in]) - AC_MSG_WARN([opal/libltdl/config.log. You can also disable GNU libltdl, which will disable]) - AC_MSG_WARN([dynamic shared object loading, by configuring with --disable-dlopen.]) - AC_MSG_ERROR([Cannot continue]) - fi - CFLAGS=$CFLAGS_save - - OPAL_VAR_SCOPE_POP + [test $OPAL_ENABLE_DLOPEN_SUPPORT -eq 1]) ])dnl diff --git a/configure.ac b/configure.ac index 254de117cb1..5492929edcd 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 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-2008 Sun Microsystems, Inc. All rights reserved. # Copyright (c) 2006-2011 Los Alamos National Security, LLC. All rights # reserved. @@ -866,6 +866,13 @@ OPAL_SEARCH_LIBS_CORE([ceil], [m]) # -lrt might be needed for clock_gettime OPAL_SEARCH_LIBS_CORE([clock_gettime], [rt]) +# See if we can find libltdl +OPAL_SETUP_LIBLTDL + +# Do some more CUDA checks after we determine whether we have libltdl +# support or not +OPAL_CHECK_CUDA_AFTER_LIBLTDL + AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair strncpy_s usleep mkfifo dbopen dbm_open statfs statvfs setpgid setenv]) # Sanity check: ensure that we got at least one of statfs or statvfs. @@ -1223,8 +1230,6 @@ fi # a C++ compiler. AS_IF([test "$OMPI_WANT_FORTRAN_BINDINGS" != "1"],[F77=no FC=no]) -LT_CONFIG_LTDL_DIR([opal/libltdl], [subproject]) -LTDL_CONVENIENCE LT_INIT([dlopen win32-dll]) # What's the suffix of shared libraries? Inspired by generated @@ -1261,8 +1266,6 @@ esac AC_SUBST(OPAL_DYN_LIB_PREFIX) AC_SUBST(OPAL_DYN_LIB_SUFFIX) -OPAL_SETUP_LIBLTDL - # Need the libtool binary before the rpathify stuff LT_OUTPUT diff --git a/contrib/nightly/reports/check_devel_headers.pl b/contrib/nightly/reports/check_devel_headers.pl old mode 100755 new mode 100644 index 65c308d963a..0b14cef51cf --- a/contrib/nightly/reports/check_devel_headers.pl +++ b/contrib/nightly/reports/check_devel_headers.pl @@ -10,6 +10,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. +# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -90,11 +91,6 @@ sub wanted { elsif ($parts[0] eq "ompi" && $parts[1] eq "mpi" && $parts[2] eq "f90") { return; } - # The only file we want in opal/libltdl is ltdl.h - elsif ($parts[0] eq "opal" && $parts[1] eq "libltdl" && - $name ne "ltdl.h") { - return; - } # The only file we want in opal/event is event.h elsif ($parts[0] eq "opal" && $parts[1] eq "event" && $name ne "event.h") { diff --git a/ompi/debuggers/Makefile.am b/ompi/debuggers/Makefile.am index c23ec361827..b3d0c648a2c 100644 --- a/ompi/debuggers/Makefile.am +++ b/ompi/debuggers/Makefile.am @@ -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) 2007-2013 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -46,8 +46,7 @@ headers = \ # Simple checks to ensure that the DSOs are functional dlopen_test_SOURCES = dlopen_test.c -dlopen_test_CPPFLAGS = -I$(top_srcdir)/opal/libltdl -dlopen_test_LDADD = $(top_builddir)/opal/libltdl/libltdlc.la +dlopen_test_LDADD = -lltdl predefined_gap_test_SOURCES = predefined_gap_test.c predefined_gap_test_LDFLAGS = $(WRAPPER_EXTRA_LDFLAGS) diff --git a/ompi/debuggers/dlopen_test.c b/ompi/debuggers/dlopen_test.c index 029a4ee3817..73c628b8d4a 100644 --- a/ompi/debuggers/dlopen_test.c +++ b/ompi/debuggers/dlopen_test.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -12,8 +12,9 @@ #include #include #include - -#include "opal/libltdl/ltdl.h" +#if OPAL_WANT_LIBLTDL +#include +#endif static int do_test(void); diff --git a/opal/Makefile.am b/opal/Makefile.am index 72201662981..5bfd0637fb3 100644 --- a/opal/Makefile.am +++ b/opal/Makefile.am @@ -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) 2009-2014 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -19,7 +19,6 @@ SUBDIRS = \ include \ - $(LIBLTDL_SUBDIR) \ asm \ datatype \ etc \ @@ -30,12 +29,8 @@ SUBDIRS = \ . \ $(MCA_opal_FRAMEWORK_COMPONENT_DSO_SUBDIRS) -# libltdl is included by variable because if --disable-dlopen was -# used, there will be no generated Makefile in that directory (and -# therefore make distclean will fail). DIST_SUBDIRS = \ include \ - $(LIBLTDL_SUBDIR) \ asm \ datatype \ etc \ @@ -49,7 +44,6 @@ DIST_SUBDIRS = \ lib_LTLIBRARIES = lib@OPAL_LIB_PREFIX@open-pal.la lib@OPAL_LIB_PREFIX@open_pal_la_SOURCES = lib@OPAL_LIB_PREFIX@open_pal_la_LIBADD = \ - $(LIBLTDL) \ asm/libasm.la \ datatype/libdatatype.la \ mca/base/libmca_base.la \ @@ -69,11 +63,6 @@ lib@OPAL_LIB_PREFIX@open_pal_la_SOURCES += $(headers) if WANT_INSTALL_HEADERS opaldir = $(opalincludedir)/$(subdir) nobase_opal_HEADERS = $(headers) - -# This is somewhat of a hack -- libltdl is installed by libtoolize, -# and us installing the header here is slightly less kludgey than -# hacking their Makefile.am. -nobase_opal_HEADERS += libltdl/ltdl.h endif include class/Makefile.am diff --git a/opal/mca/base/mca_base_component_find.c b/opal/mca/base/mca_base_component_find.c index 790a50c790d..e8955e567e5 100644 --- a/opal/mca/base/mca_base_component_find.c +++ b/opal/mca/base/mca_base_component_find.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * $COPYRIGHT$ * @@ -40,13 +40,8 @@ #ifdef HAVE_NETDB_H #include #endif - #if OPAL_WANT_LIBLTDL - #if OPAL_LIBLTDL_INTERNAL - #include "opal/libltdl/ltdl.h" - #else - #include "ltdl.h" - #endif +#include #endif #include "opal/mca/installdirs/installdirs.h" diff --git a/opal/mca/base/mca_base_component_repository.c b/opal/mca/base/mca_base_component_repository.c index ea1108d400d..3075b7547fd 100644 --- a/opal/mca/base/mca_base_component_repository.c +++ b/opal/mca/base/mca_base_component_repository.c @@ -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) 2008-2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -19,19 +19,15 @@ #include "opal_config.h" + #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include - #if OPAL_WANT_LIBLTDL - #if OPAL_LIBLTDL_INTERNAL - #include "opal/libltdl/ltdl.h" - #else - #include "ltdl.h" - #endif +#include #endif #include "opal/class/opal_list.h" diff --git a/opal/util/lt_interface.c b/opal/util/lt_interface.c index c119c1aea61..10be5cf4591 100644 --- a/opal/util/lt_interface.c +++ b/opal/util/lt_interface.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2013 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ * @@ -9,20 +9,17 @@ */ #include "opal_config.h" + #include #include +#if OPAL_WANT_LIBLTDL +#include +#endif + #include "opal/constants.h" #include "opal/util/lt_interface.h" #include "opal/util/output.h" -#if OPAL_WANT_LIBLTDL - #if OPAL_LIBLTDL_INTERNAL - #include "opal/libltdl/ltdl.h" - #else - #include "ltdl.h" - #endif -#endif - #if OPAL_WANT_LIBLTDL struct opal_lt_dlhandle_st {lt_dlhandle dlhandle;}; struct opal_lt_dladvise_st {lt_dladvise dladvise;};