# -*- 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 ptl-portals-) # 2 define name # 3 default value # 4 description (used for both ARG_WITH and DEFINE) AC_DEFUN([MCA_PTL_PORTALS_CONFIG_VAL], [ AC_ARG_WITH([ptl-portals-$1], AC_HELP_STRING([--with-ptl-portals-$1], [$4 (default: $3)])) AC_MSG_CHECKING([for $1 value]) case "[$with_]m4_bpatsubst([ptl-portals-$1], -, _)" in "") $2=$3 AC_MSG_RESULT([[$]$2 (default)]) ;; "no") AC_MSG_RESULT([error]) AC_MSG_ERROR([--without-ptl-portals-$1 is invalid argument]) ;; *) $2="$with_m4_bpatsubst([ptl-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(ptl-portals, AC_HELP_STRING([--with-ptl-portals=DIR], [Specify the installation directory of PORTALS])) # Add to CPPFLAGS if necessary EXTRA_CPPFLAGS= if test -n "$with_ptl_portals"; then if test -d "$with_ptl_portals/include"; then EXTRA_CPPFLAGS="-I$with_ptl_portals/include" else AC_MSG_WARN([*** Warning: cannot find $with_ptl_portals/include]) AC_MSG_WARN([*** Will still try to configure portals ptl 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_ptl_portals"; then if test -d "$with_ptl_portals/lib"; then EXTRA_LDFLAGS="-L$with_ptl_portals/lib" else AC_MSG_WARN([*** Warning: cannot find $with_ptl_portals/lib]) AC_MSG_WARN([*** Will still try to configure portals ptl anyway...]) fi fi # # Configure Portals for our local environment # PTL_PORTALS_UTCP=0 PTL_PORTALS_REDSTORM=0 PTL_PORTALS_COMPAT="" PTL_PORTALS_HAVE_EVENT_UNLINK=0 AC_ARG_WITH([ptl-portals-config], AC_HELP_STRING([--with-ptl-portals-config], [configuration to use for Portals support. One of "utcp", "redstorm". (default: utcp)])) AC_MSG_CHECKING([for Portals configuration]) if test "$with_ptl_portals_config" = "" ; then with_ptl_portals_config="utcp" fi case "$with_ptl_portals_config" in "utcp") PTL_PORTALS_UTCP=1 PORTALS_LIBS="-lutcpapi -lutcplib -lp3api -lp3lib -lp3rt" PTL_PORTALS_HAVE_EVENT_UNLINK=1 AC_MSG_RESULT([utcp]) ;; "redstorm") PTL_PORTALS_REDSTORM=1 PORTALS_LIBS="-lp3api -lp3lib -lp3rt" PTL_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(ptl-portals-libs, AC_HELP_STRING([--with-ptl-portals-libs=LIBS], [Libraries to link with for portals])) if test -n "$with_ptl_portals_libs" ; then PORTALS_LIBS="" for lib in $with_ptl_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 ], [int i; PtlInit(&i);])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([Can not link with Portals libraries])]) AC_DEFINE_UNQUOTED([PTL_PORTALS_HAVE_EVENT_UNLINK], [$PTL_PORTALS_HAVE_EVENT_UNLINK], [Does Portals send a PTL_EVENT_UNLINK event]) AC_DEFINE_UNQUOTED([PTL_PORTALS_UTCP], [$PTL_PORTALS_UTCP], [Use the UTCP reference implementation or Portals]) AM_CONDITIONAL([PTL_PORTALS_UTCP], [test "$PTL_PORTALS_UTCP" = "1"]) AC_DEFINE_UNQUOTED([PTL_PORTALS_REDSTORM], [$PTL_PORTALS_REDSTORM], [Use the Red Storm implementation or Portals]) AM_CONDITIONAL([PTL_PORTALS_REDSTORM], [test "$PTL_PORTALS_REDSTORM" = "1"]) MCA_PTL_PORTALS_CONFIG_VAL([frag-table-id], [PTL_PORTALS_FRAG_TABLE_ID], [1], [Portals table id to use for fragment receive queue]) MCA_PTL_PORTALS_CONFIG_VAL([retrans-table-id], [PTL_PORTALS_RETRANS_TABLE_ID], [2], [Portals table id to use for retransmit request queue]) MCA_PTL_PORTALS_CONFIG_VAL([debug-level], [PTL_PORTALS_DEFAULT_DEBUG_LEVEL], [100], [debugging level for portals ptl]) MCA_PTL_PORTALS_CONFIG_VAL([request-cache-size], [PTL_PORTALS_DEFAULT_REQUEST_CACHE_SIZE], [1], [request cache size for portals ptl]) MCA_PTL_PORTALS_CONFIG_VAL([first-frag-size], [PTL_PORTALS_DEFAULT_FIRST_FRAG_SIZE], [16384], [first frag size for portals ptl]) MCA_PTL_PORTALS_CONFIG_VAL([first-frag-num-entries], [PTL_PORTALS_DEFAULT_FIRST_FRAG_NUM_ENTRIES], [3], [number of memory descriptors for first fragments]) MCA_PTL_PORTALS_CONFIG_VAL([first-frag-entry-size], [PTL_PORTALS_DEFAULT_FIRST_FRAG_ENTRY_SIZE], [2098152], [size of memory associeted with first fag md]) MCA_PTL_PORTALS_CONFIG_VAL([recv-queue-size], [PTL_PORTALS_DEFAULT_RECV_QUEUE_SIZE], [512], [size of event queue for receiving frags]) MCA_PTL_PORTALS_CONFIG_VAL([send-queue-size], [PTL_PORTALS_DEFAULT_SEND_QUEUE_SIZE], [128], [Max number of send fragmenst pending]) MCA_PTL_PORTALS_CONFIG_VAL([rndv-frag-min-size], [PTL_PORTALS_DEFAULT_RNDV_FRAG_MIN_SIZE], [0], [minimum size of rndv fragments]) MCA_PTL_PORTALS_CONFIG_VAL([rndv-frag-max-size], [PTL_PORTALS_DEFAULT_RNDV_FRAG_MAX_SIZE], [16384], [maximum size of rndv fragments]) MCA_PTL_PORTALS_CONFIG_VAL([free-list-init-num], [PTL_PORTALS_DEFAULT_FREE_LIST_INIT_NUM], [256], [starting size of free lists]) MCA_PTL_PORTALS_CONFIG_VAL([free-list-max-num], [PTL_PORTALS_DEFAULT_FREE_LIST_MAX_NUM], [-1], [maximum size of free lists]) MCA_PTL_PORTALS_CONFIG_VAL([free-list-inc-num], [PTL_PORTALS_DEFAULT_FREE_LIST_inc_NUM], [256], [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