Skip to content
Closed
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
63 changes: 61 additions & 2 deletions config/opal_check_pmi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Copyright (c) 2014 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 @@ -251,20 +252,78 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
AS_IF([test "$with_pmix" = "external"],
[pmix_ext_install_dir=/usr],
[pmix_ext_install_dir=$with_pmix])

# 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 if we can compile/link
AC_MSG_CHECKING([if external component can be used])
OPAL_CHECK_PACKAGE([opal_pmix_ext],
[pmix.h],
[pmix],
[PMIx_Init],
[],
[$pmix_ext_install_dir],
[],
[$pmix_ext_install_dir/lib],
[AC_MSG_RESULT([PMIx external support will be built])
opal_external_pmix_happy=yes],
[AC_MSG_RESULT([no])
[opal_external_pmix_happy="no"
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])])

# Check the version
opal_external_pmix_version="unknown"
CPPFLAGS_orig=$CPPFLAGS
LDFLAGS_orig=$LDFLAGS
LIBS_orig=$LIBS
LD_LIBRARY_PATH_orig=$LD_LIBRARY_PATH

CPPFLAGS=$pmix_ext_CPPFLAGS
LDFLAGS=$pmix_ext_LDFLAGS
LIBS=$pmix_ext_LIBS
LD_LIBRARY_PATH=$pmix_ext_install_dir/lib

AC_MSG_CHECKING([PMIx library version])
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <pmix.h>
#include <pmix/pmix_common.h>

int main(int argc, char **argv)
{
const char * version = NULL;
FILE *f = NULL;

f = fopen("conftestval", "w");
if( !f ) exit(1);
version = PMIx_Get_version();
fprintf(f, "%s", version);
fclose(f);

return 0;
}
], [
eval opal_external_pmix_version=`cat conftestval`
AC_MSG_RESULT([$opal_external_pmix_version])
], [
LD_LIBRARY_PATH=$LD_LIBRARY_PATH_orig
opal_external_pmix_happy="no"
AC_MSG_ERROR([External PMIx support requested but could not build/run a test program. Aborting])
], [
LD_LIBRARY_PATH=$LD_LIBRARY_PATH_orig
opal_external_pmix_happy="no"
AC_MSG_ERROR([External PMIx disabled for cross compile. Aborting])
])
CPPFLAGS=$CPPFLAGS_orig
LDFLAGS=$LDFLAGS_orig
LIBS=$LIBS_orig
LD_LIBRARY_PATH=$LD_LIBRARY_PATH_orig

opal_external_pmix_happy="yes"
])
AC_SUBST(opal_pmix_ext_CPPFLAGS)
AC_SUBST(opal_pmix_ext_LDFLAGS)
Expand Down
79 changes: 79 additions & 0 deletions config/opal_check_version.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl

# Parameters: (use a version "1.1.4rc2" as the example)
# * prefix
# Will export a variable $prefix_version_cmp
# - action_if_less => "less"
# - action_if_equal => "equal"
# - action_if_equal_series => "series"
# - action_if_greater => "greater"
# * version_actual
# Actual version string
# * version_desired
# Desired version string to check against
# * action_if_less
# Action to take if the version is strictly less than
# "1.1.3" < "1.1.4rc2"
# * action_if_equal
# Action to take if the version matches exactly
# "1.1.4rc2" = "1.1.4rc2"
# * action_if_equal_series
# Action to take if the version matches to this series
# "1.1.4rc1" ~=~ "1.1.4rc2"
# "1.1.4" ~=~ "1.1.4rc2"
# * action_if_greater
# Action to take if the version is strictly greater than
# "1.1.5" > "1.1.4rc2"
# "2.0" > "1.1.4rc2"
#
# See documentation on m4_version_compare and AS_VERSION_COMPARE for more
# precise definitions
# OPAL_CHECK_VERSION(prefix, version_actual, version_desired,
# action_if_less, action_if_equal, action_if_equal_series,
# action_if_greater)
# ----------------------------------------------------
AC_DEFUN([OPAL_CHECK_VERSION],[
version_actual=$2
version_desired=$3

AC_MSG_CHECKING([Checking library version is $version_desired])
#
# Example: If version_desired=1.1.4 and
# version_actual=1.1.3 -> -1
# version_actual=1.1.4 -> 0
# version_actual=1.1.4rc1 -> 1
# version_actual=1.1.5 -> 1 (need further check)
#
AS_VERSION_COMPARE(["$version_actual"], [$version_desired],
[AC_MSG_RESULT([Earlier than expected ($version_actual < $$version_desired)])
$1_version_cmp="less"
$4],
[AC_MSG_RESULT([Equal])
$1_version_cmp="equal"
$5],
[
# Need further check to make sure we are < 1.1.5
# version_actual=1.1.4rc1 -> -1
# version_actual=1.1.4 -> 0 (caught above)
# version_actual=1.1.5 -> 1
AS_VERSION_COMPARE(["$version_actual"], [$version_desired"zzzz"],
[AC_MSG_RESULT([Within release series ($version_actual)])
$1_version_cmp="series"
$6],
[AC_MSG_RESULT([Within release series ($version_actual)])
$1_version_cmp="series"
$6],
[AC_MSG_RESULT([Later than expected ($version_actual > $$version_desired)])
$1_version_cmp="greater"
$7]
)]
)
])dnl
17 changes: 16 additions & 1 deletion 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 @@ -32,7 +33,21 @@ AC_DEFUN([MCA_opal_pmix_external_CONFIG],[

AC_REQUIRE([OPAL_CHECK_PMIX])

AS_IF([test "$opal_external_pmix_happy" = "yes"],
# We have a different external comment for the 1.1.4 series, so check that
AS_IF([test "$opal_external_pmix_happy" = "yes" ],
[
OPAL_CHECK_VERSION([opal_pmix_external],
[$opal_external_pmix_version],
["1.1.4"],
[opal_external_pmix_version_happy="yes"],
[AC_MSG_WARN([Defer to the 1.1.4 external component])
opal_external_pmix_version_happy="no"],
[AC_MSG_WARN([Defer to the 1.1.4 external component])
opal_external_pmix_version_happy="no"],
[opal_external_pmix_version_happy="yes"])
])

AS_IF([test "$opal_external_pmix_happy" = "yes" && test "$opal_external_pmix_version_happy" = "yes" ],
[AS_IF([test "$opal_event_external_support" != "yes"],
[AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL LIBEVENT])
AC_MSG_WARN([LIBRARY. THIS LIBRARY MUST POINT TO THE SAME ONE USED])
Expand Down
49 changes: 49 additions & 0 deletions opal/mca/pmix/external114/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Cisco Systems, Inc. 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
#
# $HEADER$
#

sources = \
pmix_ext.h \
pmix_ext_component.c \
pmix_ext.c \
pmix_ext_client.c \
pmix_ext_server_south.c \
pmix_ext_server_north.c

# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).

if MCA_BUILD_opal_pmix_external114_DSO
component_noinst =
component_install = mca_pmix_external114.la
else
component_noinst = libmca_pmix_external114.la
component_install =
endif

mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pmix_external114_la_SOURCES = $(sources)
mca_pmix_external114_la_CFLAGS =
mca_pmix_external114_la_CPPFLAGS = $(opal_pmix_ext_CPPFLAGS)
mca_pmix_external114_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext_LDFLAGS)
mca_pmix_external114_la_LIBADD = $(opal_pmix_ext_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_external114_la_SOURCES =$(sources)
libmca_pmix_external114_la_CFLAGS =
libmca_pmix_external114_la_CPPFLAGS = $(opal_pmix_ext_CPPFLAGS)
libmca_pmix_external114_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext_LDFLAGS)
libmca_pmix_external114_la_LIBADD = $(opal_pmix_ext_LIBS)
76 changes: 76 additions & 0 deletions opal/mca/pmix/external114/configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# 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) 2011-2013 Los Alamos National Security, LLC.
# All rights reserved.
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# 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
#
# $HEADER$
#

# MCA_pmix_external114_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_opal_pmix_external114_CONFIG],[
AC_CONFIG_FILES([opal/mca/pmix/external114/Makefile])

AC_REQUIRE([OPAL_CHECK_PMIX])

opal_pmix_external_114_happy="no"
opal_pmix_external_114_version_good="no"

AS_IF([test "$opal_external_pmix_happy" = "yes"],
[OPAL_CHECK_VERSION([opal_pmix_external_114],
[$opal_external_pmix_version],
["1.1.4"],
[opal_pmix_external_114_version_good="no"],
[opal_pmix_external_114_version_good="yes"],
[opal_pmix_external_114_version_good="yes"],
[opal_pmix_external_114_version_good="no"])

AS_IF([test "$opal_pmix_external_114_version_good" = "no"],
[AC_MSG_WARN([External PMIx 1.1.4 component disabled. Incorrect library version ($opal_external_pmix_version)])
$2],
[
# Make sure we have an external libevent
AS_IF([test "$opal_event_external_support" != "yes"],
[AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL LIBEVENT])
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])])

# Make sure we have an external hwloc
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])])
opal_pmix_external_114_happy="yes"
$1]
)
],
[$2]
)

# External wrapper compiler flags
#external114_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi/$opal_pmix_external114_basedir/pmix -I${includedir}/openmpi/$opal_pmix_external114_basedir/pmix/include'

OPAL_VAR_SCOPE_POP
])dnl
Loading