1
1
The mixing of the Slurm PMI and Cray PMI configure was getting
messy and dangerous - developers working on Slurm PMI often don't
have access to Cray PMI, etc.

This mod pulls out the Cray PMI configure into a separate m4 file.
Cray pmi is now configured as follows:

1) on Cray CLE 5 and higher, Cray PMI is auto detected.  pkg-config
   is used to resolve the necessary CPP flags, link flags and libs,
   etc.  Nothing needs to be added to the configure line to pick up
   Cray PMI.

2) on legacy Cray CLE 4 systems with PMI 4.X, Cray PMI is also
   auto detected.

3) on legacy Cray CLE 4 systems with PMI 5.X Cray PMI can't be auto-detected
   owing to changes in the PMI pkg-config file which result in pkg-config
   returning an error owing to a dependency of PMI on newer versions of ALPS
   installs that are not present on CLE 4. So, for those falling in to this
   situation, the --with-cray-pmi=(DIR) method needs to be used.

   DIR specifies the Cray PMI install directory.  The configure file looks
   for required alps libraries first in /usr/lib/alps, then in
   /opt/cray/xe-sysroot/default/usr/lib/alps.
Этот коммит содержится в:
Howard Pritchard 2014-11-04 15:09:10 -07:00
родитель 6164dc4960
Коммит 67b0f8de7f
2 изменённых файлов: 111 добавлений и 54 удалений

111
config/opal_check_cray_pmi.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,111 @@
# -*- shell-script ; indent-tabs-mode:nil -*-
#
# 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) 2009-2011 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 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AC_DEFUN([OPAL_CHECK_CRAY_PMI_EXPLICIT],[
opal_cray_pmi_lib_good=0
opal_cray_pmi_include_good=0
AC_MSG_CHECKING([Checking for Cray PMI with explicit path $with_cray_pmi])
AS_IF([test -d "$with_cray_pmi/lib64"],
[opal_cray_pmi_lib_good=1],
[opal_cray_pmi_lib_good=0
AC_MSG_WARN([No libpmi in path specified by $with_cray_pmi])])
AS_IF([test -f "$with_cray_pmi/include/pmi.h"],
[opal_cray_pmi_include_good=1],
[opal_cray_pmi_include_good=0
AC_MSG_WARN([No pmi.h in path specified by $with_cray_pmi])])
AS_IF([test "$opal_cray_pmi_lib_good" -eq 1 -a "$opal_cray_pmi_include_good" -eq 1],
[CRAY_PMI_LDFLAGS="-L$with_cray_pmi/lib64 -L/usr/lib/alps"
CRAY_PMI_LIBS="-L$with_cray_pmi/lib64 -lpmi"
CRAY_PMI_CFLAGS="-I $with_cray_pmi/include"
$1],
[$2])
#
# this logic assumes knowledge about all the dependencies of the Cray PMI library,
# something that Cray doesn't generally document
#
AS_IF([test "$enable_static" == "yes"],
[AS_IF([test -d /usr/lib/alps],
[AC_MSG_RESULT([Detected presense of /usr/lib/alps])
CRAY_PMI_LDFLAGS="$CRAY_PMI_LDFLAGS -L/usr/lib/alps -lalpslli -lalpsutil"
CRAY_PMI_LIBS="$CRAY_PMI_LIBS -L/usr/lib/alps -lalpslli -lalpsutil"],
[AS_IF([test -d /opt/cray/xe-sysroot/default/usr/lib/alps],
[AC_MSG_RESULT([Detected presense of /opt/cray/xe-sysroot/default/usr/lib/alps])
CRAY_PMI_LDFLAGS="$CRAY_PMI_LDFLAGS -L/opt/cray/xe-sysroot/default/usr/lib/alps -lalpslli -lalpsutil"
CRAY_PMI_LIBS="$CRAY_PMI_LIBS -L/opt/cray/xe-sysroot/default/usr/lib/alps -lalpslli -lalpsutil"],
[AC_MSG_ERROR([Requested enabling static linking but unable to local libalpslli and libalpsutil])])
])
])
])
#
# special check for cray pmi, uses macro(s) from pkg.m4
#
# OPAL_CHECK_CRAY_PMI(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OPAL_CHECK_CRAY_PMI],[
AC_ARG_WITH([cray_pmi],
[AC_HELP_STRING([--with-cray-pmi(=DIR)],
[Build Cray PMI support, optionally adding DIR to the search path (default: auto)])],
[], with_cray_pmi=auto)
AC_MSG_CHECKING([for Cray PMI support])
AS_IF([test "$with_cray_pmi" = "no"],
[AC_MSG_RESULT([no])
$3],
[AS_IF([test "$with_cray_pmi" = "auto" -o "$with_cray_pmi" = "yes"],
[PKG_CHECK_MODULES_STATIC([CRAY_PMI], [cray-pmi],
[opal_check_cray_pmi_happy="yes"],
[opal_check_cray_pmi_happy="no"]
[AS_IF([test "$with_cray_pmi" = "yes"],
[AC_MSG_WARN([Cray PMI support requested but pkg-config failed.])
AC_MSG_WARN([Need to explicitly indicate cray pmi directory])
AC_MSG_WARN([on the configure line using --with-cray-pmi option.])
AC_MSG_ERROR([Aborting])],[])]
)],
[OPAL_CHECK_CRAY_PMI_EXPLICIT([opal_check_cray_pmi_happy="yes"],
[opal_check_cray_pmi_happy="no"])
AC_MSG_WARN([opal_chack_cray_pmi_happy = $opal_check_cray_pmi_happy])])
])
AS_IF([test "$opal_check_cray_pmi_happy" = "yes" -a "$enable_static" = "yes"],
[CRAY_PMI_LIBS = $CRAY_PMI_STATIC_LIBS],[])
AC_MSG_RESULT([CRAY_PMI_STATIC_LIBS - $CRAY_PMI_STATIC_LIBS])
AC_MSG_RESULT([CRAY_PMI_LIBS - $CRAY_PMI_LIBS])
AC_MSG_RESULT([CRAY_PMI_CFLAGS - $CRAY_PMI_CFLAGS])
AS_IF([test "$opal_check_cray_pmi_happy" = "yes"],
[$1_LDFLAGS="$CRAY_PMI_LIBS"
$1_CPPFLAGS="$CRAY_PMI_CFLAGS"
$1_LIBS="$CRAY_PMI_LIBS"
$2], [$3])
])

Просмотреть файл

@ -180,57 +180,3 @@ AC_DEFUN([OPAL_CHECK_PMI],[
])
])
#
# special check for cray pmi, uses macro(s) from pkg.m4
#
# OPAL_CHECK_CRAY_PMI(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OPAL_CHECK_CRAY_PMI],[
if test -z "$opal_check_cray_pmi_happy" ; then
if test -f "/usr/lib/alps/libalps.a" ; then
using_cle5_install="no"
else
using_cle5_install="yes"
fi
if test "$using_cle5_install" = "no" ; then
OPAL_CHECK_PMI([CRAY_PMI], [opal_check_cray_pmi_happy="yes"],
[opal_check_cray_pmi_happy="no"])
if test "$opal_check_cray_pmi_happy" = "yes" ; then
# Check for extra libraries required by Cray PMI
opal_check_alps_pmi_alps_happy=no
for opal_check_cray_pmi_extra_dir in "/usr/lib/alps" "/opt/cray/xe-sysroot/default/usr/lib/alps" ; do
AC_MSG_CHECKING([for alps libraries required by PMI in "$opal_check_cray_pmi_extra_dir"])
# libalpslli and libalpsutil are needed by libpmi to compile statically
if test -f "$opal_check_cray_pmi_extra_dir/libalpslli.a" ; then
if test -f "$opal_check_cray_pmi_extra_dir/libalpsutil.a" ; then
opal_check_alps_pmi_alps_happy=yes
CRAY_PMI_LDFLAGS="$CRAY_PMI_LDFLAGS -L$opal_check_cray_pmi_extra_dir"
CRAY_PMI_LIBS="$CRAY_PMI_LIBS -lalpslli -lalpsutil"
AC_MSG_RESULT([found])
break
fi
fi
AC_MSG_RESULT([not found])
done
if test "$opal_check_alps_pmi_alps_happy" = "no" ; then
opal_check_cray_pmi_alps_happy="no"
fi
fi
else
# CLE5 uses package config
PKG_CHECK_MODULES([CRAY_PMI], [cray-pmi],
[opal_check_cray_pmi_happy="yes"],
[opal_check_cray_pmi_happy="no"])
fi
fi
AS_IF([test "$opal_check_cray_pmi_happy" = "yes"],
[$1_LDFLAGS="$CRAY_PMI_LDFLAGS"
$1_CPPFLAGS="$CRAY_PMI_CPPFLAGS"
$1_LIBS="$CRAY_PMI_LIBS"
$2], [$3])
])