d9fa62d1f2
This commit was SVN r6349.
212 строки
7.6 KiB
Bash
212 строки
7.6 KiB
Bash
# -*- shell-script -*-
|
|
#
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
# All rights reserved.
|
|
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
# 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$
|
|
#
|
|
# Additional copyrights may follow
|
|
#
|
|
# $HEADER$
|
|
#
|
|
|
|
#
|
|
# quicky function to set #defines based on argument values
|
|
#
|
|
# ARGUMENTS:
|
|
# 1 configure name (first argument to ARG_WITH, minus the btl-portals-)
|
|
# 2 define name
|
|
# 3 default value
|
|
# 4 description (used for both ARG_WITH and DEFINE)
|
|
AC_DEFUN([MCA_BTL_PORTALS_CONFIG_VAL],
|
|
[
|
|
AC_ARG_WITH([btl-portals-$1], AC_HELP_STRING([--with-btl-portals-$1],
|
|
[$4 (default: $3)]))
|
|
AC_MSG_CHECKING([for $1 value])
|
|
case "[$with_]m4_bpatsubst([btl-portals-$1], -, _)" in
|
|
"")
|
|
$2=$3
|
|
AC_MSG_RESULT([[$]$2 (default)])
|
|
;;
|
|
"no")
|
|
AC_MSG_RESULT([error])
|
|
AC_MSG_ERROR([--without-btl-portals-$1 is invalid argument])
|
|
;;
|
|
*)
|
|
$2="$with_m4_bpatsubst([btl-portals-$1], -, _)"
|
|
AC_MSG_RESULT([[$]$2])
|
|
;;
|
|
esac
|
|
AC_DEFINE_UNQUOTED([$2], [[$]$2], [$4])
|
|
])dnl
|
|
|
|
|
|
#
|
|
# Main function. This will be invoked in the middle of the templated
|
|
# configure script.
|
|
#
|
|
AC_DEFUN([MCA_CONFIGURE_STUB],[
|
|
|
|
# Additional --with flags that can be specified
|
|
|
|
AC_ARG_WITH(btl-portals,
|
|
AC_HELP_STRING([--with-btl-portals=DIR],
|
|
[Specify the installation directory of PORTALS]))
|
|
|
|
# Add to CPPFLAGS if necessary
|
|
EXTRA_CPPFLAGS=
|
|
if test -n "$with_btl_portals"; then
|
|
if test -d "$with_btl_portals/include"; then
|
|
EXTRA_CPPFLAGS="-I$with_btl_portals/include"
|
|
else
|
|
AC_MSG_WARN([*** Warning: cannot find $with_btl_portals/include])
|
|
AC_MSG_WARN([*** Will still try to configure portals btl anyway...])
|
|
fi
|
|
fi
|
|
|
|
# See if we can find portals.h
|
|
CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS"
|
|
AC_CHECK_HEADERS(portals3.h,,
|
|
AC_MSG_ERROR([*** Cannot find working portals3.h.]))
|
|
|
|
# Add to LDFLAGS if necessary
|
|
EXTRA_LDFLAGS=
|
|
if test -n "$with_btl_portals"; then
|
|
if test -d "$with_btl_portals/lib"; then
|
|
EXTRA_LDFLAGS="-L$with_btl_portals/lib"
|
|
else
|
|
AC_MSG_WARN([*** Warning: cannot find $with_btl_portals/lib])
|
|
AC_MSG_WARN([*** Will still try to configure portals btl anyway...])
|
|
fi
|
|
fi
|
|
|
|
|
|
#
|
|
# Configure Portals for our local environment
|
|
#
|
|
BTL_PORTALS_UTCP=0
|
|
BTL_PORTALS_REDSTORM=0
|
|
BTL_PORTALS_COMPAT=""
|
|
BTL_PORTALS_HAVE_EVENT_UNLINK=0
|
|
|
|
AC_ARG_WITH([btl-portals-config],
|
|
AC_HELP_STRING([--with-btl-portals-config],
|
|
[configuration to use for Portals support.
|
|
One of "utcp", "redstorm". (default: utcp)]))
|
|
AC_MSG_CHECKING([for Portals configuration])
|
|
if test "$with_btl_portals_config" = "" ; then
|
|
with_btl_portals_config="utcp"
|
|
fi
|
|
case "$with_btl_portals_config" in
|
|
"utcp")
|
|
BTL_PORTALS_UTCP=1
|
|
PORTALS_LIBS="-lutcpapi -lutcplib -lp3api -lp3lib -lp3rt"
|
|
BTL_PORTALS_HAVE_EVENT_UNLINK=1
|
|
AC_MSG_RESULT([utcp])
|
|
;;
|
|
"redstorm")
|
|
BTL_PORTALS_REDSTORM=1
|
|
PORTALS_LIBS="-lp3api -lp3lib -lp3rt"
|
|
BTL_PORTALS_HAVE_EVENT_UNLINK=0
|
|
AC_MSG_RESULT([red storm])
|
|
;;
|
|
*)
|
|
AC_MSG_ERROR([unknown Portals configuration. Can not continue])
|
|
;;
|
|
esac
|
|
|
|
# Try to find all the portals libraries (this is not fun!)
|
|
AC_ARG_WITH(btl-portals-libs,
|
|
AC_HELP_STRING([--with-btl-portals-libs=LIBS],
|
|
[Libraries to link with for portals]))
|
|
if test -n "$with_btl_portals_libs" ; then
|
|
PORTALS_LIBS=""
|
|
for lib in $with_btl_portals_libs ; do
|
|
PORTALS_LIBS="$PORTALS_LIBS -l$lib"
|
|
done
|
|
fi
|
|
|
|
AC_MSG_CHECKING([if possible to link Portals application])
|
|
LIBS="$LIBS $PORTALS_LIBS"
|
|
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <portals3.h>], [int i; PtlInit(&i);])],
|
|
[AC_MSG_RESULT([yes])],
|
|
[AC_MSG_RESULT([no])
|
|
AC_MSG_ERROR([Can not link with Portals libraries])])
|
|
|
|
AC_DEFINE_UNQUOTED([BTL_PORTALS_HAVE_EVENT_UNLINK],
|
|
[$BTL_PORTALS_HAVE_EVENT_UNLINK],
|
|
[Does Portals send a BTL_EVENT_UNLINK event])
|
|
|
|
AC_DEFINE_UNQUOTED([BTL_PORTALS_UTCP], [$BTL_PORTALS_UTCP],
|
|
[Use the UTCP reference implementation or Portals])
|
|
AM_CONDITIONAL([BTL_PORTALS_UTCP], [test "$BTL_PORTALS_UTCP" = "1"])
|
|
|
|
AC_DEFINE_UNQUOTED([BTL_PORTALS_REDSTORM], [$BTL_PORTALS_REDSTORM],
|
|
[Use the Red Storm implementation or Portals])
|
|
AM_CONDITIONAL([BTL_PORTALS_REDSTORM], [test "$BTL_PORTALS_REDSTORM" = "1"])
|
|
|
|
#
|
|
# User configuration options
|
|
#
|
|
MCA_BTL_PORTALS_CONFIG_VAL([send-table-id],
|
|
[BTL_PORTALS_SEND_TABLE_ID], [3],
|
|
[Portals table id to use for send/recv ])
|
|
|
|
MCA_BTL_PORTALS_CONFIG_VAL([rdma-table-id],
|
|
[BTL_PORTALS_RDMA_TABLE_ID], [4],
|
|
[Portals table id to use for RDMA request])
|
|
|
|
MCA_BTL_PORTALS_CONFIG_VAL([debug-level],
|
|
[BTL_PORTALS_DEFAULT_DEBUG_LEVEL], [100],
|
|
[debugging level for portals btl])
|
|
|
|
MCA_BTL_PORTALS_CONFIG_VAL([eager-limit],
|
|
[BTL_PORTALS_DEFAULT_EAGER_LIMIT], [16384],
|
|
[max size for eager sends])
|
|
|
|
MCA_BTL_PORTALS_CONFIG_VAL([min-send-size],
|
|
[BTL_PORTALS_DEFAULT_MIN_SEND_SIZE], [0],
|
|
[min size for send fragments])
|
|
MCA_BTL_PORTALS_CONFIG_VAL([max-send-size],
|
|
[BTL_PORTALS_DEFAULT_MAX_SEND_SIZE], [32768],
|
|
[max size for send fragments])
|
|
|
|
MCA_BTL_PORTALS_CONFIG_VAL([min-rdma-size],
|
|
[BTL_PORTALS_DEFAULT_MIN_RDMA_SIZE], [0],
|
|
[min size for rdma fragments])
|
|
MCA_BTL_PORTALS_CONFIG_VAL([max-rdma-size],
|
|
[BTL_PORTALS_DEFAULT_MAX_RDMA_SIZE], [2147483647],
|
|
[max size for rdma fragments])
|
|
|
|
MCA_BTL_PORTALS_CONFIG_VAL([max-sends-pending],
|
|
[BTL_PORTALS_MAX_SENDS_PENDING], [128],
|
|
[max number of sends pending at any time])
|
|
MCA_BTL_PORTALS_CONFIG_VAL([recv-queue-size],
|
|
[BTL_PORTALS_DEFAULT_RECV_QUEUE_SIZE], [512],
|
|
[size of event queue for receiving frags])
|
|
|
|
MCA_BTL_PORTALS_CONFIG_VAL([free-list-init-num],
|
|
[BTL_PORTALS_DEFAULT_FREE_LIST_INIT_NUM], [8],
|
|
[starting size of free lists])
|
|
MCA_BTL_PORTALS_CONFIG_VAL([free-list-max-num],
|
|
[BTL_PORTALS_DEFAULT_FREE_LIST_MAX_NUM], [1024],
|
|
[maximum size of free lists])
|
|
MCA_BTL_PORTALS_CONFIG_VAL([free-list-inc-num],
|
|
[BTL_PORTALS_DEFAULT_FREE_LIST_INC_NUM], [32],
|
|
[grow size for freelists])
|
|
|
|
#
|
|
# Save extra compiler/linker flags so that they can be added in
|
|
# the wrapper compilers, if necessary
|
|
#
|
|
|
|
WRAPPER_EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
|
|
WRAPPER_EXTRA_LIBS="$PORTALS_LIBS"
|
|
])dnl
|