Skip to content

Commit

Permalink
pmix/config: Update configure logic to check versions
Browse files Browse the repository at this point in the history
 * This attempts to match the current state on OMPI `master`, however
   those commits do not cleanly cherry-pick over so we created a custom
   patch for the changes noted below:
   - 9a5ef60
   - 55923ea
   - 7b115a9
   - 12ecf97
   - 639dbdb
   - af67f16

Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
  • Loading branch information
jjhursey committed Nov 7, 2016
1 parent 0bac57e commit 59b2b63
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ opal/mca/pmix/pmix112/pmix/include/pmix/pmix_common.h
opal/mca/pmix/pmix112/pmix/include/private/autogen/config.h
opal/mca/pmix/pmix112/pmix/include/private/autogen/config.h.in
opal/mca/pmix/pmix112/pmix/include/pmix/autogen/config.h.in
opal/mca/pmix/pmix112/pmix/include/pmix_version.h

opal/tools/opal-checkpoint/opal-checkpoint
opal/tools/opal-checkpoint/opal-checkpoint.1
Expand Down
110 changes: 85 additions & 25 deletions config/opal_check_pmi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
# Copyright (c) 2014-2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -226,11 +227,7 @@ AC_DEFUN([OPAL_CHECK_PMI],[

AC_DEFUN([OPAL_CHECK_PMIX],[
opal_pmix_ext_CPPFLAGS=
opal_pmix_ext_LDFLAGS=
opal_pmix_ext_LIBS=
OPAL_VAR_SCOPE_PUSH([pmix_ext_install_dir])
OPAL_VAR_SCOPE_PUSH([opal_external_pmix_save_CPPFLAGS opal_external_pmix_save_LDFLAGS opal_external_pmix_save_LIBS])
AC_ARG_WITH([pmix],
[AC_HELP_STRING([--with-pmix(=DIR)],
Expand All @@ -245,30 +242,93 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
AC_MSG_CHECKING([if user requested external PMIx support($with_pmix)])
AS_IF([test -z "$with_pmix" || test "$with_pmix" = "yes" || test "$with_pmix" = "internal"],
[AC_MSG_RESULT([no])
opal_external_pmix_happy="no"],
opal_external_pmix_happy=no],
[AC_MSG_RESULT([yes])
# check for external pmix lib */
AS_IF([test "$with_pmix" = "external"],
[pmix_ext_install_dir=/usr],
[pmix_ext_install_dir=$with_pmix])
AC_MSG_CHECKING([if external component can be used])
OPAL_CHECK_PACKAGE([opal_pmix_ext],
[pmix.h],
[pmix],
[PMIx_Init],
[],
[$pmix_ext_install_dir],
[],
[AC_MSG_RESULT([PMIx external support will be built])
opal_external_pmix_happy=yes],
[AC_MSG_RESULT([no])
AC_MSG_WARN([External PMIx support was requested but failed])
AC_MSG_WARN([as explained above.])
AC_MSG_ERROR([Cannot continue])])
])
AC_SUBST(opal_pmix_ext_CPPFLAGS)
AC_SUBST(opal_pmix_ext_LDFLAGS)
AC_SUBST(opal_pmix_ext_LIBS)
# Make sure we have the headers and libs in the correct location
OPAL_CHECK_WITHDIR([external-pmix], [$pmix_ext_install_dir/include], [pmix.h])
OPAL_CHECK_WITHDIR([external-libpmix], [$pmix_ext_install_dir/lib], [libpmix.*])
# check the version
opal_external_pmix_save_CPPFLAGS=$CPPFLAGS
opal_external_pmix_save_LDFLAGS=$LDFLAGS
opal_external_pmix_save_LIBS=$LIBS
# if the pmix_version.h file does not exist, then
# this must be from a pre-1.1.5 version
AC_MSG_CHECKING([PMIx version])
CPPFLAGS="-I$pmix_ext_install_dir/include $CPPFLAGS"
AS_IF([test "x`ls $pmix_ext_install_dir/include/pmix_version.h 2> /dev/null`" = "x"],
[AC_MSG_RESULT([version file not found - assuming v1.1.4])
opal_external_pmix_version_found=1
opal_external_pmix_version=114],
[AC_MSG_RESULT([version file found])
opal_external_pmix_version_found=0])
# if it does exist, then we need to parse it to find
# the actual release series
AS_IF([test "$opal_external_pmix_version_found" = "0"],
[AC_MSG_CHECKING([version 3x])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
#include <pmix_version.h>
#if (PMIX_VERSION_MAJOR != 3L)
#error "not version 3"
#endif
], [])],
[AC_MSG_RESULT([found])
opal_external_pmix_version=3X
opal_external_pmix_version_found=1
AC_MSG_WARN([This version of Open MPI does not support PMIx version 2.x and later])
AC_MSG_ERROR([Cannot continue])],
[AC_MSG_RESULT([not found])])])
AS_IF([test "$opal_external_pmix_version_found" = "0"],
[AC_MSG_CHECKING([version 2x])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
#include <pmix_version.h>
#if (PMIX_VERSION_MAJOR != 2L)
#error "not version 2"
#endif
], [])],
[AC_MSG_RESULT([found])
opal_external_pmix_version=2X
opal_external_pmix_version_found=1
AC_MSG_WARN([This version of Open MPI does not support PMIx version 2.x and later])
AC_MSG_ERROR([Cannot continue])],
[AC_MSG_RESULT([not found])])])
AS_IF([test "$opal_external_pmix_version_found" = "0"],
[AC_MSG_CHECKING([version 1x])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
#include <pmix_version.h>
#if (PMIX_VERSION_MAJOR != 1L)
#error "not version 1"
#endif
], [])],
[AC_MSG_RESULT([found])
opal_external_pmix_version=1X
opal_external_pmix_version_found=1],
[AC_MSG_RESULT([not found])])])
AS_IF([test "x$opal_external_pmix_version" = "x"],
[AC_MSG_WARN([External PMIx support requested, but version])
AC_MSG_WARN([information of the external lib could not])
AC_MSG_WARN([be detected])
AC_MSG_ERROR([cannot continue])])
CPPFLAGS=$opal_external_pmix_save_CPPFLAGS
LDFLAGS=$opal_external_pmix_save_LDFLAGS
LIBS=$opal_external_pmix_save_LIBS
opal_external_pmix_CPPFLAGS="-I$pmix_ext_install_dir/include"
opal_external_pmix_LDFLAGS=-L$pmix_ext_install_dir/lib
opal_external_pmix_LIBS=-lpmix
opal_external_pmix_happy=yes])
OPAL_VAR_SCOPE_POP
])
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ m4_ifdef([project_oshmem],
OPAL_CONFIGURE_OPTIONS
OPAL_CHECK_OS_FLAVORS
OPAL_CHECK_CUDA
OPAL_CHECK_PMIX
m4_ifdef([project_orte], [ORTE_CONFIGURE_OPTIONS])
m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS])
m4_ifdef([project_oshmem], [OSHMEM_CONFIGURE_OPTIONS])
Expand Down
12 changes: 6 additions & 6 deletions opal/mca/pmix/external/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pmix_external_la_SOURCES = $(sources)
mca_pmix_external_la_CFLAGS =
mca_pmix_external_la_CPPFLAGS = $(opal_pmix_ext_CPPFLAGS)
mca_pmix_external_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext_LDFLAGS)
mca_pmix_external_la_LIBADD = $(opal_pmix_ext_LIBS) \
mca_pmix_external_la_CPPFLAGS = $(opal_pmix_external_CPPFLAGS)
mca_pmix_external_la_LDFLAGS = -module -avoid-version $(opal_pmix_external_LDFLAGS)
mca_pmix_external_la_LIBADD = $(opal_pmix_external_LIBS) \
$(OPAL_TOP_BUILDDIR)/opal/mca/event/lib@OPAL_LIB_PREFIX@mca_event.la \
$(OPAL_TOP_BUILDDIR)/opal/mca/hwloc/lib@OPAL_LIB_PREFIX@mca_hwloc.la

noinst_LTLIBRARIES = $(component_noinst)
libmca_pmix_external_la_SOURCES =$(sources)
libmca_pmix_external_la_CFLAGS =
libmca_pmix_external_la_CPPFLAGS = $(opal_pmix_ext_CPPFLAGS)
libmca_pmix_external_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext_LDFLAGS)
libmca_pmix_external_la_LIBADD = $(opal_pmix_ext_LIBS)
libmca_pmix_external_la_CPPFLAGS = $(opal_pmix_external_CPPFLAGS)
libmca_pmix_external_la_LDFLAGS = -module -avoid-version $(opal_pmix_external_LDFLAGS)
libmca_pmix_external_la_LIBADD = $(opal_pmix_external_LIBS)
42 changes: 34 additions & 8 deletions opal/mca/pmix/external/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# and Technology (RIST). All rights reserved.
# Copyright (c) 2014-2015 Mellanox Technologies, Inc.
# All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -30,16 +31,41 @@
AC_DEFUN([MCA_opal_pmix_external_CONFIG],[
AC_CONFIG_FILES([opal/mca/pmix/external/Makefile])

AC_REQUIRE([OPAL_CHECK_PMIX])

AS_IF([test "$opal_external_pmix_happy" = "yes"],
[AS_IF([test "$opal_event_external_want" != "yes" || test "$opal_hwloc_external_support" != "yes"],
[AS_IF([test "$opal_event_external_support" != "yes"],
[AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL LIBEVENT])
AC_MSG_WARN([AND EXTERNAL HWLOC LIBRARIES. THESE LIBRARIES MUST POINT])
AC_MSG_WARN([TO THE SAME ONES USED TO BUILD PMIX OR ELSE UNPREDICTABLE])
AC_MSG_WARN([BEHAVIOR MAY RESULT])
AC_MSG_WARN([LIBRARY. THIS LIBRARY MUST POINT TO THE SAME ONE USED])
AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT])
AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])])
AS_IF([test "$opal_hwloc_external_support" != "yes"],
[AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL HWLOC])
AC_MSG_WARN([LIBRARY THIS LIBRARY MUST POINT TO THE SAME ONE USED ])
AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT])
AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])])
external_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi/$opal_pmix_external_basedir/pmix -I${includedir}/openmpi/$opal_pmix_external_basedir/pmix/include'
$1],

# check for the 1.1.4 version
AC_MSG_CHECKING([if external component is version 1.1.4 or compatible])
AS_IF([test "$opal_external_pmix_version" = "11" ||
test "$opal_external_pmix_version" = "114" ||
test "$opal_external_pmix_version" = "1X"],
[AC_MSG_RESULT([yes])
opal_pmix_external_11_happy=yes],
[AC_MSG_RESULT([no])
opal_pmix_external_11_happy=no])

AS_IF([test "$opal_pmix_external_11_happy" = "yes"],
[$1
# need to set the wrapper flags for static builds
pmix_external_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS
pmix_external_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS],
[$2])],
[$2])

opal_pmix_external_CPPFLAGS=$opal_external_pmix_CPPFLAGS
opal_pmix_external_LDFLAGS=$opal_external_pmix_LDFLAGS
opal_pmix_external_LIBS=$opal_external_pmix_LIBS

AC_SUBST([opal_pmix_external_CPPFLAGS])
AC_SUBST([opal_pmix_external_LDFLAGS])
AC_SUBST([opal_pmix_external_LIBS])
])dnl
15 changes: 14 additions & 1 deletion opal/mca/pmix/pmix112/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2015-2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -38,7 +39,19 @@ AC_DEFUN([MCA_opal_pmix_pmix112_CONFIG],[
opal_pmix_pmix112_save_LDFLAGS=$LDFLAGS
opal_pmix_pmix112_save_LIBS=$LIBS

opal_pmix_pmix112_args="--enable-embedded-mode --with-pmix-symbol-prefix=opal_pmix_pmix112_ --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\" --with-hwloc-header=\\\"$opal_hwloc_base_include\\\""
AC_ARG_ENABLE([pmix-dstore],
[AC_HELP_STRING([--enable-pmix-dstore],
[Enable PMIx shared memory data store (default: disabled)])])
AC_MSG_CHECKING([if PMIx shared memory data store is enabled])
if test "$enable_pmix3_dstore" == "yes"; then
AC_MSG_RESULT([yes])
opal_pmix_pmix_sm_flag=--enable-dstore
else
AC_MSG_RESULT([no (disabled)])
opal_pmix_pmix_sm_flag=--disable-dstore
fi

opal_pmix_pmix112_args="--enable-embedded-mode --with-pmix-symbol-prefix=opal_pmix_pmix112_ $opal_pmix_pmix_sm_flag --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\" --with-hwloc-header=\\\"$opal_hwloc_base_include\\\""
AS_IF([test "$enable_debug" = "yes"],
[opal_pmix_pmix112_args="--enable-debug $opal_pmix_pmix112_args"
CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"],
Expand Down

0 comments on commit 59b2b63

Please sign in to comment.