2011-10-05 21:14:24 +04:00
|
|
|
# -*- 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.
|
2011-11-03 06:14:47 +04:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2011-10-05 21:14:24 +04:00
|
|
|
# University of Stuttgart. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2011-10-18 00:51:22 +04:00
|
|
|
# Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved.
|
2011-10-05 21:14:24 +04:00
|
|
|
# Copyright (c) 2011 Los Alamos National Security, LLC. All rights
|
|
|
|
# reserved.
|
|
|
|
# $COPYRIGHT$
|
2011-11-03 06:14:47 +04:00
|
|
|
#
|
2011-10-05 21:14:24 +04:00
|
|
|
# Additional copyrights may follow
|
2011-11-03 06:14:47 +04:00
|
|
|
#
|
2011-10-05 21:14:24 +04:00
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
|
|
|
# ORTE_CHECK_PMI(prefix, [action-if-found], [action-if-not-found])
|
|
|
|
# --------------------------------------------------------
|
|
|
|
AC_DEFUN([ORTE_CHECK_PMI],[
|
2011-10-13 00:59:25 +04:00
|
|
|
AC_ARG_WITH([pmi],
|
|
|
|
[AC_HELP_STRING([--with-pmi],
|
|
|
|
[Build PMI support (default: no)])],
|
|
|
|
[], with_pmi=no)
|
2011-10-21 08:54:38 +04:00
|
|
|
AC_ARG_WITH([cray-pmi2-ext],
|
|
|
|
[AC_HELP_STRING([--with-cray-pmi-ext],
|
|
|
|
[Include Cray PMI2 extensions (default: no)])],
|
|
|
|
[], with_cray_pmi2_ext=no)
|
2011-10-13 00:59:25 +04:00
|
|
|
|
|
|
|
orte_enable_pmi=0
|
2011-10-21 08:54:38 +04:00
|
|
|
orte_use_cray_pmi2_ext=0
|
2011-10-13 00:59:25 +04:00
|
|
|
|
|
|
|
# save flags
|
|
|
|
orte_check_pmi_$1_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
orte_check_pmi_$1_save_LDFLAGS="$LDFLAGS"
|
|
|
|
orte_check_pmi_$1_save_LIBS="$LIBS"
|
|
|
|
|
|
|
|
# set defaults
|
|
|
|
orte_check_pmi_$1_LDFLAGS=
|
|
|
|
orte_check_pmi_$1_CPPFLAGS=
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if user requested PMI support])
|
|
|
|
AS_IF([test "$with_pmi" = "no"],
|
|
|
|
[AC_MSG_RESULT([no])
|
2011-11-03 06:14:47 +04:00
|
|
|
orte_use_cray_pmi2_ext=0
|
|
|
|
$3],
|
2011-10-13 00:59:25 +04:00
|
|
|
[AC_MSG_RESULT([yes])
|
|
|
|
AC_MSG_CHECKING([if PMI support installed])
|
|
|
|
# cannot use OMPI_CHECK_PACKAGE as its backend header
|
|
|
|
# support appends "include" to the path, which won't
|
|
|
|
# work with slurm :-(
|
|
|
|
AS_IF([test ! -z "$with_pmi" -a "$with_pmi" != "yes"],
|
|
|
|
[AS_IF([test -d "$with_pmi/lib64"],
|
|
|
|
[orte_check_pmi_$1_LDFLAGS="-L$with_pmi/lib64"],
|
|
|
|
[orte_check_pmi_$1_LDFLAGS="-L$with_pmi/lib"])
|
2011-10-21 08:54:38 +04:00
|
|
|
AS_IF([test -f "$with_pmi/include/pmi.h"],
|
|
|
|
[orte_check_pmi_$1_CPPFLAGS="-I$with_pmi/include"],
|
|
|
|
[AS_IF([test -f "$with_pmi/include/slurm/pmi.h"],
|
|
|
|
[orte_check_pmi_$1_CPPFLAGS="-I$with_pmi/include/slurm"])])],
|
2011-10-13 00:59:25 +04:00
|
|
|
[AS_IF([test -f "/usr/include/slurm/pmi.h"],
|
|
|
|
[orte_check_pmi_$1_CPPFLAGS="-I/usr/include/slurm"])])
|
2011-10-21 08:54:38 +04:00
|
|
|
|
2011-10-13 00:59:25 +04:00
|
|
|
LDFLAGS="$LDFLAGS $orte_check_pmi_$1_LDFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $orte_check_pmi_$1_CPPFLAGS"
|
|
|
|
LIBS="$LIBS -lpmi"
|
|
|
|
orte_have_pmi_support=no
|
|
|
|
AC_CHECK_HEADERS([pmi.h],
|
|
|
|
[AC_CHECK_LIB([pmi], [PMI_Init],
|
|
|
|
[orte_have_pmi_support=yes])])
|
|
|
|
|
|
|
|
AS_IF([test "$orte_have_pmi_support" = "yes"],
|
|
|
|
[AC_MSG_RESULT([yes])
|
|
|
|
orte_enable_pmi=1
|
|
|
|
$1_LDFLAGS="$orte_check_pmi_$1_LDFLAGS"
|
|
|
|
$1_CPPFLAGS="$orte_check_pmi_$1_CPPFLAGS"
|
|
|
|
$1_LIBS="-lpmi"
|
2012-01-28 00:56:21 +04:00
|
|
|
AS_IF([test -z "$orte_pmi_wrapper_flags_added"],
|
|
|
|
[orte_pmi_wrapper_flags_added=yes
|
|
|
|
WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $orte_check_pmi_$1_LDFLAGS"
|
|
|
|
WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lpmi"])
|
2011-10-13 00:59:25 +04:00
|
|
|
$2],
|
|
|
|
[AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_WARN([PMI support requested (via --with-pmi) but not found.])
|
|
|
|
AC_MSG_ERROR([Aborting.])
|
2011-10-21 08:54:38 +04:00
|
|
|
$3])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if user requested Cray PMI2 extensions])
|
|
|
|
AS_IF([test "$with_cray_pmi2_ext" = "no"],
|
|
|
|
[AC_MSG_RESULT([no])
|
|
|
|
orte_use_pmi2_ext=0],
|
|
|
|
[AC_MSG_RESULT([yes])
|
|
|
|
# check to see if pmi2.h header is present. if it is, then we
|
|
|
|
# will use some of the functions in it.
|
|
|
|
AC_MSG_CHECKING([if PMI2 extensions installed])
|
|
|
|
AS_IF([test -f "$with_pmi/include/pmi2.h"],
|
2011-11-03 06:14:47 +04:00
|
|
|
[orte_use_pmi2_ext=1
|
|
|
|
AC_MSG_RESULT(yes)],
|
2011-10-21 08:54:38 +04:00
|
|
|
[AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_WARN([PMI2 extensions requested (via --with-cray-pmi2-ext) but not found.])
|
|
|
|
AC_MSG_ERROR([Aborting.])
|
|
|
|
orte_use_pmi2_ext=0
|
|
|
|
orte_enable_pmi=0
|
|
|
|
$3])])])
|
2011-10-13 00:59:25 +04:00
|
|
|
|
2011-10-21 08:54:38 +04:00
|
|
|
# restore flags - have to add CPPFLAGS so base functions can find pmi.h
|
|
|
|
CPPFLAGS="$orte_check_pmi_$1_save_CPPFLAGS $orte_check_pmi_$1_CPPFLAGS"
|
2011-10-13 00:59:25 +04:00
|
|
|
LDFLAGS="$orte_check_pmi_$1_save_LDFLAGS"
|
|
|
|
LIBS="$orte_check_pmi_$1_save_LIBS"
|
|
|
|
|
2011-10-05 21:14:24 +04:00
|
|
|
AC_DEFINE_UNQUOTED([WANT_PMI_SUPPORT],
|
|
|
|
[$orte_enable_pmi],
|
|
|
|
[Whether we want PMI support])
|
2011-10-21 08:54:38 +04:00
|
|
|
AC_DEFINE_UNQUOTED([WANT_CRAY_PMI2_EXT],
|
|
|
|
[$orte_use_pmi2_ext],
|
|
|
|
[Whether we want to use Cray PMI2 extensions])
|
2011-10-18 00:51:22 +04:00
|
|
|
AM_CONDITIONAL(WANT_PMI_SUPPORT, [test "$orte_enable_pmi" = 1])
|
2011-10-05 21:14:24 +04:00
|
|
|
])
|