2008-10-28 20:22:29 +03: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.
# 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.
2009-10-24 05:04:35 +04:00
# Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
2008-10-28 20:22:29 +03:00
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
2009-10-24 05:04:35 +04:00
# ORTE_CHECK_ALPS(prefix, [action-if-found], [action-if-not-found])
2008-10-28 20:22:29 +03:00
# --------------------------------------------------------
2009-10-24 05:04:35 +04:00
AC_DEFUN([ORTE_CHECK_ALPS],[
2012-01-20 02:10:03 +04:00
if test -z "$orte_check_alps_happy"; then
2012-01-18 00:41:50 +04:00
# require that we check for pmi support request first so
# we can get the static library ordering correct
2014-10-10 02:25:26 +04:00
AC_REQUIRE([OPAL_CHECK_CRAY_PMI])
2012-01-18 00:41:50 +04:00
2012-08-20 19:26:58 +04:00
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)])])
2014-05-01 19:38:07 +04:00
OPAL_CHECK_WITHDIR([alps], [$with_alps], [.])
2012-08-14 02:57:55 +04:00
2012-08-20 19:26:58 +04:00
AC_ARG_WITH([alps-libdir],
[AC_HELP_STRING([--with-alps-libdir=DIR],
[Location of alps libraries (alpslli, alpsutil) (default: /usr/lib/alps)])])
2012-08-14 02:57:55 +04:00
2014-04-18 21:49:16 +04:00
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)])])
2012-08-20 19:26:58 +04:00
# 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"
2012-08-14 02:57:55 +04:00
2012-08-20 19:26:58 +04:00
#
# 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"
else
using_cle5_install="yes"
2014-04-18 21:49:16 +04:00
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!
2014-05-07 00:53:55 +04:00
OPAL_CHECK_UGNI($1,[orte_check_alps_happy=yes],[orte_check_alps_happy=no])
2012-08-20 19:26:58 +04:00
fi
if test "$with_alps" = "no" -o -z "$with_alps" ; then
orte_check_alps_happy="no"
2012-08-15 02:04:39 +04:00
else
2013-06-26 11:03:54 +04:00
# Only need to do these tests once - this macro is invoked
2012-01-20 02:10:03 +04:00
# from multiple different components' configure.m4 scripts
2012-08-14 02:57:55 +04:00
2012-08-20 19:26:58 +04:00
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
2012-08-14 02:57:55 +04:00
2013-01-29 19:44:30 +04:00
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"])
2012-08-20 19:26:58 +04:00
else
2013-01-29 19:44:30 +04:00
orte_check_alps_dir="$with_alps"
2012-08-20 19:26:58 +04:00
fi
2012-08-14 02:57:55 +04:00
2012-01-20 02:10:03 +04:00
if test -z "$orte_check_alps_pmi_happy"; then
2013-06-24 06:41:40 +04:00
# if pmi support is requested, then OPAL_CHECK_PMI
2012-01-20 02:10:03 +04:00
# will have added the -lpmi flag to LIBS. We then need
# to add a couple of alps libs to support static
# builds
2013-06-24 06:41:40 +04:00
if test "$opal_enable_pmi" = 1 ; then
2012-08-14 02:57:55 +04:00
AC_MSG_CHECKING([for alps libraries in "$orte_check_alps_libdir"])
# 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"],
2012-01-20 02:10:03 +04:00
[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
2012-08-20 19:26:58 +04:00
fi
2012-01-20 02:10:03 +04:00
fi
2013-02-01 03:42:28 +04:00
# Set LIBS, CPPFLAGS, and LDFLAGS here so they always get set
2013-06-24 06:41:40 +04:00
if test "$orte_check_alps_happy" = "yes" -a "$opal_enable_pmi" = 1 ; then
2013-02-01 03:42:28 +04:00
$1_LIBS="-lalpslli -lalpsutil"
fi
2013-01-29 19:44:30 +04:00
$1_CPPFLAGS="-I$orte_check_alps_dir/include"
$1_LDFLAGS="-L$orte_check_alps_libdir"
2014-04-18 21:49:16 +04:00
# 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
2012-01-20 02:10:03 +04:00
AS_IF([test "$orte_check_alps_happy" = "yes"],
[$2],
[$3])
])