Skip to content

Commit e86a0db

Browse files
author
Ralph Castain
committed
Update to PMIx master to include dlopen fixes and addition of libltdl support
Signed-off-by: Ralph Castain <[email protected]>
1 parent fb67c96 commit e86a0db

File tree

8 files changed

+517
-8
lines changed

8 files changed

+517
-8
lines changed

opal/mca/dl/libltdl/configure.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
44
#
5+
# Copyright (c) 2017 Intel, Inc. All rights reserved.
56
# $COPYRIGHT$
67
#
78
# Additional copyrights may follow
@@ -20,7 +21,7 @@ AC_DEFUN([MCA_opal_dl_libltdl_COMPILE_MODE], [
2021
AC_MSG_RESULT([$$4])
2122
])
2223

23-
# MCA_event_external_POST_CONFIG()
24+
# MCA_opal_dl_libltdl_POST_CONFIG()
2425
# ---------------------------------
2526
AC_DEFUN([MCA_opal_dl_libltdl_POST_CONFIG],[
2627
# If we won, then do all the rest of the setup

opal/mca/pmix/pmix2x/pmix/VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ release=0
2323
# The only requirement is that it must be entirely printable ASCII
2424
# characters and have no white space.
2525

26-
greek=a1
26+
greek=
2727

2828
# If repo_rev is empty, then the repository version number will be
2929
# obtained during "make dist" via the "git describe --tags --always"
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=gitf57d9b2
33+
repo_rev=git129dc44
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Feb 20, 2017"
47+
date="Feb 22, 2017"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix2x/pmix/src/mca/pdl/pdlopen/configure.m4

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Copyright (c) 2016 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
#
7+
# Copyright (c) 2017 Intel, Inc. All rights reserved.
78
# $COPYRIGHT$
89
#
910
# Additional copyrights may follow
@@ -22,6 +23,19 @@ AC_DEFUN([MCA_pmix_pdl_pdlopen_COMPILE_MODE], [
2223
AC_MSG_RESULT([$$3])
2324
])
2425

26+
# MCA_pmix_pdl_pdlopen_POST_CONFIG()
27+
# ---------------------------------
28+
AC_DEFUN([MCA_pmix_pdl_pdlopen_POST_CONFIG],[
29+
# If we won, then do all the rest of the setup
30+
AS_IF([test "$1" = "1"],
31+
[
32+
# Add some stuff to CPPFLAGS so that the rest of the source
33+
# tree can be built
34+
LDFLAGS="$LDFLAGS $pmix_pdl_pdlopen_ADD_LDFLAGS"
35+
LIBS="$LIBS $pmix_pdl_pdlopen_ADD_LIBS"
36+
])
37+
])dnl
38+
2539
# MCA_pdl_pdlopen_CONFIG([action-if-can-compile],
2640
# [action-if-cant-compile])
2741
# ------------------------------------------------
@@ -30,13 +44,13 @@ AC_DEFUN([MCA_pmix_pdl_pdlopen_CONFIG],[
3044

3145
dnl This is effectively a back-door for PMIX developers to
3246
dnl force the use of the libltdl pdl component.
33-
AC_ARG_ENABLE([pdl-dlopen],
34-
[AS_HELP_STRING([--disable-pdl-dlopen],
35-
[Disable the "dlopen" PDL component (and probably force the use of the "libltdl" PDL component). This option should really only be used by PMIX developers. You are probably actually looking for the "--disable-dlopen" option, which disables all dlopen-like functionality from PMIX.])
47+
AC_ARG_ENABLE([dlopen],
48+
[AS_HELP_STRING([--disable-dlopen],
49+
[Disable the "dlopen" PDL component (and probably force the use of the "libltdl" PDL component).])
3650
])
3751

3852
pmix_pdl_pdlopen_happy=no
39-
AS_IF([test "$enable_pdl_dlopen" != "no"],
53+
AS_IF([test "$enable_dlopen" != "no"],
4054
[PMIX_CHECK_PACKAGE([pmix_pdl_pdlopen],
4155
[dlfcn.h],
4256
[dl],
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Copyright (c) 2004-2010 The Trustees of Indiana University.
3+
# All rights reserved.
4+
# Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
5+
# Copyright (c) 2017 Intel, Inc. All rights reserved.
6+
# $COPYRIGHT$
7+
#
8+
# Additional copyrights may follow
9+
#
10+
# $HEADER$
11+
#
12+
13+
sources = \
14+
pdl_libltdl.h \
15+
pdl_libltdl_component.c \
16+
pdl_libltdl_module.c
17+
18+
# This component will only ever be built statically -- never as a DSO.
19+
20+
noinst_LTLIBRARIES = libmca_pdl_plibltdl.la
21+
22+
libmca_pdl_plibltdl_la_SOURCES = $(sources)
23+
libmca_pdl_plibltdl_la_CPPFLAGS = $(pmix_pdl_plibltdl_CPPFLAGS)
24+
libmca_pdl_plibltdl_la_LDFLAGS = \
25+
$(pmix_pdl_plibltdl_LDFLAGS) \
26+
-module -avoid-version
27+
libmca_pdl_plibltdl_la_LIBADD = $(pmix_pdl_plibltdl_LIBS)
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# -*- shell-script -*-
2+
#
3+
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
4+
#
5+
# Copyright (c) 2017 Intel, Inc. All rights reserved.
6+
# $COPYRIGHT$
7+
#
8+
# Additional copyrights may follow
9+
#
10+
# $HEADER$
11+
#
12+
13+
AC_DEFUN([MCA_pmix_pdl_plibltdl_PRIORITY], [50])
14+
15+
#
16+
# Force this component to compile in static-only mode
17+
#
18+
AC_DEFUN([MCA_pmix_pdl_plibltdl_COMPILE_MODE], [
19+
AC_MSG_CHECKING([for MCA component $1:$2 compile mode])
20+
$3="static"
21+
AC_MSG_RESULT([$$3])
22+
])
23+
24+
# MCA_pmix_pdl_plibltdl_POST_CONFIG()
25+
# ---------------------------------
26+
AC_DEFUN([MCA_pmix_pdl_plibltdl_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 $pmix_pdl_plibltdl_ADD_LDFLAGS"
33+
LIBS="$LIBS $pmix_pdl_plibltdl_ADD_LIBS"
34+
])
35+
])dnl
36+
37+
# MCA_dl_plibltdl_CONFIG([action-if-can-compile],
38+
# [action-if-cant-compile])
39+
# ------------------------------------------------
40+
AC_DEFUN([MCA_pmix_pdl_plibltdl_CONFIG],[
41+
PMIX_VAR_SCOPE_PUSH([CPPFLAGS_save LDFLAGS_save LIBS_save])
42+
AC_CONFIG_FILES([src/mca/pdl/plibltdl/Makefile])
43+
44+
# Add --with options
45+
AC_ARG_WITH([plibltdl],
46+
[AC_HELP_STRING([--with-libltdl(=DIR)],
47+
[Build libltdl support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
48+
AC_ARG_WITH([libltdl-libdir],
49+
[AC_HELP_STRING([--with-libltdl-libdir=DIR],
50+
[Search for libltdl libraries in DIR])])
51+
52+
# Sanity check the --with values
53+
PMIX_CHECK_WITHDIR([plibltdl], [$with_libltdl],
54+
[include/ltdl.h])
55+
PMIX_CHECK_WITHDIR([plibltdl-libdir], [$with_libltdl_libdir],
56+
[libltdl.*])
57+
58+
# Defaults
59+
pmix_check_plibltdl_dir_msg="compiler default"
60+
pmix_check_plibltdl_libdir_msg="linker default"
61+
62+
# Save directory names if supplied
63+
AS_IF([test ! -z "$with_libltdl" && test "$with_libltdl" != "yes"],
64+
[pmix_check_plibltdl_dir=$with_libltdl
65+
pmix_check_plibltdl_dir_msg="$pmix_check_plibltdl_dir (from --with-libltdl)"])
66+
AS_IF([test ! -z "$with_libltdl_libdir" && test "$with_libltdl_libdir" != "yes"],
67+
[pmix_check_plibltdl_libdir=$with_libltdl_libdir
68+
pmix_check_plibltdl_libdir_msg="$pmix_check_plibltdl_libdir (from --with-libltdl-libdir)"])
69+
70+
pmix_pdl_plibltdl_happy=no
71+
AS_IF([test "$with_plibltdl" != "no"],
72+
[AC_MSG_CHECKING([for libltdl dir])
73+
AC_MSG_RESULT([$pmix_check_plibltdl_dir_msg])
74+
AC_MSG_CHECKING([for libltdl library dir])
75+
AC_MSG_RESULT([$pmix_check_plibltdl_libdir_msg])
76+
77+
PMIX_CHECK_PACKAGE([pmix_pdl_plibltdl],
78+
[ltdl.h],
79+
[ltdl],
80+
[lt_dlopen],
81+
[],
82+
[$pmix_check_plibltdl_dir],
83+
[$pmix_check_plibltdl_libdir],
84+
[pmix_pdl_plibltdl_happy=yes],
85+
[pmix_pdl_plibltdl_happy=no])
86+
])
87+
88+
# If we have plibltdl, do we have lt_dladvise?
89+
pmix_pdl_plibltdl_have_lt_dladvise=0
90+
AS_IF([test "$pmix_pdl_plibltdl_happy" = "yes"],
91+
[CPPFLAGS_save=$CPPFLAGS
92+
LDFLAGS_save=$LDFLAGS
93+
LIBS_save=$LIBS
94+
95+
CPPFLAGS="$pmix_pdl_plibltdl_CPPFLAGS $CPPFLAGS"
96+
LDFLAGS="$pmix_pdl_plibltdl_LDFLAGS $LDFLAGS"
97+
LIBS="$pmix_pdl_plibltdl_LIBS $LIBS"
98+
AC_CHECK_FUNC([lt_dladvise_init],
99+
[pmix_pdl_plibltdl_have_lt_dladvise=1])
100+
CPPFLAGS=$CPPFLAGS_save
101+
LDFLAGS=$LDFLAGS_save
102+
LIBS=$LIBS_save
103+
])
104+
AC_DEFINE_UNQUOTED(PMIX_PDL_PLIBLTDL_HAVE_LT_DLADVISE,
105+
[$pmix_pdl_plibltdl_have_lt_dladvise],
106+
[Whether we have lt_dladvise or not])
107+
108+
AS_IF([test "$pmix_pdl_plibltdl_happy" = "yes"],
109+
[pmix_pdl_plibltdl_ADD_CPPFLAGS=$pmix_pdl_plibltdl_CPPFLAGS
110+
pmix_pdl_plibltdl_ADD_LDFLAGS=$pmix_pdl_plibltdl_LDFLAGS
111+
pmix_pdl_plibltdl_ADD_LIBS=$pmix_pdl_plibltdl_LIBS
112+
$1],
113+
[AS_IF([test ! -z "$with_libltdl" && \
114+
test "$with_libltdl" != "no"],
115+
[AC_MSG_WARN([libltdl support requested (via --with-libltdl) but not found.])
116+
AC_MSG_ERROR([Cannot continue.])])
117+
$2])
118+
119+
AC_SUBST(pmix_pdl_plibltdl_CPPFLAGS)
120+
AC_SUBST(pmix_pdl_plibltdl_LDFLAGS)
121+
AC_SUBST(pmix_pdl_plibltdl_LIBS)
122+
123+
PMIX_VAR_SCOPE_POP
124+
])
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2017 Intel, Inc. All rights reserved.
4+
* $COPYRIGHT$
5+
*
6+
* Additional copyrights may follow
7+
*
8+
* $HEADER$
9+
*/
10+
11+
#ifndef PMIX_DL_LIBLTDL
12+
#define PMIX_DL_LIBLTDL
13+
14+
#include "pmix_config.h"
15+
16+
#include "pmix/mca/dl/dl.h"
17+
18+
#include <ltdl.h>
19+
20+
21+
PMIX_DECLSPEC extern pmix_pdl_base_module_t pmix_pdl_plibltpdl_module;
22+
23+
/*
24+
* Dynamic library handles generated by this component.
25+
*
26+
* If we're debugging, keep a copy of the name of the file we've opened.
27+
*/
28+
struct pmix_pdl_handle_t {
29+
lt_dlhandle ltpdl_handle;
30+
#if PMIX_ENABLE_DEBUG
31+
char *filename;
32+
#endif
33+
};
34+
35+
typedef struct {
36+
pmix_pdl_base_component_t base;
37+
38+
#if PMIX_DL_LIBLTDL_HAVE_LT_DLADVISE
39+
/* If the version of plibltdl that we are compiling against has
40+
lt_dladvise, use it to support opening DSOs in a variety of
41+
modes. */
42+
lt_dladvise advise_private_noext;
43+
lt_dladvise advise_private_ext;
44+
lt_dladvise advise_public_noext;
45+
lt_dladvise advise_public_ext;
46+
#endif
47+
} pmix_pdl_plibltpdl_component_t;
48+
49+
PMIX_DECLSPEC extern pmix_pdl_plibltpdl_component_t mca_pdl_plibltpdl_component;
50+
51+
#endif /* PMIX_DL_LIBLTDL */

0 commit comments

Comments
 (0)