1
1
Clean up the orte_check_alps.m4.  There was a little of
unnecesary stuff for handling cle 5, since it wasn't actually
doing the right thing, which would be to use pkg-config to
find dependencies both for dynamic and static linking.

Decouple the searching for alps libs, etc. from cray pmi.

Switch the alps ess  and alps odls components' config files
to use the ALPS m4 macro.

alps configury fixes

Improve a check for detecting CLE release.
Improve an error message.
Этот коммит содержится в:
Howard Pritchard 2014-11-25 14:35:04 -07:00
родитель d749077e1e
Коммит 191fe0f949
3 изменённых файлов: 130 добавлений и 125 удалений

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

@ -17,112 +17,148 @@
#
# $HEADER$
#
# ORTE_CHECK_ALPS_CLE4([action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([ORTE_CHECK_ALPS_CLE4],[
#
# if we've gotten here, its because we are building on a CLE 4 system
#
orte_check_alps_cle4_libdir_happy="no"
orte_check_alps_cle4_dir_happy="no"
AC_MSG_CHECKING([Checking for ALPS components on a CLE 4 system with alps $with_alps])
AC_ARG_WITH([alps-libdir],
[AC_HELP_STRING([--with-alps-libdir=DIR],
[Location of alps libraries (alpslli, alpsutil) (default: /usr/lib/alps (/opt/cray/xe-sysroot/default/user on eslogin nodes))])])
#
# check to see if Open MPI is being built on a CLE 4 eslogin node
#
AS_IF([test -f /etc/opt/cray/release/ESLrelease],
[default_alps_dir="/opt/cray/xe-sysroot/default/usr"],
[default_alps_dir="/usr"])
AS_IF([test -z "$with_alps_libdir"],
[AS_IF([test "$with_alps" != "yes" -a "$with_alps" != "auto"],
[AS_IF([test -d "$with_alps_libdir/lib64"],
[orte_check_alps_libdir="$with_alps_libdir/lib64"],
[orte_check_alps_libdir="$with_alps_libdir/lib"])],
[ orte_check_alps_libdir="$default_alps_dir/lib/alps"])
],[])
AS_IF([test "$with_alps" = "yes" -o "$with_alps" = "auto"],
[orte_check_alps_dir=$default_alps_dir],
[orte_check_alps_dir=$with_alps])
AC_MSG_CHECKING([if $orte_check_alps_libdir/libalps.a is present])
AS_IF([test -f "$orte_check_alps_libdir/libalps.a"],
[orte_check_alps_libdir_cle4_happy="yes"],
[orte_check_alps_libdir_cle4_happy="no",
AC_MSG_RESULT([no])])
AC_MSG_CHECKING([if $orte_check_alps_dir/include/alps/apInfo.h is present])
AS_IF([test -f "$orte_check_alps_dir/include/alps/apInfo.h"],
[orte_check_alps_dir_cle4_happy="yes"],
[orte_check_alps_dir_cle4_happy="no"
AC_MSG_RESULT([no])])
AS_IF([test "$orte_check_alps_libdir_cle4_happy" = "yes" -a "$orte_check_alps_dir_cle4_happy" = "yes"],
[CRAY_ALPSLLI_CFLAGS="-I$orte_check_alps_dir/include"
CRAY_ALPSLLI_LIBS="-L$orte_check_alps_libdir -lalpslli -lalpsutil"
CRAY_ALPSLLI_STATIC_LIBS="-L$orte_check_alps_libdir -lalpslli -lalpsutil"
$1],
[$2])
])
# ORTE_CHECK_ALPS(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([ORTE_CHECK_ALPS],[
if test -z "$orte_check_alps_happy"; then
# require that we check for pmi support request first so
# we can get the static library ordering correct
AC_REQUIRE([OPAL_CHECK_CRAY_PMI])
AC_ARG_WITH([alps],
[AC_HELP_STRING([--with-alps(=DIR|yes|no)],
[Build with ALPS scheduler component, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries (default: no)])])
OPAL_CHECK_WITHDIR([alps], [$with_alps], [.])
[Build with ALPS scheduler component, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries (default: auto)])],[],with_alps=auto)
AC_ARG_WITH([alps-libdir],
[AC_HELP_STRING([--with-alps-libdir=DIR],
[Location of alps libraries (alpslli, alpsutil) (default: /usr/lib/alps)])])
AC_ARG_WITH([wlm_detect],
[AC_HELP_STRING([--with-wlm_detect(=DIR)],
[Location of wlm_detect library needed by PMI on CLE 5 systems (default: /opt/cray/wlm_detect/default)])])
# save the CPPFLAGS so we can check for alps/apInfo.h without adding $with_alps/include to the global path
orte_check_alps_$1_save_CPPFLAGS="$CPPFLAGS"
#
# check to see where alps is installed, it wandered to a new location starting with CLE 5.0
#
if test -f "/usr/lib/alps/libalps.a" ; then
using_cle5_install="no"
if test -f /etc/opt/cray/release/clerelease; then
cle_level=`awk -F. '{print [$]1}' /etc/opt/cray/release/clerelease`
else
using_cle5_install="yes"
if test -z "$with_wlm_detect" ; then
with_wlm_detect="/opt/cray/wlm_detect/default"
fi
# libpmi requires libugni for static linking on CLE 5. WTH!
OPAL_CHECK_UGNI($1,[orte_check_alps_happy=yes],[orte_check_alps_happy=no])
cle_level="unknown"
fi
if test "$with_alps" = "no" -o -z "$with_alps" ; then
orte_check_alps_happy="no"
else
# Only need to do these tests once - this macro is invoked
# from multiple different components' configure.m4 scripts
AC_MSG_CHECKING([for ALPS support cle level $cle_level])
AS_IF([test "$cle_level" = "4" -a "$with_alps" != "no"],
[ORTE_CHECK_ALPS_CLE4([orte_check_cray_alps_happy="yes"],
[orte_check_cray_alps_happy="no"])],
[AS_IF([test "$with_alps" = "no"],
[AC_MSG_RESULT([no])
$3],
[AS_IF([test "$with_alps" = "auto" -o "$with_alps" = "yes"],
[PKG_CHECK_MODULES_STATIC([CRAY_ALPSLLI], [cray-alpslli],
[orte_check_cray_alps_happy="yes"],
[orte_check_cray_alps_happy="no"]
[AS_IF([test "$with_alps" = "yes"],
[AC_MSG_WARN([ALPS support requested but pkg-config failed.])
AC_MSG_WARN([Need to explicitly indicate ALPS directory])
AC_MSG_WARN([on the configure line using --with-alps option.])
AC_MSG_ERROR([Aborting])],[])]
)
PKG_CHECK_MODULES_STATIC([CRAY_ALPSUTIL], [cray-alpsutil],
[orte_check_cray_alps_happy="yes"],
[orte_check_cray_alps_happy="no"]
[AS_IF([test "$with_alps" = "yes"],
[AC_MSG_WARN([ALPS support requested but pkg-config failed.])
AC_MSG_WARN([Need to explicitly indicate ALPS directory])
AC_MSG_WARN([on the configure line using --with-alps option.])
AC_MSG_ERROR([Aborting])],[])]
)
orte_check_alps_happy="yes"
orte_check_alps_libdir="$with_alps_libdir"
if test -z "$orte_check_alps_libdir" ; then
if test "$with_alps" != "yes" ; then
AS_IF([test -d "$with_alps/lib64"],
[orte_check_alps_libdir="$with_alps/lib64"],
[orte_check_alps_libdir="$with_alps/lib"])
else
if test "$using_cle5_install" = "yes"; then
orte_check_alps_libdir="/opt/cray/alps/default/lib64"
else
orte_check_alps_libdir="/usr/lib/alps"
fi
fi
fi
PKG_CHECK_MODULES_STATIC([CRAY_ALPS], [cray-alps],
[orte_check_cray_alps_happy="yes"],
[orte_check_cray_alps_happy="no"]
[AS_IF([test "$with_alps" = "yes"],
[AC_MSG_WARN([ALPS support requested but pkg-config failed.])
AC_MSG_WARN([Need to explicitly indicate ALPS directory])
AC_MSG_WARN([on the configure line using --with-alps option.])
AC_MSG_ERROR([Aborting])],[])]
)
if test "$with_alps" = "yes" ; then
AS_IF([test "$using_cle5_install" = "yes"],
[orte_check_alps_dir="/opt/cray/alps/default"],
[orte_check_alps_dir="/usr"])
else
orte_check_alps_dir="$with_alps"
fi
],
[AC_MSG_WARN([See ./configure --help for how to control Open MPI])
AC_MSG_WARN([configuration for ALPS on CLE 5 and higher systems])
AC_MSG_ERROR([Aborting])])
])
])
if test -z "$orte_check_alps_pmi_happy"; then
# if pmi support is requested, then OPAL_CHECK_PMI
# will have added the -lpmi flag to LIBS. We then need
# to add a couple of alps libs to support static
# builds
if test "$opal_enable_pmi" = 1 ; then
AC_MSG_CHECKING([for alps libraries in "$orte_check_alps_libdir"])
AC_MSG_RESULT([orte_check_cray_alps_happy = $orte_check_cray_alps_happy])
AS_IF([test "$orte_check_cray_alps_happy" = "yes" -a "$enable_static" = "yes"],
[CRAY_ALPSLLI_LIBS = $CRAY_ALPSLLI_STATIC_LIBS
CRAY_ALPSUTIL_LIBS = $CRAY_ALPSUTIL_STATIC_LIBS],
[])
AC_MSG_RESULT([CRAY_ALPSLLI_STATIC_LIBS - $CRAY_ALPSLLI_STATIC_LIBS])
AC_MSG_RESULT([CRAY_ALPSLLI_LIBS - $CRAY_ALPSLLI_LIBS])
AC_MSG_RESULT([CRAY_ALPSLLI_CFLAGS - $CRAY_ALPSLLI_CFLAGS])
AC_MSG_RESULT([CRAY_ALPSUTIL_STATIC_LIBS - $CRAY_ALPSUTIL_STATIC_LIBS])
AC_MSG_RESULT([CRAY_ALPSUTIL_LIBS - $CRAY_ALPSUTIL_LIBS])
AC_MSG_RESULT([CRAY_ALPSUTIL_CFLAGS - $CRAY_ALPSUTIL_CFLAGS])
AC_MSG_RESULT([CRAY_ALPS_CFLAGS - $CRAY_ALPS_CFLAGS])
AS_IF([test "$orte_check_cray_alps_happy" = "yes"],
[$1_LDFLAGS="$CRAY_ALPSLLI_LIBS $CRAY_ALPSUTIL_LIBS"
$1_CPPFLAGS="$CRAY_ALPSLLI_CFLAGS $CRAY_ALPSUTIL_CFLAGS $CRAY_ALPS_CFLAGS"
$1_LIBS="$CRAY_ALPSLLI_LIBS $CRAY_ALPSUTIL_LIBS"],
[])
# libalpslli and libalpsutil are needed by libpmi to compile statically
AS_IF([test -f "$orte_check_alps_libdir/libalpslli.a" -a -f "$orte_check_alps_libdir/libalpsutil.a"],
[AC_MSG_RESULT([found])
orte_check_alps_pmi_happy=yes],
[AC_MSG_WARN([PMI support for Alps requested but not found])
AC_MSG_ERROR([Cannot continue])])
fi
fi
fi
fi
# Set LIBS, CPPFLAGS, and LDFLAGS here so they always get set
if test "$orte_check_alps_happy" = "yes" -a "$opal_enable_pmi" = 1 ; then
$1_LIBS="-lalpslli -lalpsutil"
fi
$1_CPPFLAGS="-I$orte_check_alps_dir/include"
$1_LDFLAGS="-L$orte_check_alps_libdir"
# Add CLE 5 library dependencies
if test "using_cle5_install" = "yes" ; then
$1_LIBS="$$1_LIBS -lwlm_detect"
$1_LDFLAGS="$$1_LDFLAGS -L$with_wlm_detect"
fi
AS_IF([test "$orte_check_alps_happy" = "yes"],
[$2],
[$3])
AS_IF([test "$orte_check_cray_alps_happy" = "yes"],
[$2], [$3])
])

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

@ -25,24 +25,9 @@
AC_DEFUN([MCA_orte_ess_alps_CONFIG],[
AC_CONFIG_FILES([orte/mca/ess/alps/Makefile])
ess_alps_lli_happy="no"
ess_alps_util_happy="no"
ORTE_CHECK_ALPS([ess_alps], [ess_alps_happy="yes"], [ess_alps_happy="no"])
PKG_CHECK_MODULES([CRAY_ALPS_LLI], [cray-alpslli],
[ess_alps_CPPFLAGS=$CRAY_ALPS_LLI_CFLAGS
ess_alps_LDFLAGS=$CRAY_ALPS_LLI_LIBS
ess_alps_LIBS=$CRAY_ALPS_LLI_LIBS
ess_alps_lli_happy="yes"],
[AC_MSG_RESULT([no])])
PKG_CHECK_MODULES([CRAY_ALPS_UTIL], [cray-alpsutil],
[ess_alps_CPPFLAGS="$ess_alps_CPPFLAGS $CRAY_ALPS_UTIL_CFLAGS"
ess_alps_LDFLAGS="$ess_alps_LDFLAGS $CRAY_ALPS_UTIL_LIBS"
ess_alps_LIBS="$ess_alps_LIBS $CRAY_ALPS_LLI_LIBS"
ess_alps_util_happy="yes"],
[AC_MSG_RESULT([no])])
AS_IF([test "$ess_alps_lli_happy" = "yes" -a "$ess_alps_util_happy" = "yes"],
AS_IF([test "$ess_alps_happy" = "yes"],
[$1
AC_SUBST([ess_alps_CPPFLAGS])
AC_SUBST([ess_alps_LDFLAGS])

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

@ -25,29 +25,13 @@
AC_DEFUN([MCA_orte_odls_alps_CONFIG],[
AC_CONFIG_FILES([orte/mca/odls/alps/Makefile])
odls_alps_lli_happy="no"
odls_alps_util_happy="no"
ORTE_CHECK_ALPS([odls_alps], [odls_alps_happy="yes"], [odls_alps_happy="no"])
PKG_CHECK_MODULES([CRAY_ALPS_LLI], [cray-alpslli],
[odls_alps_CPPFLAGS=$CRAY_ALPS_LLI_CFLAGS
odls_alps_LDFLAGS=$CRAY_ALPS_LLI_LIBS
odls_alps_LIBS=$CRAY_ALPS_LLI_LIBS
odls_alps_lli_happy="yes"],
[AC_MSG_RESULT([no])])
PKG_CHECK_MODULES([CRAY_ALPS_UTIL], [cray-alpsutil],
[odls_alps_CPPFLAGS="$odls_alps_CPPFLAGS $CRAY_ALPS_UTIL_CFLAGS"
odls_alps_LDFLAGS="$odls_alps_LDFLAGS $CRAY_ALPS_UTIL_LIBS"
odls_alps_LIBS="$odls_alps_LIBS $CRAY_ALPS_LLI_LIBS"
odls_alps_util_happy="yes"],
[AC_MSG_RESULT([no])])
AS_IF([test "$odls_alps_lli_happy" = "yes" -a "$odls_alps_util_happy" = "yes"],
AS_IF([test "$odls_alps_happy" = "yes"],
[$1
AC_SUBST([odls_alps_CPPFLAGS])
AC_SUBST([odls_alps_LDFLAGS])
AC_SUBST([odls_alps_LIBS])],
[$2])
])dnl