Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Replace libltdl with OPAL "dl" framework #410

Merged
merged 9 commits into from
Mar 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 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 @@ -1977,6 +1977,7 @@ backtrace - Debugging call stack backtrace support
compress - Compression algorithms
crs - Checkpoint and restart service
db - Internal database support
dl - Dynamic loading library interface
event - Event library (libevent) versioning support
hwloc - Hardware locality (hwloc) versioning support
if - OS IP interface support
Expand Down
23 changes: 1 addition & 22 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,26 +1291,6 @@ 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(".");

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

verbose "
================================================
Open MPI autogen: completed successfully. w00t!
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.

30 changes: 25 additions & 5 deletions config/opal_check_cuda.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-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
Expand Down Expand Up @@ -72,10 +72,12 @@ AS_IF([test "$with_cuda" = "no" || test "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" && test "$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, at
dnl this point in configure, we can't know whether the DL framework
dnl has been configured or not yet (it likely hasn't, since CUDA is a
dnl common framework, and likely configured first). So we have to
dnl defer this check until later (see the OPAL_CHECK_CUDA_AFTER_OPAL_DL m4
dnl macro, below). :-(

# If we have CUDA support, check to see if we have CUDA 4.1 support
AS_IF([test "$opal_check_cuda_happy"="yes"],
Expand Down Expand Up @@ -142,3 +144,21 @@ AC_DEFINE_UNQUOTED([OPAL_CUDA_GDR_SUPPORT],$CUDA_VERSION_60_OR_GREATER,
[Whether we have CUDA GDR support available])

])

dnl
dnl CUDA support requires DL support (it dynamically opens the CUDA
dnl library at run time). But we do not check for OPAL DL support
dnl until lafter the initial OPAL_CHECK_CUDA is called. So put the
dnl CUDA+DL check in a separate macro that can be called after the DL MCA
dnl framework checks in the top-level configure.ac.
dnl
AC_DEFUN([OPAL_CHECK_CUDA_AFTER_OPAL_DL],[

# We cannot have CUDA support without OPAL DL support. Error out
# if the user wants CUDA but we do not have OPAL DL support.
AS_IF([test $OPAL_HAVE_DL_SUPPORT -eq 0 && \
test "$opal_check_cuda_happy" = "yes"],
[AC_MSG_WARN([--with-cuda was specified, but dlopen support is disabled.])
AC_MSG_WARN([You must reconfigure Open MPI with dlopen ("dl") support.])
AC_MSG_ERROR([Cannot continue.])])
])
2 changes: 1 addition & 1 deletion 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
195 changes: 0 additions & 195 deletions config/opal_setup_libltdl.m4

This file was deleted.

16 changes: 12 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,18 @@ m4_ifdef([project_ompi], [OMPI_REQUIRE_ENDPOINT_TAG_FINI])
# checkpoint results
AC_CACHE_SAVE

##################################
# CUDA: part two
##################################

# This is somewhat gross to have a configure check for a common MCA
# component outside of the normal MCA checks, but this check must come
# after the opal DL MCA checks have done. Someday this could perhaps
# be done better by having some kind of "run this check at the end of
# all other MCA checks" hook...?

OPAL_CHECK_CUDA_AFTER_OPAL_DL

##################################
# MPI Extended Interfaces
##################################
Expand Down Expand Up @@ -1218,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
Expand Down Expand Up @@ -1256,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

Expand Down
Loading