#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13 
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
--enable-cache  - Turn on configure caching"
ac_help="$ac_help
--enable-strict  - Turn on strict compilation testing when using gcc"
ac_help="$ac_help
--enable-echo    - Turn on echoing from within the configure script"
ac_help="$ac_help
--enable-weak-symbols - Use weak symbols to provide the profiling interface
    (default)"
ac_help="$ac_help
--enable-f90 - Find and use a Fortran 90 compiler (default:enable)"
ac_help="$ac_help
--enable-f90modules - Build an MPI module for use with Fortran 90"
ac_help="$ac_help
--enable-use-pointer - Use the common pointer extension for MPI_BOTTOM and
    related special values"
ac_help="$ac_help
--with-flibname=name  - Specify name of library containing Fortran interface
routines"
ac_help="$ac_help
--with-fwrapname=name  - Specify name of library containing Fortran interface
routines"
ac_help="$ac_help
--with-mpe - MPI includes the MPE libraries"
ac_help="$ac_help
--with-cross=file - Use the file for cross compilation.  The file should 
             contain assignments of the form
             CROSS_SIZEOF_INT=4
             for each cross compilation variable.  The command
                egrep 'CROSS_[A-Z_]*=' configure | sed 's/=.*//g'
             will list each variable"
ac_help="$ac_help
--with-mpichconfig=file - Use file for the MPICH configuration.
              Normally, this file is mpichlib.conf, but other files
              may be used."
ac_help="$ac_help
--with-subname=name - Use this name for forming the names of the 
              directories to install the mpif.h include file and 
              libraries, as well as the mpif77-name.conf file.  This
              should be used to support multiple Fortran compilers with
              a single MPICH build.  It must be used in conjunction with
              --with-mpichconfig"
ac_help="$ac_help
--with-mpichbuilding - Assume that MPICH is being built"
ac_help="$ac_help
--with-mpich=path  - Assume that we are building with MPICH"
ac_help="$ac_help
--with-lammpi=path  - Assume that we are building with LAM/MPI"
ac_help="$ac_help
--with-ibmmpi    - Use the IBM SP implementation of MPI"
ac_help="$ac_help
--with-sgimpi    - Use the SGI implementation of MPI"
ac_help="$ac_help
--with-mpichnt - Use MPICH for Windows NT "

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12

ac_prev=
for ac_option
do

  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval "$ac_prev=\$ac_option"
    ac_prev=
    continue
  fi

  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case "$ac_option" in

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir="$ac_optarg" ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build="$ac_optarg" ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file="$ac_optarg" ;;

  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir="$ac_optarg" ;;

  -disable-* | --disable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    eval "enable_${ac_feature}=no" ;;

  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "enable_${ac_feature}='$ac_optarg'" ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix="$ac_optarg" ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he)
    # Omit some internal or obsolete options to make the list less imposing.
    # This message is too long to be a string in the A/UX 3.1 sh.
    cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
  --cache-file=FILE       cache test results in FILE
  --help                  print this message
  --no-create             do not create output files
  --quiet, --silent       do not print \`checking...' messages
  --version               print the version of autoconf that created configure
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names
EOF
    cat << EOF
Host type:
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
  --host=HOST             configure for HOST [guessed]
  --target=TARGET         configure for TARGET [TARGET=HOST]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$ac_help"
    fi
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$ac_optarg" ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir="$ac_optarg" ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir="$ac_optarg" ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir="$ac_optarg" ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir="$ac_optarg" ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst \
  | --locals | --local | --loca | --loc | --lo)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    localstatedir="$ac_optarg" ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir="$ac_optarg" ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir="$ac_optarg" ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix="$ac_optarg" ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix="$ac_optarg" ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix="$ac_optarg" ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name="$ac_optarg" ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir="$ac_optarg" ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir="$ac_optarg" ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site="$ac_optarg" ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir="$ac_optarg" ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir="$ac_optarg" ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.13"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    eval "with_${ac_package}=no" ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes="$ac_optarg" ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries="$ac_optarg" ;;

  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

  *)
    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
      echo "configure: warning: $ac_option: invalid host type" 1>&2
    fi
    if test "x$nonopt" != xNONE; then
      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
    fi
    nonopt="$ac_option"
    ;;

  esac
done

if test -n "$ac_prev"; then
  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
  exec 6>/dev/null
else
  exec 6>&1
fi
exec 5>./config.log

echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5

# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  esac
done

# NLS nuisances.
# Only set these to C if already set.  These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=Makefile.in

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then its parent.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test "$ac_srcdir_defaulted" = yes; then
    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  else
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`

# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  else
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  fi
fi
for ac_site_file in $CONFIG_SITE; do
  if test -r "$ac_site_file"; then
    echo "loading site script $ac_site_file"
    . "$ac_site_file"
  fi
done

if test "$CONFIGURE_DEBUG_CACHE" = yes ; then 
    oldopts="$-"
    clearMinusX=no
    set -x 
    if test "$oldopts" != "$-" ; then 
        clearMinusX=yes
    fi
fi 
if test "X$cache_system" = "X" ; then
    # A default file name, just in case
    cache_system="config.system"
    if test "$cache_file" != "/dev/null" ; then
        # Get the directory for the cache file, if any
	
                cache_system=`echo $cache_file | sed -e 's%^\(.*/\)[^/]*%\1config.system%'`
	
        test "x$cache_system" = "x$cache_file" && cache_system="config.system"
#    else
#        We must *not* set enable_cache to no because we need to know if
#        enable_cache was not set.  
#        enable_cache=no
    fi
fi
#
# Get a test value and flag whether we should remove/replace the 
# cache_system file (do so unless cache_system_ok is yes)
# FC and F77 should be synonyms.  Save both in case
# We include the xxxFLAGS in case the user is using the flags to change
# the language (either input or output) of the compiler.  E.g., 
# using -xarch=v9 on Solaris to select 64 bit output or using -D_BSD_SOURCE 
# with gcc to get different header files on input.
cleanargs=`echo "$CC $F77 $FC $CXX $F90 $CFLAGS $FFLAGS $CXXFLAGS $F90FLAGS $PATH" | tr '"' ' '`
if uname -srm >/dev/null 2>&1 ; then
    cache_system_text="`uname -srm` $cleanargs"
else
    cache_system_text="-no-uname- $cleanargs"
fi
cache_system_ok=no
#
if test -z "$real_enable_cache" ; then
    real_enable_cache=$enable_cache
    if test -z "$real_enable_cache" ; then real_enable_cache="notgiven" ; fi
fi
if test "X$real_enable_cache" = "Xnotgiven" ; then
    # check for valid cache file
    if test -z "$cache_system" ; then cache_system="config.system" ; fi
    if uname -srm >/dev/null 2>&1 ; then
        if test -f "$cache_system" -a -n "$cache_system_text" ; then
	    if test "$cache_system_text" = "`cat $cache_system`" ; then
	        real_enable_cache="yes"
                cache_system_ok=yes
	    fi
        elif test ! -f "$cache_system" -a -n "$cache_system_text" ; then
	    # remove the cache file because it may not correspond to our
	    # system
	    if test "$cache_file" != "/dev/null" ; then 
	        rm -f $cache_file
	    fi
	    real_enable_cache="yes"
        fi
    fi
fi
if test "X$real_enable_cache" = "Xyes" -a "$cache_file" = "/dev/null" ; then
    real_enable_cache=no
fi
if test "X$real_enable_cache" = "Xyes" ; then
  if test -r "$cache_file" ; then
    echo "loading cache $cache_file"
    if test -w "$cache_file" ; then
        # Clean the cache file (ergh)
	
    rm -f confcache
    sed -e "s/'\\\\''//g" -e "s/'\\\\/'/" -e "s/\\\\'/'/" \
		-e "s/'\\\\''//g" $cache_file > confcache
    if cmp -s $cache_file confcache ; then
        :
    else
        if test -w $cache_file ; then
	    echo "updating cache $cache_file"
            cat confcache > $cache_file
        else
            echo "not updating unwritable cache $cache_file"
        fi
    fi	
    rm -f confcache
    if test "$DEBUG_AUTOCONF_CACHE" = "yes" ; then
        echo "Results of cleaned cache file:"
	echo "--------------------------------------------------------"
	cat $cache_file
	echo "--------------------------------------------------------"
    fi

    fi
    . $cache_file
  else
    echo "Configure in `pwd` creating cache $cache_file"
    > $cache_file
    rm -f $cache_system
  fi
else
  cache_file="/dev/null"
fi
# Remember our location and the name of the cachefile
pac_cv_my_conf_dir=`pwd`
#
# Update the cache_system file if necessary
if test "$cache_system_ok" != yes ; then
    if test -n "$cache_system" ; then
        rm -f $cache_system
        echo $cache_system_text > $cache_system
    fi
fi
if test "$clearMinusX" = yes ; then
    set +x
fi

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi


 rm -f ${srcdir}/mpi_fortconf.h mpi_fortconf.h

if test -f $CONFIG_AUX_DIR/install-sh ; then ac_aux_dir=$CONFIG_AUX_DIR 
else
ac_aux_dir=
# We force the test to use the absolute path to ensure that the install
# program can be used if we cd to a different directory before using
# install.
for ac_dir in config $srcdir/config; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    abs_ac_aux_dir=`(cd $ac_aux_dir && pwd)`
    ac_install_sh="$abs_ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    abs_ac_aux_dir=`(cd $ac_aux_dir && pwd)`
    ac_install_sh="$abs_ac_aux_dir/install.sh -c"
    break
  fi
done
fi
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in config $srcdir/config" 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.


if test -z "$HAVE_MPID_FORTDEFS_H" ; then
    HAVE_MPID_FORTDEFS_H=0
fi



# Check whether --enable-cache or --disable-cache was given.
if test "${enable_cache+set}" = set; then
  enableval="$enable_cache"
  enable_cache="$enableval"
else
  enable_cache="notgiven"
fi




# Check whether --enable-strict or --disable-strict was given.
if test "${enable_strict+set}" = set; then
  enableval="$enable_strict"
  COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL"
fi


# Check whether --enable-echo or --disable-echo was given.
if test "${enable_echo+set}" = set; then
  enableval="$enable_echo"
  set -x
fi


# Check whether --enable-weak-symbols or --disable-weak-symbols was given.
if test "${enable_weak_symbols+set}" = set; then
  enableval="$enable_weak_symbols"
  enable_weak=$enableval
else
  enable_weak="yes"
fi


# Check whether --enable-f90 or --disable-f90 was given.
if test "${enable_f90+set}" = set; then
  enableval="$enable_f90"
  enable_f90=$enableval
else
  enable_f90="yes"
fi


# Check whether --enable-f90modules or --disable-f90modules was given.
if test "${enable_f90modules+set}" = set; then
  enableval="$enable_f90modules"
  do_f90_modules=$enableval
else
  do_f90_modules="yes"
fi


# Check whether --enable-use-pointer or --disable-use-pointer was given.
if test "${enable_use_pointer+set}" = set; then
  enableval="$enable_use_pointer"
  use_pointer_in_f77=$enableval
else
  use_pointer_in_f77="no"
fi


# Check whether --with-flibname or --without-flibname was given.
if test "${with_flibname+set}" = set; then
  withval="$with_flibname"
  FLIBNAMEOverride=$withval;set_FLIBNAME="yes"
else
  FLIBNAME=mpich
fi



# Check whether --with-fwrapname or --without-fwrapname was given.
if test "${with_fwrapname+set}" = set; then
  withval="$with_fwrapname"
  FWRAPNAME=$withval;set_FWRAPNAME="yes"
else
  FWRAPNAME=fmpich
fi



# Check whether --with-mpe or --without-mpe was given.
if test "${with_mpe+set}" = set; then
  withval="$with_mpe"
  hasMPE=$withval
else
  hasMPE="unknown"
fi



# Check whether --with-cross or --without-cross was given.
if test "${with_cross+set}" = set; then
  withval="$with_cross"
  cross_file=$withval
else
  cross_file=/dev/null
fi


# Check whether --with-mpichconfig or --without-mpichconfig was given.
if test "${with_mpichconfig+set}" = set; then
  withval="$with_mpichconfig"
  if test -z "$withval" -o "X$withval" = "Xyes" ; then 
    mpichconfig_file=../../util/mpichlib.conf
else 
    mpichconfig_file=$withval
fi

else
  mpichconfig_file=""
fi


# Check whether --with-subname or --without-subname was given.
if test "${with_subname+set}" = set; then
  withval="$with_subname"
  subname=$withval
else
  subname=""
fi



# Propagate any optimization flags




# Check whether --with-mpichbuilding or --without-mpichbuilding was given.
if test "${with_mpichbuilding+set}" = set; then
  withval="$with_mpichbuilding"
  pac_lib_mpi_is_building=$withval
else
  pac_lib_mpi_is_building="no"
fi



if test -n "$subname" -a -z "$mpichconfig_file" ; then
    { echo "configure: error: Must specify --with-mpichconfig with --with-subname" 1>&2; exit 1; }
fi

# Read any cross-compilation variable values
if test "$cross_file" != "/dev/null" -a -s "$cross_file" ; then
    . $cross_file
fi

if test -n "$mpichconfig_file" -a -s "$mpichconfig_file" ; then
    . $mpichconfig_file
    pac_lib_mpi_is_building="yes"
fi

#
# Handle the FLIBNAMEOverride after the argument processing and loading
# of the mpichconfig file
if test "$set_FLIBNAME" = "yes" ; then 
   FLIBNAME=$FLIBNAMEOverride
fi

#
# Set size of MPI_Status
#
if test -z "$MPI_STATUS_SIZE" ; then
    echo "configure: warning: MPI_STATUS_SIZE was not defined!" 1>&2
    # The default size is 4
    MPI_STATUS_SIZE=4
fi


#
# Define the installation directory names (defaults)
if test -n "$subname" ; then
    # add the leading hyphen
    subname="-$subname"
    f77includedir='${includedir}'"/${subname}"
    f77libdir='${libdir}'
    f77bindir='${bindir}'
    if test "$set_FLIBNAME" != "yes" ; then
	FLIBNAME="mpich$subname"
    fi
    if test "$set_FWRAPNAME" != "yes" ; then
	FWRAPNAME="fmpich$subname"
    fi
else
    subname="-`echo $F77 | sed 's/ /-/g'`"
    # Don't include the (sub)name in the defaults
    f77includedir='${includedir}'
    f77libdir='${libdir}'
    f77bindir='${bindir}'
fi




# To make this compatible with the MPICH configure, the library
# directory can be set with libbuild_dir; if not set, it is built in the
# src directory
if test -z "$libbuild_dir" ; then
    libbuild_dir=`pwd`/src
fi




if test "$pac_lib_mpi_is_building" = "yes" ; then 
    cat >> confdefs.h <<\EOF
#define BUILDING_IN_MPICH 1
EOF

    FORTRAN_INITOBJ="initfutil.o"
    # We should replace mpicc with the values used in the MPICH build.
    # This is best done with an environment variable (? what about 
    # config.status re-execution?)
    INCLUDES="$mpich_includes"
    if test "$hasMPE" = "unknown" ; then
	hasMPE="yes"
    fi
    
fi
# Directory for building the library in (in src if not specified)
if test -z "$libbuild_dir" ; then
    libbuild_dir=`pwd`/src
    if test ! -d $libbuild_dir ; then mkdir $libbuild_dir ; fi
fi




for ac_prog in cc xlC xlc pgcc icc gcc 
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:957: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CC" && break
done

test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:988: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 999 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1030: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether the C compiler sets its return status correctly""... $ac_c" 1>&6
echo "configure:1035: checking whether the C compiler sets its return status correctly" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext <<EOF
#line 1045 "configure"
#include "confdefs.h"

int main() {
int a = bzzzt;
; return 0; }
EOF
if { (eval echo configure:1052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  notbroken=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  notbroken=yes
fi
rm -f conftest*
echo "$ac_t""$notbroken" 1>&6
if test "$notbroken" = "no" ; then
    { echo "configure: error: installation or configuration problem: C compiler does not
correctly set error code when a fatal error occurs" 1>&2; exit 1; }
fi

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:1069: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test "$ac_cv_prog_gcc" = yes; then
  GCC=yes
else
  GCC=
fi


echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:1094: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1099 "configure"
#include "confdefs.h"

int main() {

/* Ultrix mips cc rejects this.  */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this.  */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this.  */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
   It does not let you subtract one const X* pointer from another in an arm
   of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this.  */
  char *t;
  char const *s = 0 ? (char *) 0 : (char const *) 0;

  *t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  int x[] = {25, 17};
  const int *foo = &x[0];
  ++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  typedef const int *iptr;
  iptr p = 0;
  ++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  struct s { int j; const int *ap[3]; };
  struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  const int foo = 10;
}

; return 0; }
EOF
if { (eval echo configure:1148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_const=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_c_const=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then
  cat >> confdefs.h <<\EOF
#define const 
EOF

fi

cat > conftest.$ac_ext <<EOF
#line 1169 "configure"
#include "confdefs.h"

int main() {
long long i;
; return 0; }
EOF
if { (eval echo configure:1176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_LONG_LONG 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 1188 "configure"
#include "confdefs.h"

int main() {
long double d;
; return 0; }
EOF
if { (eval echo configure:1195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_LONG_DOUBLE 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
save_FFLAGS="$FFLAGS"
if test -z "$F77"; then
  for ac_prog in g77 f77 f2c
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1213: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F77"; then
  ac_cv_prog_F77="$F77" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_F77="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F77="$ac_cv_prog_F77"
if test -n "$F77"; then
  echo "$ac_t""$F77" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$F77" && break
done

    test -z "$F77" && { echo "configure: error: no acceptable Fortran 77 compiler found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1246: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works" >&5

ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

cat > conftest.$ac_ext << EOF

      program conftest
      end

EOF
if { (eval echo configure:1259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_f77_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_f77_cross=no
  else
    ac_cv_prog_f77_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_f77_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_f77_works" 1>&6
if test $ac_cv_prog_f77_works = no; then
  { echo "configure: error: installation or configuration problem: Fortran 77 compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1285: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_f77_cross" 1>&6
cross_compiling=$ac_cv_prog_f77_cross

echo $ac_n "checking whether we are using GNU Fortran 77""... $ac_c" 1>&6
echo "configure:1290: checking whether we are using GNU Fortran 77" >&5
if eval "test \"`echo '$''{'ac_cv_prog_g77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.fpp <<EOF
#ifdef __GNUC__
  yes
#endif
EOF
if { ac_try='$F77 -E conftest.fpp'; { (eval echo configure:1299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_g77=yes
else
  ac_cv_prog_g77=no
fi
fi

echo "$ac_t""$ac_cv_prog_g77" 1>&6

if test $ac_cv_prog_g77 = yes; then
  G77=yes
  ac_test_FFLAGS="${FFLAGS+set}"
  ac_save_FFLAGS="$FFLAGS"
  FFLAGS=
  echo $ac_n "checking whether $F77 accepts -g""... $ac_c" 1>&6
echo "configure:1314: checking whether $F77 accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_f77_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.f << EOF
       program conftest
       end
EOF
if test -z "`$F77 -g -c conftest.f 2>&1`"; then
  ac_cv_prog_f77_g=yes
else
  ac_cv_prog_f77_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_f77_g" 1>&6
  if test "$ac_test_FFLAGS" = set; then
    FFLAGS="$ac_save_FFLAGS"
  elif test $ac_cv_prog_f77_g = yes; then
    FFLAGS="-g -O2"
  else
    FFLAGS="-O2"
  fi
else
  G77=
  test "${FFLAGS+set}" = set || FFLAGS="-g"
fi

FFLAGS="$save_FFLAGS"

if test -z "$FLINKER" ; then
   FLINKER="$F77"
fi

# We need F90 to get the OFFSET_KIND and ADDRESS_KIND values.
if test "$enable_f90" != "no" ; then
    
if test -z "$F90" ; then
    for ac_prog in f90 xlf90 pgf90 ifort epcf90 f95 fort xlf95 lf95 pathf90 g95 fc ifc efc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1359: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F90'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F90"; then
  ac_cv_prog_F90="$F90" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_F90="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F90="$ac_cv_prog_F90"
if test -n "$F90"; then
  echo "$ac_t""$F90" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$F90" && break
done

    test -z "$F90" && echo "configure: warning: no acceptable Fortran 90 compiler found in \$PATH" 1>&2
fi
if test -n "$F90" ; then
     echo $ac_n "checking for extension for Fortran 90 programs""... $ac_c" 1>&6
echo "configure:1392: checking for extension for Fortran 90 programs" >&5
pac_cv_f90_ext="f90"
cat > conftest.$pac_cv_f90_ext <<EOF
      program conftest
      end
EOF
ac_compile='${F90-f90} -c $F90FLAGS conftest.$pac_cv_f90_ext 1>&5'
if { (eval echo configure:1399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then
    echo "$ac_t""f90" 1>&6
else
    rm -f conftest*
    pac_cv_f90_ext="f"
    cat > conftest.$pac_cv_f90_ext <<EOF
      program conftest
      end
EOF
    if { (eval echo configure:1408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then
	echo "$ac_t""f" 1>&6
    else
        echo "$ac_t""unknown!" 1>&6
    fi
fi
echo $ac_n "checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1415: checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) works" >&5

# We cannot use _LANG_FORTRAN90 here because we will usually be executing this
# test in the context of _PROG_F90, which is a require on _LANG_FORTRAN90.
# Instead, we insert the necessary code from _LANG_FORTRAN90 here
ac_ext=$pac_cv_f90_ext
ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&5'
ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$pac_cv_prog_f90_cross
# Include a Fortran 90 construction to distinguish between Fortran 77 
# and Fortran 90 compilers.
cat >conftest.$ac_ext <<EOF
      program conftest
      integer, dimension(10) :: n
      end
EOF
if { (eval echo configure:1431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeect} ; then
    pac_cv_prog_f90_works="yes"
    if (./conftest; exit) 2>/dev/null ; then
        pac_cv_prog_f90_cross="no"
    else
        pac_cv_prog_f90_cross="yes"
    fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  pac_cv_prog_f90_works="no"
fi
rm -f conftest*
# The intel compiler sometimes generates these work.pc and .pcl files
rm -f work.pc work.pcl
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$pac_cv_prog_f90_works" 1>&6
if test $pac_cv_prog_f90_works = no; then
  echo "configure: warning: installation or configuration problem: Fortran 90 compiler cannot create executables." 1>&2
fi
echo $ac_n "checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1458: checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$pac_cv_prog_f90_cross" 1>&6
cross_compiling=$pac_cv_prog_f90_cross

fi
ac_f90ext=$pac_cv_f90_ext
ac_f90compile='${F90-f90} -c $F90FLAGS conftest.$ac_f90ext 1>&5'
ac_f90link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_f90ext $LIBS 1>&5'
# Check for problems with Intel efc compiler, if the compiler works
if test "$pac_cv_prog_f90_works" = yes ; then
    cat > conftest.$ac_f90ext <<EOF
        program main
        end
EOF
    pac_msg=`$F90 -o conftest $F90FLAGS $LDFLAGS conftest.$ac_f90ext $LIBS 2>&1 | grep 'bfd assertion fail'`
    if test -n "$pac_msg" ; then
        pac_msg=`$F90 -o conftest $F90FLAGS $LDFLAGS conftest.$ac_f90ext -i_dynamic $LIBS 2>&1 | grep 'bfd assertion fail'`
        if test -z "$pac_msg" ; then LDFLAGS="-i_dynamic" ; fi
        # There should really be f90linker flags rather than generic ldflags.
    fi
fi

    if test -z "$F90" ; then
        enable_f90=no
    else
        if test -z "$F90LINKER" ; then
            F90LINKER="$F90"
        fi
    fi
    
fi






# Check whether --with-mpich or --without-mpich was given.
if test "${with_mpich+set}" = set; then
  withval="$with_mpich"
  ac_mpi_type=mpich
fi

# Check whether --with-lammpi or --without-lammpi was given.
if test "${with_lammpi+set}" = set; then
  withval="$with_lammpi"
  ac_mpi_type=lammpi
fi

# Check whether --with-ibmmpi or --without-ibmmpi was given.
if test "${with_ibmmpi+set}" = set; then
  withval="$with_ibmmpi"
  ac_mpi_type=ibmmpi
fi

# Check whether --with-sgimpi or --without-sgimpi was given.
if test "${with_sgimpi+set}" = set; then
  withval="$with_sgimpi"
  ac_mpi_type=sgimpi
fi

# Check whether --with-mpichnt or --without-mpichnt was given.
if test "${with_mpichnt+set}" = set; then
  withval="$with_mpichnt"
  ac_mpi_type=mpichnt
fi


if test "X$ac_mpi_type" = "X" ; then
    if test "X" != "X" ; then
        ac_mpi_type=
    else
        ac_mpi_type=unknown
    fi
fi
if test "$ac_mpi_type" = "unknown" -a "$pac_lib_mpi_is_building" = "yes" ; then
    ac_mpi_type="mpich"
fi
case $ac_mpi_type in
	mpich)
                                if test "X$pac_lib_mpi_is_building" != "Xyes" ; then
            save_PATH="$PATH"
            if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then 
		# Look for commands; if not found, try adding bin to the
		# path
		if test ! -x $with_mpich/mpicc -a -x $with_mpich/bin/mpicc ; then
			with_mpich="$with_mpich/bin"
		fi
                PATH=$with_mpich:${PATH}
            fi
            # Extract the first word of "mpicc", so it can be a program name with args.
set dummy mpicc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1551: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPICC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPICC" in
  /*)
  ac_cv_path_MPICC="$MPICC" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPICC="$MPICC" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPICC="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPICC="$ac_cv_path_MPICC"
if test -n "$MPICC"; then
  echo "$ac_t""$MPICC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

            TESTCC=${CC-cc}
            CC="$MPICC"
            # Extract the first word of "mpif77", so it can be a program name with args.
set dummy mpif77; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1588: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPIF77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPIF77" in
  /*)
  ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPIF77="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPIF77="$ac_cv_path_MPIF77"
if test -n "$MPIF77"; then
  echo "$ac_t""$MPIF77" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

            TESTF77=${F77-f77}
            F77="$MPIF77"
            # Extract the first word of "mpif90", so it can be a program name with args.
set dummy mpif90; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1625: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPIF90'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPIF90" in
  /*)
  ac_cv_path_MPIF90="$MPIF90" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPIF90="$MPIF90" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPIF90="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPIF90="$ac_cv_path_MPIF90"
if test -n "$MPIF90"; then
  echo "$ac_t""$MPIF90" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

            TESTF90=${F90-f90}
            F90="$MPIF90"
            # Extract the first word of "mpiCC", so it can be a program name with args.
set dummy mpiCC; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1662: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPICXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPICXX" in
  /*)
  ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPICXX="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPICXX="$ac_cv_path_MPICXX"
if test -n "$MPICXX"; then
  echo "$ac_t""$MPICXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

            TESTCXX=${CXX-CC}
            CXX="$MPICXX"
	    # We may want to restrict this to the path containing mpirun
	    # Extract the first word of "mpirun", so it can be a program name with args.
set dummy mpirun; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1700: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPIRUN'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPIRUN" in
  /*)
  ac_cv_path_MPIRUN="$MPIRUN" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPIRUN="$MPIRUN" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPIRUN="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPIRUN="$ac_cv_path_MPIRUN"
if test -n "$MPIRUN"; then
  echo "$ac_t""$MPIRUN" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

	    # Extract the first word of "mpichboot", so it can be a program name with args.
set dummy mpichboot; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1735: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPIBOOT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPIBOOT" in
  /*)
  ac_cv_path_MPIBOOT="$MPIBOOT" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPIBOOT="$MPIBOOT" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPIBOOT="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPIBOOT="$ac_cv_path_MPIBOOT"
if test -n "$MPIBOOT"; then
  echo "$ac_t""$MPIBOOT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

	    # Extract the first word of "mpichstop", so it can be a program name with args.
set dummy mpichstop; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1770: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPIUNBOOT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPIUNBOOT" in
  /*)
  ac_cv_path_MPIUNBOOT="$MPIUNBOOT" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPIUNBOOT="$MPIUNBOOT" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPIUNBOOT="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPIUNBOOT="$ac_cv_path_MPIUNBOOT"
if test -n "$MPIUNBOOT"; then
  echo "$ac_t""$MPIUNBOOT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

	    PATH="$save_PATH"
  	    MPILIBNAME="mpich"
        else 
	    # All of the above should have been passed in the environment!
	    :
        fi
	;;

        mpichnt)
                	save_CFLAGS="$CFLAGS"
        CFLAGS="$save_CFLAGS -I$with_mpichnt/include"
        save_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$save_CPPFLAGS -I$with_mpichnt/include"
        save_LDFLAGS="$LDFLAGS"
        LDFLAGS="$save_LDFLAGS -L$with_mpichnt/lib"
        echo $ac_n "checking for MPI_Init in -lmpich""... $ac_c" 1>&6
echo "configure:1818: checking for MPI_Init in -lmpich" >&5
ac_lib_var=`echo mpich'_'MPI_Init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lmpich  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1826 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char MPI_Init();

int main() {
MPI_Init()
; return 0; }
EOF
if { (eval echo configure:1837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  found="yes"
else
  echo "$ac_t""no" 1>&6
found="no"
fi

        if test "$found" = "no" ; then
          echo $ac_n "checking for MPI_Init in -lmpich2""... $ac_c" 1>&6
echo "configure:1860: checking for MPI_Init in -lmpich2" >&5
ac_lib_var=`echo mpich2'_'MPI_Init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lmpich2  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1868 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char MPI_Init();

int main() {
MPI_Init()
; return 0; }
EOF
if { (eval echo configure:1879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  found="yes"
else
  echo "$ac_t""no" 1>&6
found="no"
fi

        fi
        if test "$found" = "no" ; then
          CFLAGS=$save_CFLAGS
          CPPFLAGS=$save_CPPFLAGS
          LDFLAGS=$save_LDFLAGS
        fi
        ;;

	lammpi)
	                        save_PATH="$PATH"
        if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then 
	    # Look for commands; if not found, try adding bin to the path
		if test ! -x $with_lammpi/mpicc -a -x $with_lammpi/bin/mpicc ; then
			with_lammpi="$with_lammpi/bin"
		fi
                PATH=$with_lammpi:${PATH}
        fi
        # Extract the first word of "mpicc", so it can be a program name with args.
set dummy mpicc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1920: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPICC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPICC" in
  /*)
  ac_cv_path_MPICC="$MPICC" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPICC="$MPICC" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPICC="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPICC="$ac_cv_path_MPICC"
if test -n "$MPICC"; then
  echo "$ac_t""$MPICC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        TESTCC=${CC-cc}
        CC="$MPICC"
        # Extract the first word of "mpif77", so it can be a program name with args.
set dummy mpif77; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1957: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPIF77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPIF77" in
  /*)
  ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPIF77="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPIF77="$ac_cv_path_MPIF77"
if test -n "$MPIF77"; then
  echo "$ac_t""$MPIF77" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        TESTF77=${F77-f77}
        F77="$MPIF77"
        # Extract the first word of "mpif90", so it can be a program name with args.
set dummy mpif90; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1994: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPIF90'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPIF90" in
  /*)
  ac_cv_path_MPIF90="$MPIF90" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPIF90="$MPIF90" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPIF90="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPIF90="$ac_cv_path_MPIF90"
if test -n "$MPIF90"; then
  echo "$ac_t""$MPIF90" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        TESTF90=${F90-f90}
        F90="$MPIF90"
        # Extract the first word of "mpiCC", so it can be a program name with args.
set dummy mpiCC; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2031: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MPICXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MPICXX" in
  /*)
  ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MPICXX="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MPICXX="$ac_cv_path_MPICXX"
if test -n "$MPICXX"; then
  echo "$ac_t""$MPICXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        TESTCXX=${CXX-CC}
        CXX="$MPICXX"
	PATH="$save_PATH"
  	MPILIBNAME="lammpi"
	MPIBOOT="lamboot"
	MPIUNBOOT="wipe"
	MPIRUN="mpirun"
	;;

	ibmmpi)
	TESTCC=${CC-xlC}; TESTF77=${F77-xlf}; CC=mpcc; F77=mpxlf
	# There is no mpxlf90, but the options langlvl and free can
	# select the F90 version of xlf
	TESTF90=${F90-xlf90}; F90="mpxlf -qlanglvl=90ext -qfree=f90"
	MPILIBNAME=""
	;;

	sgimpi)
	TESTCC=${CC:=cc}; TESTF77=${F77:=f77}; 
	TESTCXX=${CXX:=CC}; TESTF90=${F90:=f90}
	echo $ac_n "checking for MPI_Init in -lmpi""... $ac_c" 1>&6
echo "configure:2084: checking for MPI_Init in -lmpi" >&5
ac_lib_var=`echo mpi'_'MPI_Init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lmpi  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2092 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char MPI_Init();

int main() {
MPI_Init()
; return 0; }
EOF
if { (eval echo configure:2103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo mpi | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lmpi $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

	if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then
	    MPILIBNAME="mpi"
	fi	
	MPIRUN=mpirun
	MPIBOOT=""
	MPIUNBOOT=""
	;;

	*)
	# Find the compilers
	

for ac_prog in cc xlC xlc pgcc icc gcc 
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2147: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CC" && break
done

test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2178: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 2189 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2220: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether the C compiler sets its return status correctly""... $ac_c" 1>&6
echo "configure:2225: checking whether the C compiler sets its return status correctly" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext <<EOF
#line 2235 "configure"
#include "confdefs.h"

int main() {
int a = bzzzt;
; return 0; }
EOF
if { (eval echo configure:2242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  notbroken=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  notbroken=yes
fi
rm -f conftest*
echo "$ac_t""$notbroken" 1>&6
if test "$notbroken" = "no" ; then
    { echo "configure: error: installation or configuration problem: C compiler does not
correctly set error code when a fatal error occurs" 1>&2; exit 1; }
fi

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:2259: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test "$ac_cv_prog_gcc" = yes; then
  GCC=yes
else
  GCC=
fi

	# We only look for the other compilers if there is no
	# disable for them
	if test "$enable_f77" != no -a "$enable_fortran" != no ; then
   	    if test -z "$F77"; then
  for ac_prog in g77 f77 f2c
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2291: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F77"; then
  ac_cv_prog_F77="$F77" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_F77="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F77="$ac_cv_prog_F77"
if test -n "$F77"; then
  echo "$ac_t""$F77" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$F77" && break
done

    test -z "$F77" && { echo "configure: error: no acceptable Fortran 77 compiler found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2324: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works" >&5

ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

cat > conftest.$ac_ext << EOF

      program conftest
      end

EOF
if { (eval echo configure:2337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_f77_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_f77_cross=no
  else
    ac_cv_prog_f77_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_f77_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_f77_works" 1>&6
if test $ac_cv_prog_f77_works = no; then
  { echo "configure: error: installation or configuration problem: Fortran 77 compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2363: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_f77_cross" 1>&6
cross_compiling=$ac_cv_prog_f77_cross

echo $ac_n "checking whether we are using GNU Fortran 77""... $ac_c" 1>&6
echo "configure:2368: checking whether we are using GNU Fortran 77" >&5
if eval "test \"`echo '$''{'ac_cv_prog_g77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.fpp <<EOF
#ifdef __GNUC__
  yes
#endif
EOF
if { ac_try='$F77 -E conftest.fpp'; { (eval echo configure:2377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_g77=yes
else
  ac_cv_prog_g77=no
fi
fi

echo "$ac_t""$ac_cv_prog_g77" 1>&6

if test $ac_cv_prog_g77 = yes; then
  G77=yes
  ac_test_FFLAGS="${FFLAGS+set}"
  ac_save_FFLAGS="$FFLAGS"
  FFLAGS=
  echo $ac_n "checking whether $F77 accepts -g""... $ac_c" 1>&6
echo "configure:2392: checking whether $F77 accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_f77_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.f << EOF
       program conftest
       end
EOF
if test -z "`$F77 -g -c conftest.f 2>&1`"; then
  ac_cv_prog_f77_g=yes
else
  ac_cv_prog_f77_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_f77_g" 1>&6
  if test "$ac_test_FFLAGS" = set; then
    FFLAGS="$ac_save_FFLAGS"
  elif test $ac_cv_prog_f77_g = yes; then
    FFLAGS="-g -O2"
  else
    FFLAGS="-O2"
  fi
else
  G77=
  test "${FFLAGS+set}" = set || FFLAGS="-g"
fi

        fi
	if test "$enable_cxx" != no ; then
	    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2429: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2461: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

#line 2472 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:2477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
if test $ac_cv_prog_cxx_works = no; then
  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2503: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:2508: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi
fi

echo "$ac_t""$ac_cv_prog_gxx" 1>&6

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:2536: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

	fi
	if test "$enable_f90" != no ; then
	    
if test -z "$F90" ; then
    for ac_prog in f90 xlf90 pgf90 ifort epcf90 f95 fort xlf95 lf95 pathf90 g95 fc ifc efc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2576: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F90'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F90"; then
  ac_cv_prog_F90="$F90" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_F90="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F90="$ac_cv_prog_F90"
if test -n "$F90"; then
  echo "$ac_t""$F90" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$F90" && break
done

    test -z "$F90" && echo "configure: warning: no acceptable Fortran 90 compiler found in \$PATH" 1>&2
fi
if test -n "$F90" ; then
     echo $ac_n "checking for extension for Fortran 90 programs""... $ac_c" 1>&6
echo "configure:2609: checking for extension for Fortran 90 programs" >&5
pac_cv_f90_ext="f90"
cat > conftest.$pac_cv_f90_ext <<EOF
      program conftest
      end
EOF
ac_compile='${F90-f90} -c $F90FLAGS conftest.$pac_cv_f90_ext 1>&5'
if { (eval echo configure:2616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then
    echo "$ac_t""f90" 1>&6
else
    rm -f conftest*
    pac_cv_f90_ext="f"
    cat > conftest.$pac_cv_f90_ext <<EOF
      program conftest
      end
EOF
    if { (eval echo configure:2625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then
	echo "$ac_t""f" 1>&6
    else
        echo "$ac_t""unknown!" 1>&6
    fi
fi
echo $ac_n "checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2632: checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) works" >&5

# We cannot use _LANG_FORTRAN90 here because we will usually be executing this
# test in the context of _PROG_F90, which is a require on _LANG_FORTRAN90.
# Instead, we insert the necessary code from _LANG_FORTRAN90 here
ac_ext=$pac_cv_f90_ext
ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&5'
ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$pac_cv_prog_f90_cross
# Include a Fortran 90 construction to distinguish between Fortran 77 
# and Fortran 90 compilers.
cat >conftest.$ac_ext <<EOF
      program conftest
      integer, dimension(10) :: n
      end
EOF
if { (eval echo configure:2648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeect} ; then
    pac_cv_prog_f90_works="yes"
    if (./conftest; exit) 2>/dev/null ; then
        pac_cv_prog_f90_cross="no"
    else
        pac_cv_prog_f90_cross="yes"
    fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  pac_cv_prog_f90_works="no"
fi
rm -f conftest*
# The intel compiler sometimes generates these work.pc and .pcl files
rm -f work.pc work.pcl
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$pac_cv_prog_f90_works" 1>&6
if test $pac_cv_prog_f90_works = no; then
  echo "configure: warning: installation or configuration problem: Fortran 90 compiler cannot create executables." 1>&2
fi
echo $ac_n "checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2675: checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$pac_cv_prog_f90_cross" 1>&6
cross_compiling=$pac_cv_prog_f90_cross

fi
ac_f90ext=$pac_cv_f90_ext
ac_f90compile='${F90-f90} -c $F90FLAGS conftest.$ac_f90ext 1>&5'
ac_f90link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_f90ext $LIBS 1>&5'
# Check for problems with Intel efc compiler, if the compiler works
if test "$pac_cv_prog_f90_works" = yes ; then
    cat > conftest.$ac_f90ext <<EOF
        program main
        end
EOF
    pac_msg=`$F90 -o conftest $F90FLAGS $LDFLAGS conftest.$ac_f90ext $LIBS 2>&1 | grep 'bfd assertion fail'`
    if test -n "$pac_msg" ; then
        pac_msg=`$F90 -o conftest $F90FLAGS $LDFLAGS conftest.$ac_f90ext -i_dynamic $LIBS 2>&1 | grep 'bfd assertion fail'`
        if test -z "$pac_msg" ; then LDFLAGS="-i_dynamic" ; fi
        # There should really be f90linker flags rather than generic ldflags.
    fi
fi

	fi
	# Set defaults for the TEST versions if not already set
	if test -z "$TESTCC" ; then 
	    TESTCC=${CC:=cc}
        fi
	if test -z "$TESTF77" ; then 
  	    TESTF77=${F77:=f77}
        fi
	if test -z "$TESTCXX" ; then
	    TESTCXX=${CXX:=CC}
        fi
	if test -z "$TESTF90" ; then
       	    TESTF90=${F90:=f90}
	fi
	;;
esac



true
if test "X$MAKE" = "X" ; then
   for ac_prog in make gnumake nmake pmake smake
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2723: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$MAKE"; then
  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_MAKE="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
MAKE="$ac_cv_prog_MAKE"
if test -n "$MAKE"; then
  echo "$ac_t""$MAKE" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MAKE" && break
done

fi


echo $ac_n "checking whether clock skew breaks make""... $ac_c" 1>&6
echo "configure:2756: checking whether clock skew breaks make" >&5
if eval "test \"`echo '$''{'pac_cv_prog_make_found_clock_skew'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

rm -f conftest*
cat > conftest <<EOF
ALL:
	@-echo "success"
EOF
$MAKE -f conftest > conftest.out 2>&1
if grep -i skew conftest >/dev/null 2>&1 ; then
    pac_cv_prog_make_found_clock_skew=yes
else
    pac_cv_prog_make_found_clock_skew=no
fi
rm -f conftest*

fi

echo "$ac_t""$pac_cv_prog_make_found_clock_skew" 1>&6
if test "$pac_cv_prog_make_found_clock_skew" = "yes" ; then
    echo "configure: warning: Clock skew found by make.  The configure and build may fail.
Consider building in a local instead of NFS filesystem." 1>&2
fi


echo $ac_n "checking whether make supports include""... $ac_c" 1>&6
echo "configure:2785: checking whether make supports include" >&5
if eval "test \"`echo '$''{'pac_cv_prog_make_include'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

rm -f conftest
cat > conftest <<.
ALL:
	@echo "success"
.
cat > conftest1 <<.
include conftest
.
pac_str=`$MAKE -f conftest1 2>&1`
rm -f conftest conftest1
if test "$pac_str" != "success" ; then
    pac_cv_prog_make_include="no"
else
    pac_cv_prog_make_include="yes"
fi

fi

echo "$ac_t""$pac_cv_prog_make_include" 1>&6
if test "$pac_cv_prog_make_include" = "no" ; then
    :
else
    :
fi


echo $ac_n "checking whether make allows comments in actions""... $ac_c" 1>&6
echo "configure:2818: checking whether make allows comments in actions" >&5
if eval "test \"`echo '$''{'pac_cv_prog_make_allows_comments'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

rm -f conftest
cat > conftest <<.
SHELL=/bin/sh
ALL:
	@# This is a valid comment!
	@echo "success"
.
pac_str=`$MAKE -f conftest 2>&1`
rm -f conftest 
if test "$pac_str" != "success" ; then
    pac_cv_prog_make_allows_comments="no"
else
    pac_cv_prog_make_allows_comments="yes"
fi

fi

echo "$ac_t""$pac_cv_prog_make_allows_comments" 1>&6
if test "$pac_cv_prog_make_allows_comments" = "no" ; then
    echo "configure: warning: Your make does not allow comments in target code.
Using this make may cause problems when building programs.
You should consider using gnumake instead." 1>&2
    
fi



echo $ac_n "checking for virtual path format""... $ac_c" 1>&6
echo "configure:2852: checking for virtual path format" >&5
if eval "test \"`echo '$''{'pac_cv_prog_make_vpath'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

rm -rf conftest*
mkdir conftestdir
cat >conftestdir/a.c <<EOF
A sample file
EOF
cat > conftest <<EOF
all: a.o
VPATH=.:conftestdir
.c.o:
	@echo \$<
EOF
ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
if test -n "$ac_out" ; then 
    pac_cv_prog_make_vpath="VPATH"
else
    rm -f conftest
    cat > conftest <<EOF
all: a.o
.PATH: . conftestdir
.c.o:
	@echo \$<
EOF
    ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
    if test -n "$ac_out" ; then 
        pac_cv_prog_make_vpath=".PATH"
    else
	pac_cv_prog_make_vpath="neither VPATH nor .PATH works"
    fi
fi
rm -rf conftest*

fi

echo "$ac_t""$pac_cv_prog_make_vpath" 1>&6
if test "$pac_cv_prog_make_vpath" = "VPATH" ; then
    VPATH='VPATH=.:${srcdir}'
elif test "$pac_cv_prog_make_vpath" = ".PATH" ; then
    VPATH='.PATH: . ${srcdir}'
fi



echo $ac_n "checking whether make sets CFLAGS""... $ac_c" 1>&6
echo "configure:2901: checking whether make sets CFLAGS" >&5
if eval "test \"`echo '$''{'pac_cv_prog_make_set_cflags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

rm -f conftest
cat > conftest <<EOF
SHELL=/bin/sh
ALL:
	@echo X\${CFLAGS}X
EOF
pac_str=`$MAKE -f conftest 2>&1`
rm -f conftest 
if test "$pac_str" = "XX" ; then
    pac_cv_prog_make_set_cflags="no"
else
    pac_cv_prog_make_set_cflags="yes"
fi

fi

echo "$ac_t""$pac_cv_prog_make_set_cflags" 1>&6
if test "$pac_cv_prog_make_set_cflags" = "no" ; then
    :
else
    SET_CFLAGS='CFLAGS='
fi

if test "$pac_cv_prog_make_echos_dir" = "no" ; then
    echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:2932: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftestmake <<\EOF
all:
	@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_make_${ac_make}_set=yes
else
  eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SET_MAKE=
else
  echo "$ac_t""no" 1>&6
  SET_MAKE="MAKE=${MAKE-make}"
fi

else
    SET_MAKE="MAKE=${MAKE-make}"
fi

# archive program
# In some cases, the AR definition in the MPICH configure is exported.
# Define our own AR here, just in case
if test -n "$ARCMD" ; then
    AR="$ARCMD"
else
    AR=ar
fi

# We need ranlib as well
if test -z "$RANLIB" ; then
    # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2976: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

fi

# allow for a different linker for Fortran programs

if test -z "$F77LINKER" ; then
    F77LINKER="$F77"
fi

if test "$pac_lib_mpi_is_building" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define HAVE_MPI_F2C 1
EOF

else
    
echo $ac_n "checking for MPI F2C and C2F routines""... $ac_c" 1>&6
echo "configure:3019: checking for MPI F2C and C2F routines" >&5
if eval "test \"`echo '$''{'pac_cv_mpi_f2c'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3025 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {
MPI_Request request;MPI_Fint a;a = MPI_Request_c2f(request);
; return 0; }
EOF
if { (eval echo configure:3032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_mpi_f2c="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_mpi_f2c="no"
fi
rm -f conftest*

fi

echo "$ac_t""$pac_cv_mpi_f2c" 1>&6
if test "$pac_cv_mpi_f2c" = "yes" ; then 
    cat >> confdefs.h <<\EOF
#define HAVE_MPI_F2C 1
EOF
 
fi


    # Check for mpi.h
    echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:3056: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 3071 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 3088 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 3105 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

ac_safe=`echo "mpi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for mpi.h""... $ac_c" 1>&6
echo "configure:3137: checking for mpi.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
pac_found_header=no
if test "$CPP" != "/lib/cpp" ; then
    cat > conftest.$ac_ext <<EOF
#line 3145 "configure"
#include "confdefs.h"
#include <mpi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  pac_found_header=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
# If cpp failed, see if the compiler accepts the header.
if test "$pac_found_header" != "yes" ; then
    cat >conftest.c<<EOF
#line 3165 "configure"
#include "confdefs.h"
#include <mpi.h>
int conftest() {return 0;}
EOF
    ac_compile_for_cpp='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
    if { (eval echo configure:3171: \"$ac_compile_for_cpp\") 1>&5; (eval $ac_compile_for_cpp) 2>&5; }; then
	pac_found_header=yes
    else
        echo "configure: failed program was:" >&5
        cat conftest.c >&5
    fi
    rm -f conftest*
fi
# Finally, set the ac variable.
if test "$pac_found_header" = "yes" ; then
    eval "ac_cv_header_$ac_safe=yes"
else
    eval "ac_cv_header_$ac_safe=no"
fi

fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: mpi.h is required" 1>&2; exit 1; }
    
fi

fi

#
# The following variables are used in mpif77.in and reflect the MPI
# implementation that is in use.
# 
if test "$pac_lib_mpi_is_building" = "yes" ; then
    # These values are EXPORTED by the MPICH configure
    # Alternately, if we are building a *new* Fortran library for a
    # pre-existing MPICH build, we need to get these variables from
    # the MPICH library configuration file.
    
    
    
    
    F77_LDFLAGS="$ROMIO_LFLAGS"
    
    BASE_FFLAGS="$ROMIO_TFFLAGS"
    
    
    
    # Shared library support (replace with libtool?)
    
    
    
    
    
    MPI2_OBJECTS='${MPI2_OBJECTS}'
    
fi
if test "$DEBUG_DUMP" = "yes" ; then
    rm -f config.env
    echo "Environment before push" >>config.env
    set >>config.env
    echo "End of env" >> config.env
fi

if test "X$pac_save_level" = "X" ; then
    pac_save_CC="$CC"
    pac_save_CXX="$CXX"
    pac_save_F77="$F77"
    pac_save_F90="$F90"
    pac_save_prog_cc_cross="$ac_cv_prog_cc_cross"
    pac_save_prog_f77_cross="$ac_cv_prog_f77_cross"
    pac_save_prog_cxx_cross="$ac_cv_prog_cxx_cross"
    pac_save_prog_f90_cross="$pac_cv_prog_f90_cross"
    if test "X$CPP" = "X" ; then
	echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:3244: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 3259 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 3276 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 3293 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

    fi
    pac_save_CPP="$CPP"
    CC="${TESTCC:=$CC}"
    CXX="${TESTCXX:=$CXX}"
    F77="${TESTF77:=$F77}"
    F90="${TESTF90:=$F90}"
    if test -z "$TESTCPP" ; then
        
if test -z "$TESTCPP"; then
  if eval "test \"`echo '$''{'pac_cv_prog_TESTCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  rm -f conftest.*
  cat > conftest.c <<EOF
  #include <assert.h>
  Syntax Error
EOF
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  TESTCPP="${TESTCC-cc} -E"
  ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
  if { (eval echo configure:3345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
      pac_cv_prog_TESTCPP="$TESTCPP"
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      TESTCPP="${TESTCC-cc} -E -traditional-cpp"
      ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
      if { (eval echo configure:3351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
          pac_cv_prog_TESTCPP="$TESTCPP"
      fi
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      TESTCPP="${TESTCC-cc} -nologo -E"
      ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
      if { (eval echo configure:3358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
          pac_cv_prog_TESTCPP="$TESTCPP"
      fi
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      # Extract the first word of "cpp", so it can be a program name with args.
set dummy cpp; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3366: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TESTCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$TESTCPP" in
  /*)
  ac_cv_path_TESTCPP="$TESTCPP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_TESTCPP="$TESTCPP" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_TESTCPP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
TESTCPP="$ac_cv_path_TESTCPP"
if test -n "$TESTCPP"; then
  echo "$ac_t""$TESTCPP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi
  rm -f conftest.*
  
fi

else
  pac_cv_prog_TESTCPP="$TESTCPP"
fi

    fi
    CPP="${TESTCPP:=$CPP}"
    pac_save_level="0"
    # Recompute cross_compiling values and set for the current language
    # This is just:
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_cross_compiling" = "yes" ; then
        ac_cv_prog_cc_cross=yes
	ac_cv_prog_cc_works=yes
    else
        cat > conftest.$ac_ext << EOF

#line 3426 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:3431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
    fi
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    # Ignore Fortran if we aren't using it.
    if test -n "$F77" ; then
        
        ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

	if test "$pac_cross_compiling" = "yes" ; then
	    ac_cv_prog_f77_cross=yes
	    ac_cv_prog_f77_works=yes
	else
            cat > conftest.$ac_ext << EOF

      program conftest
      end

EOF
if { (eval echo configure:3471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_f77_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_f77_cross=no
  else
    ac_cv_prog_f77_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_f77_works=no
fi
rm -fr conftest*
	fi
        ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    fi
    # Ignore C++ if we aren't using it.
    if test -n "$CXX" ; then
        
        ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

        cat > conftest.$ac_ext << EOF

#line 3506 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:3511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
        ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    fi
    # Ignore Fortran 90 if we aren't using it.
    if test -n "$F90" ; then
        
        
ac_ext=$pac_cv_f90_ext
ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&5'
ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$pac_cv_prog_f90_cross

	        	if test "$pac_cross_compiling" = "yes" ; then
	    ac_cv_prog_f90_cross=yes
	    ac_cv_prog_f90_works=yes
	else
            cat > conftest.$ac_ext << EOF
      program conftest
      end
EOF
            if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
              ac_cv_prog_f90_works=yes
              # If we can't run a trivial program, we are probably using a cross compiler.
              if (./conftest; exit) 2>/dev/null; then
                  ac_cv_prog_f90_cross=no
              else
                  ac_cv_prog_f90_cross=yes
              fi
            else
              echo "configure: failed program was:" >&5
              cat conftest.$ac_ext >&5
              ac_cv_prog_f90_works=no
            fi
	fi
	pac_cv_prog_f90_cross="$ac_cv_prog_f90_cross"
	pac_cv_prog_f90_works="$ac_cv_prog_f90_works"
        rm -fr conftest*
        ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    fi
fi
pac_save_level=`expr $pac_save_level + 1`

if test "$DEBUG_DUMP" = "yes" ; then
    echo "Environment after push" >>config.env
    set >>config.env
    echo "End of env" >> config.env
fi
if test "$f90nag" = "1" -o "$f95nag" = "1" ; then
    NOG2C=yes
else
    NOG2C=no
fi
if test "$pac_lib_mpi_is_building" = "yes" ; then
        
found_cached="yes"
echo $ac_n "checking for routines to access the command line from Fortran 77""... $ac_c" 1>&6
echo "configure:3592: checking for routines to access the command line from Fortran 77" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_cmdarg'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    echo "$ac_t""searching..." 1>&6
    found_cached="no"
    # First, we perform a quick check.  Does iargc and getarg work?
    fxx_module="${FXX_MODULE:-}"
    f77_getargdecl="${F77_GETARGDECL:-external getarg}"
    f77_getarg="${F77_GETARG:-call GETARG(i,s)}"
    f77_iargc="${F77_IARGC:-IARGC()}"
    #    
    # Grumble.  The Absoft Fortran compiler computes i - i as 0 and then
    # 1.0 / 0 at compile time, even though the code may never be executed.
    # What we need is a way to generate an error, so the second usage of i
    # was replaced with f77_iargc.  
    cat > conftest.f <<EOF
        program main
$fxx_module
        integer i, j
        character*20 s
        $f77_getargdecl
        i = 0
        $f77_getarg
        i=$f77_iargc
        if (i .gt. 1) then
            j = i - $f77_iargc
            j = 1.0 / j
        endif
        end
EOF
    found_answer="no"
    if test -z "$ac_fcompilelink" ; then
        ac_fcompilelink="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $LIBS 1>&5"
    fi
    echo $ac_n "checking whether ${F77-f77} $flags $libs works with GETARG and IARGC""... $ac_c" 1>&6
echo "configure:3629: checking whether ${F77-f77} $flags $libs works with GETARG and IARGC" >&5
    if { (eval echo configure:3630: \"$ac_fcompilelink\") 1>&5; (eval $ac_fcompilelink) 2>&5; } && test -x conftest ; then
	# Check that cross != yes so that this works with autoconf 2.52
	if test "$ac_cv_prog_f77_cross" != "yes" ; then
	    if ./conftest >/dev/null 2>&1 ; then
		found_answer="yes"
	        FXX_MODULE="$fxx_module"
		F77_GETARGDECL="$f77_getargdecl"
		F77_GETARG="$f77_getarg"
		F77_IARGC="$f77_iargc"
		echo "$ac_t""yes" 1>&6
     	    fi
        fi
    fi    
    if test $found_answer = "no" ; then
	echo "$ac_t""no" 1>&6
    # Grumph.  Here are a bunch of different approaches
    # We have several axes the check:
    # Library to link with (none, -lU77 (HPUX), -lg2c (LINUX f77))
    # PEPCF90 (Intel ifc)
    # The first line is a dummy
    # (we experimented with using a <space>, but this caused other 
    # problems because we need <space> in the IFS)
    trial_LIBS="0 -lU77 -lPEPCF90"
    if test "$NOG2C" != "1" ; then
        trial_LIBS="$trial_LIBS -lg2c"
    fi
    # Discard libs that are not availble:
    save_IFS="$IFS"
    # Make sure that IFS includes a space, or the tests that run programs
    # may fail
    IFS=" 
"
    save_trial_LIBS="$trial_LIBS"
    trial_LIBS=""
    cat > conftest.f <<EOF
        program main
        end
EOF
    ac_fcompilelink_test='${F77-f77} -o conftest $FFLAGS conftest.f $LDFLAGS $libs $LIBS 1>&5'
    for libs in $save_trial_LIBS ; do
	if test "$libs" = "0" ; then
	    lib_ok="yes"
        else
	    echo $ac_n "checking whether Fortran 77 links with $libs""... $ac_c" 1>&6
echo "configure:3674: checking whether Fortran 77 links with $libs" >&5
	    if { (eval echo configure:3675: \"$ac_fcompilelink_test\") 1>&5; (eval $ac_fcompilelink_test) 2>&5; } && test -x conftest ; then
		echo "$ac_t""yes" 1>&6
	        lib_ok="yes"
	    else
		echo "$ac_t""no" 1>&6
	        lib_ok="no"
	    fi
	fi
	if test "$lib_ok" = "yes" ; then
	    trial_LIBS="$trial_LIBS
$libs"
        fi
    done

    # Options to use when compiling and linking
    # +U77 is needed by HP Fortran to access getarg etc.
    # The -N109 was used for getarg before we realized that GETARG
    # was necessary with the (non standard conforming) Absoft compiler
    # (Fortran is monocase; Absoft uses mixedcase by default)
    # The -f is used by Absoft and is the compiler switch that folds 
    # symbolic names to lower case.  Without this option, the compiler
    # considers upper- and lower-case letters to be unique.
    # The -YEXT_NAMES=LCS will cause external names to be output as lower
    # case letter for Absoft F90 compilers (default is upper case)
    # The first line is "<space><newline>, the space is important
    # To make the Absoft f77 and f90 work together, we need to prefer the
    # upper case versions of the arguments.  They also require libU77.
    # -YCFRL=1 causes Absoft f90 to work with g77 and similar (f2c-based) 
    # Fortran compilers
    #
    # Problem:  The Intel efc compiler hangs when presented with -N109 .
    # The only real fix for this is to detect this compiler and exclude
    # the test.  We may want to reorganize these tests so that if we
    # can compile code without special options, we never look for them.
    # 
    using_intel_efc="no"
    pac_test_msg=`$F77 -V 2>&1 | grep 'Intel(R) Fortran Itanium'`
    if test "$pac_test_msg" != "" ; then
	using_intel_efc="yes"
    fi
    if test "$using_intel_efc" = "yes" ; then
        trial_FLAGS="000"
    else
        trial_FLAGS="000
-N109
-f
-YEXT_NAMES=UCS
-YEXT_NAMES=LCS
-YCFRL=1
+U77"
    fi
    # Discard options that are not available:
    # (IFS already saved above)
    IFS=" 
"
    save_trial_FLAGS="$trial_FLAGS"
    trial_FLAGS=""
    for flag in $save_trial_FLAGS ; do
	if test "$flag" = " " -o "$flag" = "000" ; then
	    opt_ok="yes"
        else
            
echo $ac_n "checking whether Fortran 77 compiler accepts option $flag""... $ac_c" 1>&6
echo "configure:3738: checking whether Fortran 77 compiler accepts option $flag" >&5
ac_result="no"
save_FFLAGS="$FFLAGS"
FFLAGS="$flag $FFLAGS"
rm -f conftest.out
cat >conftest2.f <<EOF
        subroutine try()
        end
EOF
cat >conftest.f <<EOF
        program main
        end
EOF
ac_fscompilelink='${F77-f77} $save_FFLAGS -o conftest conftest.f $LDFLAGS >conftest.bas 2>&1'
ac_fscompilelink2='${F77-f77} $FFLAGS -o conftest conftest.f $LDFLAGS >conftest.out 2>&1'
if { (eval echo configure:3753: \"$ac_fscompilelink\") 1>&5; (eval $ac_fscompilelink) 2>&5; } && test -x conftest ; then
   if { (eval echo configure:3754: \"$ac_fscompilelink2\") 1>&5; (eval $ac_fscompilelink2) 2>&5; } && test -x conftest ; then
      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
         echo "$ac_t""yes" 1>&6
         echo $ac_n "checking whether routines compiled with $flag can be linked with ones compiled  without $flag""... $ac_c" 1>&6
echo "configure:3758: checking whether routines compiled with $flag can be linked with ones compiled  without $flag" >&5       
         rm -f conftest2.out
         rm -f conftest.bas
	 ac_fscompile3='${F77-f77} -c $save_FFLAGS conftest2.f >conftest2.out 2>&1'
	 ac_fscompilelink4='${F77-f77} $FFLAGS -o conftest conftest2.o conftest.f $LDFLAGS >conftest.bas 2>&1'
         if { (eval echo configure:3763: \"$ac_fscompile3\") 1>&5; (eval $ac_fscompile3) 2>&5; } && test -s conftest2.o ; then
            if { (eval echo configure:3764: \"$ac_fscompilelink4\") 1>&5; (eval $ac_fscompilelink4) 2>&5; } && test -x conftest ; then
               if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
	          ac_result="yes"
	       else 
		  echo "configure: Compiler output differed in two cases" >&5
                  diff -b conftest.out conftest.bas >&5
	       fi
	    else
	       echo "configure: failed program was:" >&5
	       cat conftest.f >&5
	    fi
	  else
	    echo "configure: failed program was:" >&5
	    cat conftest2.f >&5
	  fi
      else
	# diff
        echo "configure: Compiler output differed in two cases" >&5
        diff -b conftest.out conftest.bas >&5
      fi
   else
      # try_eval(fscompilelink2)
      echo "configure: failed program was:" >&5
      cat conftest.f >&5
   fi
   if test "$ac_result" != "yes" -a -s conftest.out ; then
	cat conftest.out >&5
   fi
else
    # Could not compile without the option!
    echo "configure: Could not compile program" >&5
    cat conftest.f >&5
    cat conftest.bas >&5
fi
if test "$ac_result" = "yes" ; then
     echo "$ac_t""yes" 1>&6	  
     opt_ok=yes
else
     echo "$ac_t""no" 1>&6
     opt_ok=no
fi
FFLAGS="$save_FFLAGS"
rm -f conftest*

        fi
	if test "$opt_ok" = "yes" ; then
	    if test "$flag" = " " -o "$flag" = "000" ; then 
		fflag="" 
	    else 
		fflag="$flag" 
	    fi
	    # discard options that don't allow mixed-case name matching
	    cat > conftest.f <<EOF
        program main
        call aB()
        end
        subroutine Ab()
        end
EOF
	    if test -n "$fflag" ; then flagval="with $fflag" ; else flagval="" ; fi
	    echo $ac_n "checking whether Fortran 77 routine names are case-insensitive $flagval""... $ac_c" 1>&6
echo "configure:3825: checking whether Fortran 77 routine names are case-insensitive $flagval" >&5
	                            ac_fcompilelink_test="${F77-f77} -o conftest $fflag $FFLAGS conftest.f $LDFLAGS $LIBS 1>&5"
	    if { (eval echo configure:3827: \"$ac_fcompilelink_test\") 1>&5; (eval $ac_fcompilelink_test) 2>&5; } && test -x conftest ; then
	        echo "$ac_t""yes" 1>&6
	    else
	        echo "$ac_t""no" 1>&6
	        opt_ok="no"
            fi
        fi
        if test "$opt_ok" = "yes" ; then
	    trial_FLAGS="$trial_FLAGS
$flag"
        fi
    done
    IFS="$save_IFS"
    # Name of routines.  Since these are in groups, we use a case statement
    # and loop until the end (accomplished by reaching the end of the
    # case statement
    # For one version of Nag F90, the names are 
    # call f90_unix_MP_getarg(i,s) and f90_unix_MP_iargc().
    trial=0
    while test -z "$pac_cv_prog_f77_cmdarg" ; do
        case $trial in 
	0) # User-specified values, if any
	   if test -z "$F77_GETARG" -o -z "$F77_IARGC" ; then 
	       trial=`expr $trial + 1`
	       continue 
           fi
           MSG="Using environment values of F77_GETARG etc."
	   ;;
	1) # Standard practice, uppercase (some compilers are case-sensitive)
	   FXX_MODULE=""
	   F77_GETARGDECL="external GETARG"
	   F77_GETARG="call GETARG(i,s)"
	   F77_IARGC="IARGC()"
	   MSG="GETARG and IARGC"
	   ;;
	2) # Standard practice, lowercase
	   FXX_MODULE=""
           F77_GETARGDECL="external getarg"
	   F77_GETARG="call getarg(i,s)"
	   F77_IARGC="iargc()"
	   MSG="getarg and iargc"
	   ;;
	3) # Posix alternative
	   FXX_MODULE=""
	   F77_GETARGDECL="external pxfgetarg"
	   F77_GETARG="call pxfgetarg(i,s,l,ier)"
	   F77_IARGC="ipxfargc()"
	   MSG="pxfgetarg and ipxfargc"
	   ;;
	4) # Nag f90_unix_env module
	   FXX_MODULE="        use f90_unix_env"
	   F77_GETARGDECL=""
	   F77_GETARG="call getarg(i,s)"
	   F77_IARGC="iargc()"
	   MSG="f90_unix_env module"
	   ;;
        5) # Nag f90_unix module
	   FXX_MODULE="        use f90_unix"
	   F77_GETARGDECL=""
	   F77_GETARG="call getarg(i,s)"
	   F77_IARGC="iargc()"
	   MSG="f90_unix module"
	   ;;
	6) # user spec in a file
	   if test -s f77argdef ; then
		. ./f77argdef
	       MSG="Using definitions in the file f77argdef"
	   else
	        trial=`expr $trial + 1`
		continue
	   fi
	   ;;
        *) # exit from while loop
	   FXX_MODULE=""
	   F77_GETARGDECL=""
	   F77_GETARG=""
	   F77_IARGC=""
           break
	   ;;
	esac
	# Create the program.  Make sure that we can run it.
	# Force a divide-by-zero if there is a problem (but only at runtime!
        # (the Absoft compiler does divide-by-zero at compile time)
        cat > conftest.f <<EOF
        program main
$FXX_MODULE
        integer i, j
        character*20 s
        $F77_GETARGDECL
        i = 0
        $F77_GETARG
        i=$F77_IARGC
        if (i .gt. 1) then
            j = i - $F77_IARGC
            j = 1.0 / j
        endif
        end
EOF
    #
    # Now, try to find some way to compile and link that program, looping 
    # over the possibilities of options and libraries
        save_IFS="$IFS"
        IFS=" 
"
        for libs in $trial_LIBS ; do
            if test -n "$pac_cv_prog_f77_cmdarg" ; then break ; fi
	    if test "$libs" = " " -o "$libs" = "0" ; then libs="" ; fi
            for flags in $trial_FLAGS ; do
	        if test "$flags" = " " -o "$flags" = "000"; then flags="" ; fi
                echo $ac_n "checking whether ${F77-f77} $flags $libs works with $MSG""... $ac_c" 1>&6
echo "configure:3937: checking whether ${F77-f77} $flags $libs works with $MSG" >&5
		IFS="$save_IFS"
			        ac_fcompilelink_test="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $libs $LIBS 1>&5"
		found_answer="no"
                if { (eval echo configure:3941: \"$ac_fcompilelink_test\") 1>&5; (eval $ac_fcompilelink_test) 2>&5; } && test -x conftest ; then
		    if test "$ac_cv_prog_f77_cross" != "yes" ; then
			if ./conftest >/dev/null 2>&1 ; then
			    found_answer="yes"
			fi
		    else 
			found_answer="yes"
		    fi
                fi
	        IFS=" 
"
		if test "$found_answer" = "yes" ; then
	            echo "$ac_t""yes" 1>&6
		    pac_cv_prog_f77_cmdarg="$MSG"
		    pac_cv_prog_f77_cmdarg_fflags="$flags"
		    pac_cv_prog_f77_cmdarg_ldflags="$libs"
		    break
	        else
                    echo "$ac_t""no" 1>&6
		    echo "configure: failed program was:" >&5
                    cat conftest.f >&5
	        fi
            done
        done
        IFS="$save_IFS"   
	rm -f conftest.*
        trial=`expr $trial + 1`   
    done
fi
pac_cv_F77_GETARGDECL="$F77_GETARGDECL"
pac_cv_F77_IARGC="$F77_IARGC"
pac_cv_F77_GETARG="$F77_GETARG"
pac_cv_FXX_MODULE="$FXX_MODULE"

fi

if test "$found_cached" = "yes" ; then 
    echo "$ac_t""$pac_cv_prog_f77_cmdarg" 1>&6
elif test -z "$pac_cv_F77_IARGC" ; then
    echo "configure: warning: Could not find a way to access the command line from Fortran 77" 1>&2
fi
# Set the variable values based on pac_cv_prog_xxx
F77_GETARGDECL="$pac_cv_F77_GETARGDECL"
F77_IARGC="$pac_cv_F77_IARGC"
F77_GETARG="$pac_cv_F77_GETARG"
FXX_MODULE="$pac_cv_FXX_MODULE"
F77_GETARG_FFLAGS="$pac_cv_prog_f77_cmdarg_fflags"
F77_GETARG_LDFLAGS="$pac_cv_prog_f77_cmdarg_ldflags"







    if test -z "$pac_cv_F77_IARGC" ; then 
        { echo "configure: error: Command line access is required for MPICH" 1>&2; exit 1; }
    fi
                if test "$F90" = "$F77" ; then 
        # We don't need to do anything
	pac_cv_prog_f90_cmdarg_fflags="$pac_cv_prog_f77_cmdarg_fflags"
	pac_cv_prog_f90_cmdarg_ldflags="$pac_cv_prog_f77_cmdarg_ldflags"
        F90_GETARG_FFLAGS="$pac_cv_prog_f90_cmdarg_fflags"
        F90_GETARG_LDFLAGS="$pac_cv_prog_f90_cmdarg_ldflags"
    elif test -n "$F90" -a "$enable_f90" != "no" ; then
        echo $ac_n "checking how to compile and link Fortran 90 programs with Fortran 77 programs that access the command line""... $ac_c" 1>&6
echo "configure:4007: checking how to compile and link Fortran 90 programs with Fortran 77 programs that access the command line" >&5
        if eval "test \"`echo '$''{'pac_cv_prog_f90_cmdarg'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	echo "$ac_t""searching..." 1>&6
		cat >conftest.f <<EOF
       program main
       character*20 s
       integer       i, icnt
       $F77_GETARG
       icnt = $F77_IARGC
       end              
EOF
	MSG="$pac_cv_prog_f77_cmdarg"
        trial_LIBS="0 -lU77 -lPEPCF90"
        if test "$NOG2C" != "1" ; then
            trial_LIBS="$trial_LIBS -lg2c"
        fi
	trial_FLAGS="0 -YEXT_NAMES=UCS -YEXT_NAMES=LCS -YCFRL=1 +U77"
        for libs in $trial_LIBS ; do
            if test -n "$pac_cv_prog_f90_cmdarg" ; then break ; fi
	    if test "$libs" = "0" ; then libs="" ; fi
            for flags in $trial_FLAGS ; do
		if test "$flags" = "0" ; then flags="" ; fi
		if test -z "$MSG" ; then
  	  	    echo $ac_n "checking if $F90 $flags $libs works""... $ac_c" 1>&6
echo "configure:4034: checking if $F90 $flags $libs works" >&5
		else
  	  	    echo $ac_n "checking if $F90 $flags $libs works with $MSG""... $ac_c" 1>&6
echo "configure:4037: checking if $F90 $flags $libs works with $MSG" >&5
                fi
	        ac_f90compilelink_test="${F90-f90} -o conftest $F90FLAGS $flags conftest.f $libs $LIBS 1>&5"
		if { (eval echo configure:4040: \"$ac_f90compilelink_test\") 1>&5; (eval $ac_f90compilelink_test) 2>&5; } && test -x conftest ; then
		    echo "$ac_t""yes" 1>&6
		    pac_cv_prog_f90_cmdarg="$flags $libs"
		    pac_cv_prog_f90_cmdarg_flags="$flags"
		    pac_cv_prog_f90_cmdarg_ldflags="$libs"
		    break
	        else
		    echo "$ac_t""no" 1>&6
		    echo "configure: failed program was:" >&5
                    cat conftest.f >&5
	        fi
	    done
	done
	rm -f conftest*

fi

	echo "$ac_t""$pac_cv_prog_f90_cmdarg" 1>&6
        F90_GETARG_FFLAGS="$pac_cv_prog_f90_cmdarg_fflags"
        F90_GETARG_LDFLAGS="$pac_cv_prog_f90_cmdarg_ldflags"
        
        
    fi
    # We need to add F77_GETARG_FFLAGS to FFLAGS or to F77 (they may
    # change the compiler, for example, by changing the way external
    # names are generated)
    F77="$F77 $F77_GETARG_FFLAGS"
    # We need to update the saved Fortran name
    pac_save_F77="$pac_save_F77 $F77_GETARG_FFLAGS"
fi
FLIBS_save="$FLIBS"
FLIBS=""

# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi

echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:4079: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
    fi ;;
  *) host_alias=$nonopt ;;
  esac ;;
esac

host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6

echo $ac_n "checking for Fortran 77 libraries""... $ac_c" 1>&6
echo "configure:4100: checking for Fortran 77 libraries" >&5


if eval "test \"`echo '$''{'ac_cv_flibs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo "      END" > conftest.f
foutput=`${F77} -v -o conftest conftest.f 2>&1`
g77_p=`echo $foutput | grep GNU`
if test -n "$g77_p" ; then
  foutput=`${F77} -v -o conftest conftest.f 2>&1 | sed '/^Driving:/d'`
fi
xlf_p=`echo $foutput | grep xlfentry`
if test -n "$xlf_p"; then
  foutput=`echo $foutput | sed 's/,/ /g'`
fi
ld_run_path=`echo $foutput | \
  sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'`
case "$ld_run_path" in
  /*)
    if test "$ac_cv_prog_gcc" = yes; then
      ld_run_path="-Xlinker -R -Xlinker $ld_run_path"
    else
      ld_run_path="-R $ld_run_path"
    fi
  ;;
  *)
    ld_run_path=
  ;;
esac
flibs=
lflags=
want_arg=
for arg in $foutput; do
  old_want_arg=$want_arg
  want_arg=
  if test -n "$old_want_arg"; then
    case "$arg" in
      -*)
        old_want_arg=
      ;;
    esac
  fi
  case "$old_want_arg" in
    '')
      case $arg in
        /*.a)
          exists=false
          for f in $lflags; do
            if test x$arg = x$f; then
              exists=true
            fi
          done
          if $exists; then
            arg=
          else
            lflags="$lflags $arg"
          fi
        ;;
        -bI:*)
          exists=false
          for f in $lflags; do
            if test x$arg = x$f; then
              exists=true
            fi
          done
          if $exists; then
            arg=
          else
            if test "$ac_cv_prog_gcc" = yes; then
              lflags="$lflags -Xlinker $arg"
            else
              lflags="$lflags $arg"
            fi
          fi
        ;;
        -lang* | -lcrt0.o | -lc | -lgcc)
          arg=
        ;;
        -[lLR])
          want_arg=$arg
          arg=
        ;;
        -[lLR]*)
          exists=false
          for f in $lflags; do
            if test x$arg = x$f; then
              exists=true
            fi
          done
          if $exists; then
            arg=
          else
            case "$arg" in
              -lkernel32)
                case "$canonical_host_type" in
                  *-*-cygwin*)
                    arg=
                  ;;
                  *)
                    lflags="$lflags $arg"
                  ;;
                esac
              ;;
              -lm)
              ;;
              *)
                lflags="$lflags $arg"
              ;;
            esac
          fi
        ;;
        -u)
          want_arg=$arg
          arg=
        ;;
        -Y)
          want_arg=$arg
          arg=
        ;;
        *)
          arg=
        ;;
      esac
    ;;
    -[lLR])
      arg="$old_want_arg $arg"
    ;;
    -u)
      arg="-u $arg"
    ;;
    -Y)
      arg=`echo $arg | sed -e 's%^P,%%'`
      SAVE_IFS=$IFS
      IFS=:
      list=
      for elt in $arg; do
        list="$list -L$elt"
      done
      IFS=$SAVE_IFS
      arg="$list"
    ;;
  esac
  if test -n "$arg"; then
    flibs="$flibs $arg"
  fi
done
if test -n "$ld_run_path"; then
  flibs_result="$ld_run_path $flibs"
else
  flibs_result="$flibs"
fi
ac_cv_flibs="$flibs_result"
fi

FLIBS="$ac_cv_flibs"
echo "$ac_t""$FLIBS" 1>&6

echo $ac_n "checking whether C can link with $FLIBS""... $ac_c" 1>&6
echo "configure:4259: checking whether C can link with $FLIBS" >&5
# Try to link a C program with all of these libraries
save_LIBS="$LIBS"
LIBS="$LIBS $FLIBS"
cat > conftest.$ac_ext <<EOF
#line 4264 "configure"
#include "confdefs.h"

int main() {
int a;
; return 0; }
EOF
if { (eval echo configure:4271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  runs=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  runs=no
fi
rm -f conftest*
LIBS="$save_LIBS"
echo "$ac_t""$runs" 1>&6
if test "$runs" = "no" ; then
    echo $ac_n "checking for which libraries can be used""... $ac_c" 1>&6
echo "configure:4285: checking for which libraries can be used" >&5
    pac_ldirs=""
    pac_libs=""
    pac_other=""
    for name in $FLIBS ; do
        case $name in 
        -l*) pac_libs="$pac_libs $name" ;;
        -L*) pac_ldirs="$pac_ldirs $name" ;;
        *)   pac_other="$pac_other $name" ;;
        esac
    done
    save_LIBS="$LIBS"
    keep_libs=""
    for name in $pac_libs ; do 
        LIBS="$save_LIBS $pac_ldirs $pac_other $name"
        cat > conftest.$ac_ext <<EOF
#line 4301 "configure"
#include "confdefs.h"

int main() {
int a;
; return 0; }
EOF
if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  runs=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  runs=no
fi
rm -f conftest*
        if test $runs = "yes" ; then keep_libs="$keep_libs $name" ; fi
    done
    echo "$ac_t""$keep_libs" 1>&6
    LIBS="$save_LIBS"
    FLIBS="$pac_ldirs $pac_other $keep_libs"
fi


cat > conftest.$ac_ext <<EOF
#line 4327 "configure"
#include "confdefs.h"

int main() {
long long a;
; return 0; }
EOF
if { (eval echo configure:4334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_LONG_LONG 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
echo $ac_n "checking for linker for Fortran main programs""... $ac_c" 1>&6
echo "configure:4346: checking for linker for Fortran main programs" >&5
cat > conftest.c <<EOF
#include "confdefs.h"
#ifdef HAVE_LONG_LONG
int f(int a, long long b) { int c; c = a * ( b / 3 ) / (b-1); return c ; }
#else
int f(int a, long b) { int c; c = a * b / (b-1); return c ; }
#endif
EOF

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

if { (eval echo configure:4363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    mv conftest.o conftest1.o
else
    { echo "configure: error: Could not compile C test program" 1>&2; exit 1; }
fi
ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

cat > conftest.f <<EOF
        program main
        double precision d
        print *, "hi"
        end
EOF
if { (eval echo configure:4379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    if ${F77} -o conftest conftest.o conftest1.o $LDFLAGS 2>&5 ; then
	echo "$ac_t""Use Fortran to link programs" 1>&6
    elif ${CC} -o conftest conftest.o conftest1.o $LDFLAGS $FLIBS 2>&5 ; then
	echo "$ac_t""Use C with FLIBS to link programs" 1>&6
	F77LINKER="$CC"
        F77_LDFLAGS="$F77_LDFLAGS $FLIBS"
    else
	echo "$ac_t""Unable to determine how to link Fortran programs with C" 1>&6
    fi
else
    { echo "configure: error: Could not compile Fortran test program" 1>&2; exit 1; }
fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross



echo $ac_n "checking for Fortran 77 name mangling""... $ac_c" 1>&6
echo "configure:4402: checking for Fortran 77 name mangling" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_name_mangle'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
   # Check for strange behavior of Fortran.  For example, some FreeBSD
   # systems use f2c to implement f77, and the version of f2c that they 
   # use generates TWO (!!!) trailing underscores
   # Currently, WDEF is not used but could be...
   #
   # Eventually, we want to be able to override the choices here and
   # force a particular form.  This is particularly useful in systems
   # where a Fortran compiler option is used to force a particular
   # external name format (rs6000 xlf, for example).
   rm -f conftest*
   cat > conftest.f <<EOF
       subroutine MY_name( i )
       return
       end
EOF
   # This is the ac_compile line used if LANG_FORTRAN77 is selected
   if test "X$ac_fcompile" = "X" ; then
       ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&5'
   fi
   if { (eval echo configure:4426: \"$ac_fcompile\") 1>&5; (eval $ac_fcompile) 2>&5; } && test -s conftest.o ; then
	mv conftest.o fconftestf.o
   else 
	echo "configure: failed program was:" >&5
        cat conftest.f >&5
   fi

   
   ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
   
   save_LIBS="$LIBS"
      LIBS="fconftestf.o $FLIBS $LIBS"
   cat > conftest.$ac_ext <<EOF
#line 4444 "configure"
#include "confdefs.h"

int main() {
my_name();
; return 0; }
EOF
if { (eval echo configure:4451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="lower"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 4461 "configure"
#include "confdefs.h"

int main() {
my_name_();
; return 0; }
EOF
if { (eval echo configure:4468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="lower underscore"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 4479 "configure"
#include "confdefs.h"
void __stdcall MY_NAME(int);
int main() {
MY_NAME(0);
; return 0; }
EOF
if { (eval echo configure:4486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="upper stdcall"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 4497 "configure"
#include "confdefs.h"

int main() {
MY_NAME();
; return 0; }
EOF
if { (eval echo configure:4504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="upper"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 4515 "configure"
#include "confdefs.h"

int main() {
my_name__();
; return 0; }
EOF
if { (eval echo configure:4522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="lower doubleunderscore"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 4533 "configure"
#include "confdefs.h"

int main() {
MY_name();
; return 0; }
EOF
if { (eval echo configure:4540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="mixed"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 4551 "configure"
#include "confdefs.h"

int main() {
MY_name_();
; return 0; }
EOF
if { (eval echo configure:4558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="mixed underscore"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   LIBS="$save_LIBS"
   ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

   rm -f fconftest*

fi

echo "$ac_t""$pac_cv_prog_f77_name_mangle" 1>&6
# Make the actual definition
pac_namecheck=`echo X$pac_cv_prog_f77_name_mangle | sed 's/ /-/g'`

pac_cv_test_stdcall=""
case $pac_namecheck in
    X) echo "configure: warning: Cannot determine Fortran naming scheme" 1>&2 ;;
    Xlower) cat >> confdefs.h <<\EOF
#define F77_NAME_LOWER 1
EOF
 
	F77_NAME_MANGLE="F77_NAME_LOWER"
	;;
    Xlower-underscore) cat >> confdefs.h <<\EOF
#define F77_NAME_LOWER_USCORE 1
EOF

	F77_NAME_MANGLE="F77_NAME_LOWER_USCORE"
	 ;;
    Xlower-doubleunderscore) cat >> confdefs.h <<\EOF
#define F77_NAME_LOWER_2USCORE 1
EOF

	F77_NAME_MANGLE="F77_NAME_LOWER_2USCORE"
	 ;;
    Xupper) cat >> confdefs.h <<\EOF
#define F77_NAME_UPPER 1
EOF
 
	F77_NAME_MANGLE="F77_NAME_UPPER"
	;;
    Xmixed) cat >> confdefs.h <<\EOF
#define F77_NAME_MIXED 1
EOF
 
	F77_NAME_MANGLE="F77_NAME_MIXED"
	;;
    Xmixed-underscore) cat >> confdefs.h <<\EOF
#define F77_NAME_MIXED_USCORE 1
EOF
 
	F77_NAME_MANGLE="F77_NAME_MIXED_USCORE"
	;;
    Xupper-stdcall) cat >> confdefs.h <<\EOF
#define F77_NAME_UPPER 1
EOF

        F77_NAME_MANGLE="F77_NAME_UPPER_STDCALL"
        pac_cv_test_stdcall="__stdcall"
        ;;
    *) echo "configure: warning: Unknown Fortran naming scheme" 1>&2 ;;
esac

if test "X$pac_cv_test_stdcall" = "X" ; then
        cat >> confdefs.h <<\EOF
#define STDCALL 
EOF

else
        cat >> confdefs.h <<\EOF
#define STDCALL __stdcall
EOF

fi



echo $ac_n "checking for which Fortran libraries are needed to link C with Fortran""... $ac_c" 1>&6
echo "configure:4647: checking for which Fortran libraries are needed to link C with Fortran" >&5
F77_IN_C_LIBS="$FLIBS"
rm -f conftest*
cat <<EOF > conftest.f
        subroutine ftest
        end
EOF
if test "X$ac_fcompile" = "X" ; then
    ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&5'
fi
if { (eval echo configure:4657: \"$ac_fcompile\") 1>&5; (eval $ac_fcompile) 2>&5; } && test -s conftest.o ; then
    mv conftest.o mconftestf.o
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    save_LIBS="$LIBS"
        LIBS="mconftestf.o $save_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 4670 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {

#ifdef F77_NAME_UPPER
#define ftest_ FTEST
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
#define ftest_ ftest
#endif
ftest_();

; return 0; }
EOF
if { (eval echo configure:4684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  link_worked=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  link_worked=no 
fi
rm -f conftest*
    if test "$link_worked" = "no" ; then
        flibdirs=`echo $FLIBS | tr ' ' '\012' | grep '\-L' | tr '\012' ' '`
        fliblibs=`echo $FLIBS | tr ' ' '\012' | grep -v '\-L' | tr '\012' ' '`
        for flibs in $fliblibs ; do
            LIBS="mconftestf.o $flibdirs $flibs $save_LIBS"
            cat > conftest.$ac_ext <<EOF
#line 4700 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {

#ifdef F77_NAME_UPPER
#define ftest_ FTEST
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
#define ftest_ ftest
#endif
ftest_();

; return 0; }
EOF
if { (eval echo configure:4714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  link_worked=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  link_worked=no 
fi
rm -f conftest*
            if test "$link_worked" = "yes" ; then 
	        F77_IN_C_LIBS="$flibdirs $flibs"
                break
            fi
        done
    if test "$link_worked" = "no" ; then
	# try to add libraries until it works...
        flibscat=""
        for flibs in $fliblibs ; do
	    flibscat="$flibscat $flibs"
            LIBS="mconftestf.o $flibdirs $flibscat $save_LIBS"
            cat > conftest.$ac_ext <<EOF
#line 4736 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {

#ifdef F77_NAME_UPPER
#define ftest_ FTEST
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
#define ftest_ ftest
#endif
ftest_();

; return 0; }
EOF
if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  link_worked=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  link_worked=no 
fi
rm -f conftest*
            if test "$link_worked" = "yes" ; then 
	        F77_IN_C_LIBS="$flibdirs $flibscat"
                break
            fi
        done
    fi
    else
	# No libraries needed
	F77_IN_C_LIBS=""
    fi
    LIBS="$save_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

else 
    echo "configure: failed program was:" >&5
    cat conftest.f >&5
fi
rm -f conftest* mconftest*
if test -z "$F77_IN_C_LIBS" ; then
    echo "$ac_t""none" 1>&6
else
    echo "$ac_t""$F77_IN_C_LIBS" 1>&6
fi


ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross


echo $ac_n "checking whether Fortran accepts ! for comments""... $ac_c" 1>&6
echo "configure:4797: checking whether Fortran accepts ! for comments" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_exclaim_comments'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

cat > conftest.$ac_ext <<EOF
      program main

!      This is a comment

      end
EOF
if { (eval echo configure:4815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  pac_cv_prog_f77_exclaim_comments="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_prog_f77_exclaim_comments="no"
fi
rm -f conftest*
ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross


fi

echo "$ac_t""$pac_cv_prog_f77_exclaim_comments" 1>&6
if test "$pac_cv_prog_f77_exclaim_comments" = "yes" ; then
    has_exclaim="yes"
else
    has_exclaim="no"
fi


echo $ac_n "checking whether Fortran supports new-style character declarations""... $ac_c" 1>&6
echo "configure:4842: checking whether Fortran supports new-style character declarations" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_new_char_decl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

cat > conftest.$ac_ext <<EOF
      program main

        character (len=10) s

      end
EOF
if { (eval echo configure:4860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  pac_cv_prog_f77_new_char_decl="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_prog_f77_new_char_decl="no"
fi
rm -f conftest*
ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross


fi

echo "$ac_t""$pac_cv_prog_f77_new_char_decl" 1>&6
if test "$pac_cv_prog_f77_new_char_decl" = "yes" ; then
    CHARDECL="(LEN=*)"
else
    CHARDECL="*(*)"
fi



checkdir=include
echo $ac_n "checking for include directory flag for Fortran""... $ac_c" 1>&6
echo "configure:4889: checking for include directory flag for Fortran" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_has_incdir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test ! -d $checkdir ; then mkdir $checkdir ; fi
cat >$checkdir/conftestf.h <<EOF
       call sub()
EOF
cat >conftest.f <<EOF
       program main
       include 'conftestf.h'
       end
EOF

ac_fcompiletest='${F77-f77} -c $FFLAGS ${idir}$checkdir conftest.f 1>&5'
pac_cv_prog_f77_has_incdir="none"
# SGI wants -Wf,-I
for idir in "-I" "-Wf,-I" ; do
    if { (eval echo configure:4908: \"$ac_fcompiletest\") 1>&5; (eval $ac_fcompiletest) 2>&5; } && test -s conftest.o ; then
        pac_cv_prog_f77_has_incdir="$idir"
	break
    fi
done
rm -f conftest*
rm -f $checkdir/conftestf.h

fi

echo "$ac_t""$pac_cv_prog_f77_has_incdir" 1>&6

if test "X$pac_cv_prog_f77_has_incdir" != "Xnone" ; then
    F77_INCDIR="$pac_cv_prog_f77_has_incdir"
fi

if test -n "$F77_INCDIR" ; then
    # For building the Fortran files, add the directory where we are building 
    # the object to the include list.  This is needed for g77, which makes
    # includes relative to the source directory of the file, not the 
    # directory that the command is executed in
    FINCLUDES="$F77_INCDIR`pwd`/src"
fi

#

if test "X$F77_LIBDIR_LEADER" = "X" ; then
echo $ac_n "checking for Fortran 77 flag for library directories""... $ac_c" 1>&6
echo "configure:4936: checking for Fortran 77 flag for library directories" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_library_dir_flag'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    rm -f conftest.* conftest1.* 
    cat > conftest.f <<EOF
        program main
        call f1conf
        end
EOF
    cat > conftest1.f <<EOF
        subroutine f1conf
        end
EOF
    ac_fcompileforlib='${F77-f77} -c $FFLAGS conftest1.f 1>&5'
    if { (eval echo configure:4953: \"$ac_fcompileforlib\") 1>&5; (eval $ac_fcompileforlib) 2>&5; } && test -s conftest1.o ; then
        if test ! -d conftest ; then mkdir conftest2 ; fi
	        { ac_try='${ARCMD-"ar"} cr conftest2/libconftest.a conftest1.o'; { (eval echo configure:4955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
        { ac_try='${RANLIB-ranlib} conftest2/libconftest.a'; { (eval echo configure:4956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
        ac_fcompileldtest='${F77-f77} -o conftest $FFLAGS ${ldir}conftest2 conftest.f -lconftest $LDFLAGS 1>&5'
        for ldir in "-L" "-Wl,-L," ; do
            if { (eval echo configure:4959: \"$ac_fcompileldtest\") 1>&5; (eval $ac_fcompileldtest) 2>&5; } && test -s conftest ; then
	        pac_cv_prog_f77_library_dir_flag="$ldir"
	        break
            fi
        done
        rm -rf ./conftest2
    else
        echo "configure: failed program was:" >&5
        cat conftest1.f >&5
    fi
    rm -f conftest*

fi

echo "$ac_t""$pac_cv_prog_f77_library_dir_flag" 1>&6
    
    if test "X$pac_cv_prog_f77_library_dir_flag" != "X" ; then
        F77_LIBDIR_LEADER="$pac_cv_prog_f77_library_dir_flag"
    fi
fi



if test "$MPI_WITH_PMPI" = "no" ; then
    # If the PMPI routines are not in the same library with the MPI
    # routines, we may need to remove the pmpi declarations
    
echo $ac_n "checking whether Fortran allows unused externals""... $ac_c" 1>&6
echo "configure:4987: checking whether Fortran allows unused externals" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_allows_unused_externals'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

cat > conftest.$ac_ext <<EOF
       program main
       external bar
       end
EOF
if { (eval echo configure:5003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_allows_unused_externals="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_prog_f77_allows_unused_externals="no"
  
fi
rm -f conftest*
#
ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross


fi

echo "$ac_t""$pac_cv_prog_f77_allows_unused_externals" 1>&6
if test "X$pac_cv_prog_f77_allows_unused_externals" = "Xyes" ; then
   MPIFPMPI=",PMPI_WTIME,PMPI_WTICK"
else
   
    MPIFPMPI=""; 
    echo "configure: warning: Removed PMPI_WTIME and PMPI_WTICK from mpif.h" 1>&2
fi

else
    MPIFPMPI=",PMPI_WTIME,PMPI_WTICK"
fi

echo $ac_n "checking whether Fortran has pointer declaration""... $ac_c" 1>&6
echo "configure:5037: checking whether Fortran has pointer declaration" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_has_pointer'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

cat > conftest.$ac_ext <<EOF
      program main

        integer M
        pointer (MPTR,M)
        data MPTR/0/

      end
EOF
if { (eval echo configure:5057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  pac_cv_prog_f77_has_pointer="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_prog_f77_has_pointer="no"
fi
rm -f conftest*
ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross


fi

echo "$ac_t""$pac_cv_prog_f77_has_pointer" 1>&6
if test "$pac_cv_prog_f77_has_pointer" = "yes" ; then
    f77_has_pointer=yes
else
    f77_has_pointer=no
fi

rm -f include/mpif_bottom.h
if test "$f77_has_pointer" = "yes" -a "$use_pointer_in_f77" = "yes" ; then
    cat >>include/mpif_bottom.h <<EOF
        pointer (MPI_BOTTOM_PTR,MPI_BOTTOM)
	pointer (MPI_STATUS_IG_PTR,MPI_STATUS_IGNORE)
	pointer (MPI_STATUSES_IG_PTR,MPI_STATUSES_IGNORE)
        data MPI_BOTTOM_PTR/0/, MPI_STATUS_IG_PTR/0/
	data MPI_STATUSES_IG_PTR/0/
EOF
    cat >> confdefs.h <<\EOF
#define USE_POINTER_FOR_BOTTOM 1
EOF

        else
    cat >>include/mpif_bottom.h <<EOF
      COMMON /MPIPRIV/ MPI_BOTTOM,MPI_STATUS_IGNORE,MPI_STATUSES_IGNORE
C
C     Without this save, some Fortran implementations may make the common
C     dynamic!
C    
C     For a Fortran90 module, we might replace /MPIPRIV/ with a simple
C     SAVE MPI_BOTTOM
C
      SAVE /MPIPRIV/
EOF
fi

CROSS_F77_SIZEOF_INTEGER=${CROSS_F77_SIZEOF_INTEGER:-0}
CROSS_F77_SIZEOF_REAL=${CROSS_F77_SIZEOF_REAL:-0}
CROSS_F77_SIZEOF_DOUBLE_PRECISION=${CROSS_F77_SIZEOF_PRECISION:-0}

echo $ac_n "checking for size of Fortran type integer""... $ac_c" 1>&6
echo "configure:5114: checking for size of Fortran type integer" >&5
if eval "test \"`echo '$''{'pac_cv_f77_sizeof_integer'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

rm -f conftest*
cat <<EOF > conftest.f
      subroutine isize( )
      integer i(2)
      call cisize( i(1), i(2) )
      end
EOF
if test "X$ac_fcompile" = "X" ; then
    ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&5'
fi
if { (eval echo configure:5130: \"$ac_fcompile\") 1>&5; (eval $ac_fcompile) 2>&5; } && test -s conftest.o ; then
    mv conftest.o conftestf.o
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    save_LIBS="$LIBS"
        LIBS="conftestf.o $FLIBS $LIBS"
    if test "$cross_compiling" = yes; then
  eval pac_cv_f77_sizeof_integer=$CROSS_F77_SIZEOF_INTEGER
else
  cat > conftest.$ac_ext <<EOF
#line 5146 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef F77_NAME_UPPER
#define cisize_ CISIZE
#define isize_ ISIZE
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
#define cisize_ cisize
#define isize_ isize
#endif
static int isize_val=0;
void cisize_(char *,char*);
void isize_(void);
void cisize_(char *i1p, char *i2p)
{ 
   isize_val = (int)(i2p - i1p);
}
int main(int argc, char **argv)
{
    FILE *f = fopen("conftestval", "w");
    if (!f) return 1;
    isize_();
    fprintf(f,"%d\n", isize_val );
    return 0;
}
EOF
if { (eval echo configure:5172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  eval pac_cv_f77_sizeof_integer=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  eval pac_cv_f77_sizeof_integer=0
fi
rm -fr conftest*
fi

    # Problem.  If the process fails to run, then there won't be
    # a good error message.  For example, with one Portland Group
    # installation, we had problems with finding the libpgc.so shared library
    # The autoconf code for TRY_RUN doesn't capture the output from
    # the test program (!)
    
    LIBS="$save_LIBS"
    ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

else 
    echo "configure: failed program was:" >&5
    cat conftest.f >&5
    eval pac_cv_f77_sizeof_integer=$CROSS_F77_SIZEOF_INTEGER
fi

fi

echo "$ac_t""$pac_cv_f77_sizeof_integer" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_F77_INTEGER $pac_cv_f77_sizeof_integer
EOF





echo $ac_n "checking for size of Fortran type real""... $ac_c" 1>&6
echo "configure:5214: checking for size of Fortran type real" >&5
if eval "test \"`echo '$''{'pac_cv_f77_sizeof_real'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

rm -f conftest*
cat <<EOF > conftest.f
      subroutine isize( )
      real i(2)
      call cisize( i(1), i(2) )
      end
EOF
if test "X$ac_fcompile" = "X" ; then
    ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&5'
fi
if { (eval echo configure:5230: \"$ac_fcompile\") 1>&5; (eval $ac_fcompile) 2>&5; } && test -s conftest.o ; then
    mv conftest.o conftestf.o
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    save_LIBS="$LIBS"
        LIBS="conftestf.o $FLIBS $LIBS"
    if test "$cross_compiling" = yes; then
  eval pac_cv_f77_sizeof_real=$CROSS_F77_SIZEOF_REAL
else
  cat > conftest.$ac_ext <<EOF
#line 5246 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef F77_NAME_UPPER
#define cisize_ CISIZE
#define isize_ ISIZE
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
#define cisize_ cisize
#define isize_ isize
#endif
static int isize_val=0;
void cisize_(char *,char*);
void isize_(void);
void cisize_(char *i1p, char *i2p)
{ 
   isize_val = (int)(i2p - i1p);
}
int main(int argc, char **argv)
{
    FILE *f = fopen("conftestval", "w");
    if (!f) return 1;
    isize_();
    fprintf(f,"%d\n", isize_val );
    return 0;
}
EOF
if { (eval echo configure:5272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  eval pac_cv_f77_sizeof_real=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  eval pac_cv_f77_sizeof_real=0
fi
rm -fr conftest*
fi

    # Problem.  If the process fails to run, then there won't be
    # a good error message.  For example, with one Portland Group
    # installation, we had problems with finding the libpgc.so shared library
    # The autoconf code for TRY_RUN doesn't capture the output from
    # the test program (!)
    
    LIBS="$save_LIBS"
    ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

else 
    echo "configure: failed program was:" >&5
    cat conftest.f >&5
    eval pac_cv_f77_sizeof_real=$CROSS_F77_SIZEOF_REAL
fi

fi

echo "$ac_t""$pac_cv_f77_sizeof_real" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_F77_REAL $pac_cv_f77_sizeof_real
EOF





echo $ac_n "checking for size of Fortran type double precision""... $ac_c" 1>&6
echo "configure:5314: checking for size of Fortran type double precision" >&5
if eval "test \"`echo '$''{'pac_cv_f77_sizeof_double_precision'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

rm -f conftest*
cat <<EOF > conftest.f
      subroutine isize( )
      double precision i(2)
      call cisize( i(1), i(2) )
      end
EOF
if test "X$ac_fcompile" = "X" ; then
    ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&5'
fi
if { (eval echo configure:5330: \"$ac_fcompile\") 1>&5; (eval $ac_fcompile) 2>&5; } && test -s conftest.o ; then
    mv conftest.o conftestf.o
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    save_LIBS="$LIBS"
        LIBS="conftestf.o $FLIBS $LIBS"
    if test "$cross_compiling" = yes; then
  eval pac_cv_f77_sizeof_double_precision=$CROSS_F77_SIZEOF_DOUBLE_PRECISION
else
  cat > conftest.$ac_ext <<EOF
#line 5346 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef F77_NAME_UPPER
#define cisize_ CISIZE
#define isize_ ISIZE
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
#define cisize_ cisize
#define isize_ isize
#endif
static int isize_val=0;
void cisize_(char *,char*);
void isize_(void);
void cisize_(char *i1p, char *i2p)
{ 
   isize_val = (int)(i2p - i1p);
}
int main(int argc, char **argv)
{
    FILE *f = fopen("conftestval", "w");
    if (!f) return 1;
    isize_();
    fprintf(f,"%d\n", isize_val );
    return 0;
}
EOF
if { (eval echo configure:5372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  eval pac_cv_f77_sizeof_double_precision=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  eval pac_cv_f77_sizeof_double_precision=0
fi
rm -fr conftest*
fi

    # Problem.  If the process fails to run, then there won't be
    # a good error message.  For example, with one Portland Group
    # installation, we had problems with finding the libpgc.so shared library
    # The autoconf code for TRY_RUN doesn't capture the output from
    # the test program (!)
    
    LIBS="$save_LIBS"
    ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

else 
    echo "configure: failed program was:" >&5
    cat conftest.f >&5
    eval pac_cv_f77_sizeof_double_precision=$CROSS_F77_SIZEOF_DOUBLE_PRECISION
fi

fi

echo "$ac_t""$pac_cv_f77_sizeof_double_precision" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_F77_DOUBLE_PRECISION $pac_cv_f77_sizeof_double_precision
EOF




# If we have sizes for real and double, we do not need to call mpir_get_fsize
# at run time.
#
cat > conftest.$ac_ext <<EOF
      program main
      integer*1 i
      end
EOF
if { (eval echo configure:5420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_integer_1=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_integer_1=0
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
      program main
      integer*2 i
      end
EOF
if { (eval echo configure:5435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_integer_2=2
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_integer_2=0
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
      program main
      integer*4 i
      end
EOF
if { (eval echo configure:5450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_integer_4=4
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_integer_4=0
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
      program main
      integer*8 i
      end
EOF
if { (eval echo configure:5465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_integer_8=8
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_integer_8=0
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
      program main
      integer*16 i
      end
EOF
if { (eval echo configure:5480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_integer_16=16
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_integer_16=0
fi
rm -f conftest*

cat > conftest.$ac_ext <<EOF
      program main
      real*4 a
      end
EOF
if { (eval echo configure:5496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_real_4=4
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_real_4=0
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
      program main
      real*8 a
      end
EOF
if { (eval echo configure:5511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_real_8=8
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_real_8=0
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
      program main
      real*16 a
      end
EOF
if { (eval echo configure:5526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_real_16=16
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_real_16=0
fi
rm -f conftest*


# Compare the sizes of these types to the C types

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross


echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:5549: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5554 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_cv_header_stdc=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 5579 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 5597 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 5618 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

EOF
if { (eval echo configure:5629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_header_stdc=no
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
  cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

fi

for ac_hdr in stdlib.h string.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:5656: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
pac_found_header=no
if test "$CPP" != "/lib/cpp" ; then
    cat > conftest.$ac_ext <<EOF
#line 5664 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  pac_found_header=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
# If cpp failed, see if the compiler accepts the header.
if test "$pac_found_header" != "yes" ; then
    cat >conftest.c<<EOF
#line 5684 "configure"
#include "confdefs.h"
#include <$ac_hdr>
int conftest() {return 0;}
EOF
    ac_compile_for_cpp='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
    if { (eval echo configure:5690: \"$ac_compile_for_cpp\") 1>&5; (eval $ac_compile_for_cpp) 2>&5; }; then
	pac_found_header=yes
    else
        echo "configure: failed program was:" >&5
        cat conftest.c >&5
    fi
    rm -f conftest*
fi
# Finally, set the ac variable.
if test "$pac_found_header" = "yes" ; then
    eval "ac_cv_header_$ac_safe=yes"
else
    eval "ac_cv_header_$ac_safe=no"
fi

fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

# Current bug: this is needed for mpi.h, which should eventually remove
#   the ifdef test on USE_STDARG 
# It is also used in the definition of MPIR_Err_setmsg.

ac_safe=`echo "stdarg.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for stdarg.h""... $ac_c" 1>&6
echo "configure:5724: checking for stdarg.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
pac_found_header=no
if test "$CPP" != "/lib/cpp" ; then
    cat > conftest.$ac_ext <<EOF
#line 5732 "configure"
#include "confdefs.h"
#include <stdarg.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  pac_found_header=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
# If cpp failed, see if the compiler accepts the header.
if test "$pac_found_header" != "yes" ; then
    cat >conftest.c<<EOF
#line 5752 "configure"
#include "confdefs.h"
#include <stdarg.h>
int conftest() {return 0;}
EOF
    ac_compile_for_cpp='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
    if { (eval echo configure:5758: \"$ac_compile_for_cpp\") 1>&5; (eval $ac_compile_for_cpp) 2>&5; }; then
	pac_found_header=yes
    else
        echo "configure: failed program was:" >&5
        cat conftest.c >&5
    fi
    rm -f conftest*
fi
# Finally, set the ac variable.
if test "$pac_found_header" = "yes" ; then
    eval "ac_cv_header_$ac_safe=yes"
else
    eval "ac_cv_header_$ac_safe=no"
fi

fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

if test "$ac_cv_header_stdarg_h" = "yes" ; then
        echo $ac_n "checking whether stdarg is oldstyle""... $ac_c" 1>&6
echo "configure:5783: checking whether stdarg is oldstyle" >&5
if eval "test \"`echo '$''{'pac_cv_header_stdarg_oldstyle'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

pac_check_compile=2
if test -z "$pac_TRY_COMPLILE_CLEAN" ; then
    rm -f conftest*
    echo 'int try(void);int try(void){return 0;}' > conftest.c
    if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then
	if test -s conftest.bas ; then 
	    pac_TRY_COMPILE_CLEAN_OUT=`cat conftest.bas`
        fi
        pac_TRY_COMPILE_CLEAN=1
    else
	echo "configure: warning: Could not compile simple test program!" 1>&2
	if test -s conftest.bas ; then 	cat conftest.bas >> config.log ; fi
    fi
fi
rm -f conftest*
cat >conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
#include <stdarg.h>
int func( int a, ... ){
int b;
va_list ap;
va_start( ap );
b = va_arg(ap, int);
printf( "%d-%d\n", a, b );
va_end(ap);
fflush(stdout);
return 0;
}
int main() { func( 1, 2 ); return 0;}
EOF
if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then
        if test "$pac_TRY_COMPILE_CLEAN_OUT" = "`cat conftest.bas`" ; then
	pac_check_compile=0
    else
        cat conftest.c >>config.log
	if test -s conftest.bas ; then 	cat conftest.bas >> config.log ; fi
        pac_check_compile=1
    fi
else
        cat conftest.c >>config.log
    if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi
    pac_check_compile=2
fi
rm -f conftest*

case "$pac_check_compile" in 
    0)  pac_cv_header_stdarg_oldstyle="yes"
	;;
    1)  pac_cv_header_stdarg_oldstyle="may be newstyle"
	;;
    2)  pac_cv_header_stdarg_oldstyle="no"   # compile failed
	;;
esac

fi

echo "$ac_t""$pac_cv_header_stdarg_oldstyle" 1>&6
if test "$pac_cv_header_stdarg_oldstyle" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define USE_OLDSTYLE_STDARG 1
EOF

else
    echo $ac_n "checking whether stdarg works""... $ac_c" 1>&6
echo "configure:5854: checking whether stdarg works" >&5
if eval "test \"`echo '$''{'pac_cv_header_stdarg_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
pac_check_compile=2
if test -z "$pac_TRY_COMPLILE_CLEAN" ; then
    rm -f conftest*
    echo 'int try(void);int try(void){return 0;}' > conftest.c
    if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then
	if test -s conftest.bas ; then 
	    pac_TRY_COMPILE_CLEAN_OUT=`cat conftest.bas`
        fi
        pac_TRY_COMPILE_CLEAN=1
    else
	echo "configure: warning: Could not compile simple test program!" 1>&2
	if test -s conftest.bas ; then 	cat conftest.bas >> config.log ; fi
    fi
fi
rm -f conftest*
cat >conftest.c <<EOF
#include "confdefs.h"

#include <stdio.h>
#include <stdarg.h>

int func( int a, ... ){
int b;
va_list ap;
va_start( ap, a );
b = va_arg(ap, int);
printf( "%d-%d\n", a, b );
va_end(ap);
fflush(stdout);
return 0;
}
int main() { func( 1, 2 ); return 0;}
EOF
if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then
        if test "$pac_TRY_COMPILE_CLEAN_OUT" = "`cat conftest.bas`" ; then
	pac_check_compile=0
    else
        cat conftest.c >>config.log
	if test -s conftest.bas ; then 	cat conftest.bas >> config.log ; fi
        pac_check_compile=1
    fi
else
        cat conftest.c >>config.log
    if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi
    pac_check_compile=2
fi
rm -f conftest*

case "$pac_check_compile" in 
    0)  pac_cv_header_stdarg_works="yes"
	;;
    1)  pac_cv_header_stdarg_works="yes with warnings"
	;;
    2)  pac_cv_header_stdarg_works="no"
	;;
esac

fi

echo "$ac_t""$pac_cv_header_stdarg_works" 1>&6
fi   # test on oldstyle
if test "$pac_cv_header_stdarg_works" = "no" ; then
    :
else
    cat >> confdefs.h <<\EOF
#define USE_STDARG 1
EOF

fi
else 
    :
fi  # test on header


# Get defaults for cross compilation case
CROSS_SIZEOF_CHAR=${CROSS_SIZEOF_CHAR:-0}
CROSS_SIZEOF_SHORT=${CROSS_SIZEOF_SHORT:-0}
CROSS_SIZEOF_INT=${CROSS_SIZEOF_INT:-0}
CROSS_SIZEOF_LONG=${CROSS_SIZEOF_LONG:-0}
CROSS_SIZEOF_LONG_LONG=${CROSS_SIZEOF_LONG_LONG:-0}
CROSS_SIZEOF_FLOAT=${CROSS_SIZEOF_FLOAT:-0}
CROSS_SIZEOF_DOUBLE=${CROSS_SIZEOF_DOUBLE:-0}
CROSS_SIZEOF_LONG_DOUBLE=${CROSS_SIZEOF_LONG_DOUBLE:-0}
CROSS_SIZEOF_VOID_P=${CROSS_SIZEOF_VOID_P:-0}
CROSS_OFFSET_KIND=${CROSS_OFFSET_KIND:-0}
CROSS_ADDRESS_KIND=${CROSS_ADDRESS_KIND:-0}

echo $ac_n "checking size of char""... $ac_c" 1>&6
echo "configure:5948: checking size of char" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_char=$CROSS_SIZEOF_CHAR
else
  cat > conftest.$ac_ext <<EOF
#line 5956 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(char));
  exit(0);
}
EOF
if { (eval echo configure:5967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_char=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_char=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_char" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
EOF


echo $ac_n "checking size of short""... $ac_c" 1>&6
echo "configure:5987: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_short=$CROSS_SIZEOF_SHORT
else
  cat > conftest.$ac_ext <<EOF
#line 5995 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(short));
  exit(0);
}
EOF
if { (eval echo configure:6006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_short=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_short=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_short" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_SHORT $ac_cv_sizeof_short
EOF


echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:6026: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int=$CROSS_SIZEOF_INT
else
  cat > conftest.$ac_ext <<EOF
#line 6034 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:6045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT $ac_cv_sizeof_int
EOF


echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:6065: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long=$CROSS_SIZEOF_LONG
else
  cat > conftest.$ac_ext <<EOF
#line 6073 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:6084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG $ac_cv_sizeof_long
EOF


echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:6104: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long_long=$CROSS_SIZEOF_LONG_LONG
else
  cat > conftest.$ac_ext <<EOF
#line 6112 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long long));
  exit(0);
}
EOF
if { (eval echo configure:6123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
EOF


echo $ac_n "checking size of float""... $ac_c" 1>&6
echo "configure:6143: checking size of float" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_float=$CROSS_SIZEOF_FLOAT
else
  cat > conftest.$ac_ext <<EOF
#line 6151 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(float));
  exit(0);
}
EOF
if { (eval echo configure:6162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_float=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_float=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_float" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_FLOAT $ac_cv_sizeof_float
EOF


echo $ac_n "checking size of double""... $ac_c" 1>&6
echo "configure:6182: checking size of double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_double=$CROSS_SIZEOF_DOUBLE
else
  cat > conftest.$ac_ext <<EOF
#line 6190 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(double));
  exit(0);
}
EOF
if { (eval echo configure:6201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_double=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_double=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_double" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_DOUBLE $ac_cv_sizeof_double
EOF


echo $ac_n "checking size of long double""... $ac_c" 1>&6
echo "configure:6221: checking size of long double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long_double=$CROSS_SIZEOF_LONG_DOUBLE
else
  cat > conftest.$ac_ext <<EOF
#line 6229 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long double));
  exit(0);
}
EOF
if { (eval echo configure:6240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long_double=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long_double=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long_double" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
EOF


# sizeof(void*) is needed for ADDRESS_KIND below
echo $ac_n "checking size of void*""... $ac_c" 1>&6
echo "configure:6261: checking size of void*" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_voidp=$CROSS_SIZEOF_VOID_P
else
  cat > conftest.$ac_ext <<EOF
#line 6269 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(void*));
  exit(0);
}
EOF
if { (eval echo configure:6280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_voidp=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_voidp=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_voidp" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_VOIDP $ac_cv_sizeof_voidp
EOF



#
# Preload the C mpi types
# THESE MUST MATCH THE DEFINITIONS IN MPI.H and MPIF.H
char_mpi=1
short_mpi=4
int_mpi=6
long_mpi=8
long_long_mpi=13
float_mpi=10
double_mpi=11
long_double_mpi=12
# Warning: float_cplx is Fortran COMPLEX, not (float,float)
float_cplx_mpi=23
# Warning: double_cplx is Fortran DOUBLE COMPLEX, not (double,double)
double_cplx_mpi=24
long_double_cplx_mpi=0

for len in 1 2 4 8 16 ; do
    eval F77_INT$len=0
    #eval testval=\$"pac_cv_f77_sizeof_integer_$len"
    eval testval=\$"has_integer_$len"
    if test "$testval" = 0 ; then continue ; fi
    noval="yes"
    echo $ac_n "checking for C type matching Fortran integer*$len""... $ac_c" 1>&6
echo "configure:6324: checking for C type matching Fortran integer*$len" >&5
    for c_type in char short int long "long_long" ; do
	eval ctypelen=\$"ac_cv_sizeof_$c_type"
	if test "$testval" = "$ctypelen" -a "$ctypelen" -gt 0 ; then
	    echo "$ac_t""$c_type" 1>&6
	    eval F77_INT$len=\$"${c_type}_mpi"
	    noval="no"
	    break
        fi
    done
    if test "$noval" = "yes" ; then
        echo "$ac_t""unavailable" 1>&6
    fi
done

for len in 4 8 16 ; do
    len2=`expr $len + $len`
    eval F77_REAL$len=0
    eval F77_COMPLEX$len2=0
    #eval testval=\$"pac_cv_f77_sizeof_real_$len"
    eval testval=\$"has_real_$len"
    if test "$testval" = 0 ; then continue ; fi
    noval="yes"
    echo $ac_n "checking for C type matching Fortran real*$len""... $ac_c" 1>&6
echo "configure:6348: checking for C type matching Fortran real*$len" >&5
    for c_type in float double "long_double" ; do
	eval ctypelen=\$"ac_cv_sizeof_$c_type"
	if test "$testval" = "$ctypelen" -a "$ctypelen" -gt 0 ; then
	    echo "$ac_t""$c_type" 1>&6
	    eval F77_REAL$len=\$"${c_type}_mpi"
	    eval F77_COMPLEX$len2=\$"${c_type}_cplx_mpi"
            noval="no"
	    break
        fi
    done
    if test "$noval" = "yes" ; then
        echo "$ac_t""unavailable" 1>&6
    fi
done












noval="yes"
echo $ac_n "checking for C type matching Fortran integer""... $ac_c" 1>&6
echo "configure:6377: checking for C type matching Fortran integer" >&5
for c_type in char short int long "long_long" ; do
    eval ctypelen=\$"ac_cv_sizeof_$c_type"
    if test "$pac_cv_f77_sizeof_integer" = "$ctypelen" -a \
       "$ctypelen" -gt 0 ; then
	c_type=`echo $c_type | sed -e 's/_/ /g'`
	echo "$ac_t""$c_type" 1>&6
	MPI_FINT_TYPE=$c_type
	noval="no"
	break
    fi
done
if test "$noval" = "yes" ; then
    # Set a default
    MPI_FINT_TYPE="int"
    echo "$ac_t""unavailable" 1>&6
    cat >> confdefs.h <<\EOF
#define FINT_TYPE_UNKNOWN 
EOF

fi

if test "$MPI_FINT_TYPE" = "int" ; then
    cat >> confdefs.h <<\EOF
#define FINT_IS_INT 1
EOF

fi


echo $ac_n "checking whether C compiler allows unaligned doubles""... $ac_c" 1>&6
echo "configure:6408: checking whether C compiler allows unaligned doubles" >&5
if eval "test \"`echo '$''{'pac_cv_prog_c_unaligned_doubles'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  pac_cv_prog_c_unaligned_doubles="unknown"
else
  cat > conftest.$ac_ext <<EOF
#line 6417 "configure"
#include "confdefs.h"

void fetch_double( v )
double *v;
{
*v = 1.0;
}
int main( argc, argv )
int argc;
char **argv;
{
int p[4];
double *p_val;
fetch_double( (double *)&(p[0]) );
p_val = (double *)&(p[0]);
if (*p_val != 1.0) return 1;
fetch_double( (double *)&(p[1]) );
p_val = (double *)&(p[1]);
if (*p_val != 1.0) return 1;
return 0;
}

EOF
if { (eval echo configure:6441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  pac_cv_prog_c_unaligned_doubles="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  pac_cv_prog_c_unaligned_doubles="no"
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$pac_cv_prog_c_unaligned_doubles" 1>&6

if test "X$pac_cv_prog_c_unaligned_doubles" = "no" ; then 
echo "configure: warning: Your C compiler $CC does not support unaligned accesses
to doubles.  This is required for interoperation with 
Fortran (the Fortran standard requires it)." 1>&2
fi



if test "$enable_weak" = "yes" ; then
    
pragma_extra_message=""
echo $ac_n "checking for type of weak symbol support""... $ac_c" 1>&6
echo "configure:6469: checking for type of weak symbol support" >&5
if eval "test \"`echo '$''{'pac_cv_prog_c_weak_symbols'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
# Test for weak symbol support...
# We can't put # in the message because it causes autoconf to generate
# incorrect code
cat > conftest.$ac_ext <<EOF
#line 6478 "configure"
#include "confdefs.h"

extern int PFoo(int);
#pragma weak PFoo = Foo
int Foo(int a) { return a; }

int main() {
return PFoo(1);
; return 0; }
EOF
if { (eval echo configure:6489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  has_pragma_weak=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
#
# Some systems (Linux ia64 and ecc, for example), support weak symbols
# only within a single object file!  This tests that case.
# Note that there is an extern int PFoo declaration before the
# pragma.  Some compilers require this in order to make the weak symbol
# extenally visible.  
if test "$has_pragma_weak" = yes ; then
    rm -f conftest*
    cat >>conftest1.c <<EOF
extern int PFoo(int);
#pragma weak PFoo = Foo
int Foo(int);
int Foo(int a) { return a; }
EOF
    cat >>conftest2.c <<EOF
extern int PFoo(int);
int main(int argc, char **argv) {
return PFoo(0);}
EOF
    ac_link2='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest1.c conftest2.c $LIBS >conftest.out 2>&1'
    if eval $ac_link2 ; then
        pac_cv_prog_c_weak_symbols="pragma weak"
    else
      echo "$ac_link2" >>config.log
      echo "Failed program was" >>config.log
      cat conftest1.c >>config.log
      cat conftest2.c >>config.log
      if test -s conftest.out ; then cat conftest.out >> config.log ; fi
      has_pragma_weak=0
      pragma_extra_message="pragma weak does not work outside of a file"
    fi
    rm -f conftest*
fi
if test -z "$pac_cv_prog_c_weak_symbols" ; then 
    cat > conftest.$ac_ext <<EOF
#line 6532 "configure"
#include "confdefs.h"

extern int PFoo(int);
#pragma _HP_SECONDARY_DEF Foo  PFoo
int Foo(int a) { return a; }

int main() {
return PFoo(1);
; return 0; }
EOF
if { (eval echo configure:6543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_c_weak_symbols="pragma _HP_SECONDARY_DEF"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
if test -z "$pac_cv_prog_c_weak_symbols" ; then
    cat > conftest.$ac_ext <<EOF
#line 6554 "configure"
#include "confdefs.h"

extern int PFoo(int);
#pragma _CRI duplicate PFoo as Foo
int Foo(int a) { return a; }

int main() {
return PFoo(1);
; return 0; }
EOF
if { (eval echo configure:6565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_c_weak_symbols="pragma _CRI duplicate x as y"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
if test -z "$pac_cv_prog_c_weak_symbols" ; then
    pac_cv_prog_c_weak_symbols="no"
fi
if test -n "$pragma_extra_message" ; then
    echo $pragma_extra_message
fi

fi

echo "$ac_t""$pac_cv_prog_c_weak_symbols" 1>&6
if test "$pac_cv_prog_c_weak_symbols" = "no" ; then
    :
else
    case "$pac_cv_prog_c_weak_symbols" in
	"pragma weak") cat >> confdefs.h <<\EOF
#define HAVE_PRAGMA_WEAK 1
EOF
 
	;;
	"pragma _HP")  cat >> confdefs.h <<\EOF
#define HAVE_PRAGMA_HP_SEC_DEF 1
EOF

	;;
	"pragma _CRI") cat >> confdefs.h <<\EOF
#define HAVE_PRAGMA_CRI_DUP 1
EOF

	;;
    esac
    cat >> confdefs.h <<\EOF
#define HAVE_WEAK_SYMBOLS 1
EOF

fi
echo $ac_n "checking whether __attribute__ ((weak)) allowed""... $ac_c" 1>&6
echo "configure:6610: checking whether __attribute__ ((weak)) allowed" >&5
if eval "test \"`echo '$''{'pac_cv_attr_weak'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 6616 "configure"
#include "confdefs.h"
int foo(int) __attribute__ ((weak));
int main() {
int a;
; return 0; }
EOF
if { (eval echo configure:6623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  pac_cv_attr_weak=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_attr_weak=no
fi
rm -f conftest*
fi

echo "$ac_t""$pac_cv_attr_weak" 1>&6

fi

#
# Try to get values for Fortran logical variables.
if test "$cross_compiling" = "no" ; then
    echo $ac_n "checking for values of Fortran logicals""... $ac_c" 1>&6
echo "configure:6643: checking for values of Fortran logicals" >&5
    if eval "test \"`echo '$''{'pac_cv_prog_f77_true_false_value'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
rm -f conftest*
cat <<EOF > conftest.f

        subroutine ftest( itrue, ifalse )
        logical itrue, ifalse
        itrue  = .TRUE.
        ifalse = .FALSE.
        return
        end

EOF
if test "X$ac_fcompile" = "X" ; then
    ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&5'
fi
if { (eval echo configure:6663: \"$ac_fcompile\") 1>&5; (eval $ac_fcompile) 2>&5; } && test -s conftest.o ; then
    mv conftest.o conftestf.o
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    save_LIBS="$LIBS"
    LIBS="conftestf.o $FLIBS $LIBS"
    if test "$cross_compiling" = yes; then
  : 
else
  cat > conftest.$ac_ext <<EOF
#line 6679 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef F77_NAME_UPPER
#define ftest_ FTEST
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
#define ftest_ ftest
#endif

#include <stdio.h>
int main()
{
    $MPI_FINT_TYPE itrue, ifalse;
    FILE *f = fopen("conftestval", "w" );
    if (!f) exit(1);
    ftest_( &itrue, &ifalse );
    fprintf( f, "%d %d\n", itrue, ifalse );
    exit(0);
}


EOF
if { (eval echo configure:6701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
    pac_cv_prog_f77_true_false_value=`cat conftestval`

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -fr conftest*
fi

    LIBS="$save_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

else 
    echo "configure: failed program was:" >&5
    cat conftest.f >&5
fi
rm -f conftest*

fi

    true_val="`echo $pac_cv_prog_f77_true_false_value | sed -e 's/ .*//g'`"
    false_val="`echo $pac_cv_prog_f77_true_false_value | sed -e 's/.*  *//g'`"
    if test -n "$true_val" -a -n "$false_val" ; then
        cat >> confdefs.h <<\EOF
#define F77_TRUE_VALUE_SET 1
EOF

        cat >> confdefs.h <<EOF
#define F77_TRUE_VALUE $true_val
EOF

        cat >> confdefs.h <<EOF
#define F77_FALSE_VALUE $false_val
EOF

	echo "$ac_t""True is $true_val and False is $false_val" 1>&6
    else
	echo "$ac_t""could not determine" 1>&6
    fi
fi


pac_save_level=`expr $pac_save_level - 1`
if test "X$pac_save_level" = "X0" ; then
    CC="$pac_save_CC"
    CXX="$pac_save_CXX"
    F77="$pac_save_F77"
    F90="$pac_save_F90"
    CPP="$pac_save_CPP"
    ac_cv_prog_cc_cross="$pac_save_prog_cc_cross"
    ac_cv_prog_f77_cross="$pac_save_prog_f77_cross"
    ac_cv_prog_cxx_cross="$pac_save_prog_cxx_cross"
    pac_cv_prog_f90_cross="$pac_save_prog_f90_cross"
    pac_save_level=""
fi


if test "$pac_lib_mpi_is_building" = "yes" ; then
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    FARGOBJ="farg.o"
    cat >> confdefs.h <<\EOF
#define HAS_MPIR_ERR_SETMSG 1
EOF

else
    # Test for mpir_iargc; if not found, add farg.f.in
    echo $ac_n "checking for mpir_iargc provided for command line in Fortran""... $ac_c" 1>&6
echo "configure:6782: checking for mpir_iargc provided for command line in Fortran" >&5
    ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

    cat > conftest.$ac_ext <<EOF

      program main
      mpir_iargc()
      end
EOF
if { (eval echo configure:6794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  found="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  found="no"
fi
rm -f conftest*
    if test "$found" = "no" ; then
        echo "$ac_t""no" 1>&6
        
if test "X$pac_save_level" = "X" ; then
    pac_save_CC="$CC"
    pac_save_CXX="$CXX"
    pac_save_F77="$F77"
    pac_save_F90="$F90"
    pac_save_prog_cc_cross="$ac_cv_prog_cc_cross"
    pac_save_prog_f77_cross="$ac_cv_prog_f77_cross"
    pac_save_prog_cxx_cross="$ac_cv_prog_cxx_cross"
    pac_save_prog_f90_cross="$pac_cv_prog_f90_cross"
    if test "X$CPP" = "X" ; then
	echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:6818: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 6833 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 6850 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:6867: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross
  CXXCPP="${CXX-g++} -E"
  cat > conftest.$ac_ext <<EOF
#line 6880 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6885: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CXXCPP=/lib/cpp
fi
rm -f conftest*
  ac_cv_prog_CXXCPP="$CXXCPP"
ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross
fi
fi
CXXCPP="$ac_cv_prog_CXXCPP"
echo "$ac_t""$CXXCPP" 1>&6
s%@CXXCPP@%$CXXCPP%g

cat > conftest.$ac_ext <<EOF
#line 6909 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

    fi
    pac_save_CPP="$CPP"
    CC="${TESTCC:=$CC}"
    CXX="${TESTCXX:=$CXX}"
    F77="${TESTF77:=$F77}"
    F90="${TESTF90:=$F90}"
    if test -z "$TESTCPP" ; then
        
if test -z "$TESTCPP"; then
  if eval "test \"`echo '$''{'pac_cv_prog_TESTCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  rm -f conftest.*
  cat > conftest.c <<EOF
  #include <assert.h>
  Syntax Error
EOF
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  TESTCPP="${TESTCC-cc} -E"
  ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
  if { (eval echo configure:6961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
      pac_cv_prog_TESTCPP="$TESTCPP"
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      TESTCPP="${TESTCC-cc} -E -traditional-cpp"
      ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
      if { (eval echo configure:6967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
          pac_cv_prog_TESTCPP="$TESTCPP"
      fi
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      TESTCPP="${TESTCC-cc} -nologo -E"
      ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
      if { (eval echo configure:6974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
          pac_cv_prog_TESTCPP="$TESTCPP"
      fi
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      # Extract the first word of "cpp", so it can be a program name with args.
set dummy cpp; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:6982: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TESTCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$TESTCPP" in
  /*)
  ac_cv_path_TESTCPP="$TESTCPP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_TESTCPP="$TESTCPP" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_TESTCPP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
TESTCPP="$ac_cv_path_TESTCPP"
if test -n "$TESTCPP"; then
  echo "$ac_t""$TESTCPP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi
  rm -f conftest.*
  
fi

else
  pac_cv_prog_TESTCPP="$TESTCPP"
fi

    fi
    CPP="${TESTCPP:=$CPP}"
    pac_save_level="0"
    # Recompute cross_compiling values and set for the current language
    # This is just:
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_cross_compiling" = "yes" ; then
        ac_cv_prog_cc_cross=yes
	ac_cv_prog_cc_works=yes
    else
        cat > conftest.$ac_ext << EOF

#line 7042 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:7047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
    fi
    ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

    # Ignore Fortran if we aren't using it.
    if test -n "$F77" ; then
        
        ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

	if test "$pac_cross_compiling" = "yes" ; then
	    ac_cv_prog_f77_cross=yes
	    ac_cv_prog_f77_works=yes
	else
            cat > conftest.$ac_ext << EOF

      program conftest
      end

EOF
if { (eval echo configure:7085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_f77_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_f77_cross=no
  else
    ac_cv_prog_f77_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_f77_works=no
fi
rm -fr conftest*
	fi
        ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

    fi
    # Ignore C++ if we aren't using it.
    if test -n "$CXX" ; then
        
        ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

        cat > conftest.$ac_ext << EOF

#line 7118 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:7123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
        ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

    fi
    # Ignore Fortran 90 if we aren't using it.
    if test -n "$F90" ; then
        
        
ac_ext=$pac_cv_f90_ext
ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&5'
ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$pac_cv_prog_f90_cross

	        	if test "$pac_cross_compiling" = "yes" ; then
	    ac_cv_prog_f90_cross=yes
	    ac_cv_prog_f90_works=yes
	else
            cat > conftest.$ac_ext << EOF
      program conftest
      end
EOF
            if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
              ac_cv_prog_f90_works=yes
              # If we can't run a trivial program, we are probably using a cross compiler.
              if (./conftest; exit) 2>/dev/null; then
                  ac_cv_prog_f90_cross=no
              else
                  ac_cv_prog_f90_cross=yes
              fi
            else
              echo "configure: failed program was:" >&5
              cat conftest.$ac_ext >&5
              ac_cv_prog_f90_works=no
            fi
	fi
	pac_cv_prog_f90_cross="$ac_cv_prog_f90_cross"
	pac_cv_prog_f90_works="$ac_cv_prog_f90_works"
        rm -fr conftest*
        ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

    fi
fi
pac_save_level=`expr $pac_save_level + 1`

        
found_cached="yes"
echo $ac_n "checking for routines to access the command line from Fortran 77""... $ac_c" 1>&6
echo "configure:7189: checking for routines to access the command line from Fortran 77" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_cmdarg'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    echo "$ac_t""searching..." 1>&6
    found_cached="no"
    # First, we perform a quick check.  Does iargc and getarg work?
    fxx_module="${FXX_MODULE:-}"
    f77_getargdecl="${F77_GETARGDECL:-external getarg}"
    f77_getarg="${F77_GETARG:-call GETARG(i,s)}"
    f77_iargc="${F77_IARGC:-IARGC()}"
    #    
    # Grumble.  The Absoft Fortran compiler computes i - i as 0 and then
    # 1.0 / 0 at compile time, even though the code may never be executed.
    # What we need is a way to generate an error, so the second usage of i
    # was replaced with f77_iargc.  
    cat > conftest.f <<EOF
        program main
$fxx_module
        integer i, j
        character*20 s
        $f77_getargdecl
        i = 0
        $f77_getarg
        i=$f77_iargc
        if (i .gt. 1) then
            j = i - $f77_iargc
            j = 1.0 / j
        endif
        end
EOF
    found_answer="no"
    if test -z "$ac_fcompilelink" ; then
        ac_fcompilelink="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $LIBS 1>&5"
    fi
    echo $ac_n "checking whether ${F77-f77} $flags $libs works with GETARG and IARGC""... $ac_c" 1>&6
echo "configure:7226: checking whether ${F77-f77} $flags $libs works with GETARG and IARGC" >&5
    if { (eval echo configure:7227: \"$ac_fcompilelink\") 1>&5; (eval $ac_fcompilelink) 2>&5; } && test -x conftest ; then
	# Check that cross != yes so that this works with autoconf 2.52
	if test "$ac_cv_prog_f77_cross" != "yes" ; then
	    if ./conftest >/dev/null 2>&1 ; then
		found_answer="yes"
	        FXX_MODULE="$fxx_module"
		F77_GETARGDECL="$f77_getargdecl"
		F77_GETARG="$f77_getarg"
		F77_IARGC="$f77_iargc"
		echo "$ac_t""yes" 1>&6
     	    fi
        fi
    fi    
    if test $found_answer = "no" ; then
	echo "$ac_t""no" 1>&6
    # Grumph.  Here are a bunch of different approaches
    # We have several axes the check:
    # Library to link with (none, -lU77 (HPUX), -lg2c (LINUX f77))
    # PEPCF90 (Intel ifc)
    # The first line is a dummy
    # (we experimented with using a <space>, but this caused other 
    # problems because we need <space> in the IFS)
    trial_LIBS="0 -lU77 -lPEPCF90"
    if test "$NOG2C" != "1" ; then
        trial_LIBS="$trial_LIBS -lg2c"
    fi
    # Discard libs that are not availble:
    save_IFS="$IFS"
    # Make sure that IFS includes a space, or the tests that run programs
    # may fail
    IFS=" 
"
    save_trial_LIBS="$trial_LIBS"
    trial_LIBS=""
    cat > conftest.f <<EOF
        program main
        end
EOF
    ac_fcompilelink_test='${F77-f77} -o conftest $FFLAGS conftest.f $LDFLAGS $libs $LIBS 1>&5'
    for libs in $save_trial_LIBS ; do
	if test "$libs" = "0" ; then
	    lib_ok="yes"
        else
	    echo $ac_n "checking whether Fortran 77 links with $libs""... $ac_c" 1>&6
echo "configure:7271: checking whether Fortran 77 links with $libs" >&5
	    if { (eval echo configure:7272: \"$ac_fcompilelink_test\") 1>&5; (eval $ac_fcompilelink_test) 2>&5; } && test -x conftest ; then
		echo "$ac_t""yes" 1>&6
	        lib_ok="yes"
	    else
		echo "$ac_t""no" 1>&6
	        lib_ok="no"
	    fi
	fi
	if test "$lib_ok" = "yes" ; then
	    trial_LIBS="$trial_LIBS
$libs"
        fi
    done

    # Options to use when compiling and linking
    # +U77 is needed by HP Fortran to access getarg etc.
    # The -N109 was used for getarg before we realized that GETARG
    # was necessary with the (non standard conforming) Absoft compiler
    # (Fortran is monocase; Absoft uses mixedcase by default)
    # The -f is used by Absoft and is the compiler switch that folds 
    # symbolic names to lower case.  Without this option, the compiler
    # considers upper- and lower-case letters to be unique.
    # The -YEXT_NAMES=LCS will cause external names to be output as lower
    # case letter for Absoft F90 compilers (default is upper case)
    # The first line is "<space><newline>, the space is important
    # To make the Absoft f77 and f90 work together, we need to prefer the
    # upper case versions of the arguments.  They also require libU77.
    # -YCFRL=1 causes Absoft f90 to work with g77 and similar (f2c-based) 
    # Fortran compilers
    #
    # Problem:  The Intel efc compiler hangs when presented with -N109 .
    # The only real fix for this is to detect this compiler and exclude
    # the test.  We may want to reorganize these tests so that if we
    # can compile code without special options, we never look for them.
    # 
    using_intel_efc="no"
    pac_test_msg=`$F77 -V 2>&1 | grep 'Intel(R) Fortran Itanium'`
    if test "$pac_test_msg" != "" ; then
	using_intel_efc="yes"
    fi
    if test "$using_intel_efc" = "yes" ; then
        trial_FLAGS="000"
    else
        trial_FLAGS="000
-N109
-f
-YEXT_NAMES=UCS
-YEXT_NAMES=LCS
-YCFRL=1
+U77"
    fi
    # Discard options that are not available:
    # (IFS already saved above)
    IFS=" 
"
    save_trial_FLAGS="$trial_FLAGS"
    trial_FLAGS=""
    for flag in $save_trial_FLAGS ; do
	if test "$flag" = " " -o "$flag" = "000" ; then
	    opt_ok="yes"
        else
            
echo $ac_n "checking whether Fortran 77 compiler accepts option $flag""... $ac_c" 1>&6
echo "configure:7335: checking whether Fortran 77 compiler accepts option $flag" >&5
ac_result="no"
save_FFLAGS="$FFLAGS"
FFLAGS="$flag $FFLAGS"
rm -f conftest.out
cat >conftest2.f <<EOF
        subroutine try()
        end
EOF
cat >conftest.f <<EOF
        program main
        end
EOF
ac_fscompilelink='${F77-f77} $save_FFLAGS -o conftest conftest.f $LDFLAGS >conftest.bas 2>&1'
ac_fscompilelink2='${F77-f77} $FFLAGS -o conftest conftest.f $LDFLAGS >conftest.out 2>&1'
if { (eval echo configure:7350: \"$ac_fscompilelink\") 1>&5; (eval $ac_fscompilelink) 2>&5; } && test -x conftest ; then
   if { (eval echo configure:7351: \"$ac_fscompilelink2\") 1>&5; (eval $ac_fscompilelink2) 2>&5; } && test -x conftest ; then
      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
         echo "$ac_t""yes" 1>&6
         echo $ac_n "checking whether routines compiled with $flag can be linked with ones compiled  without $flag""... $ac_c" 1>&6
echo "configure:7355: checking whether routines compiled with $flag can be linked with ones compiled  without $flag" >&5       
         rm -f conftest2.out
         rm -f conftest.bas
	 ac_fscompile3='${F77-f77} -c $save_FFLAGS conftest2.f >conftest2.out 2>&1'
	 ac_fscompilelink4='${F77-f77} $FFLAGS -o conftest conftest2.o conftest.f $LDFLAGS >conftest.bas 2>&1'
         if { (eval echo configure:7360: \"$ac_fscompile3\") 1>&5; (eval $ac_fscompile3) 2>&5; } && test -s conftest2.o ; then
            if { (eval echo configure:7361: \"$ac_fscompilelink4\") 1>&5; (eval $ac_fscompilelink4) 2>&5; } && test -x conftest ; then
               if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
	          ac_result="yes"
	       else 
		  echo "configure: Compiler output differed in two cases" >&5
                  diff -b conftest.out conftest.bas >&5
	       fi
	    else
	       echo "configure: failed program was:" >&5
	       cat conftest.f >&5
	    fi
	  else
	    echo "configure: failed program was:" >&5
	    cat conftest2.f >&5
	  fi
      else
	# diff
        echo "configure: Compiler output differed in two cases" >&5
        diff -b conftest.out conftest.bas >&5
      fi
   else
      # try_eval(fscompilelink2)
      echo "configure: failed program was:" >&5
      cat conftest.f >&5
   fi
   if test "$ac_result" != "yes" -a -s conftest.out ; then
	cat conftest.out >&5
   fi
else
    # Could not compile without the option!
    echo "configure: Could not compile program" >&5
    cat conftest.f >&5
    cat conftest.bas >&5
fi
if test "$ac_result" = "yes" ; then
     echo "$ac_t""yes" 1>&6	  
     opt_ok=yes
else
     echo "$ac_t""no" 1>&6
     opt_ok=no
fi
FFLAGS="$save_FFLAGS"
rm -f conftest*

        fi
	if test "$opt_ok" = "yes" ; then
	    if test "$flag" = " " -o "$flag" = "000" ; then 
		fflag="" 
	    else 
		fflag="$flag" 
	    fi
	    # discard options that don't allow mixed-case name matching
	    cat > conftest.f <<EOF
        program main
        call aB()
        end
        subroutine Ab()
        end
EOF
	    if test -n "$fflag" ; then flagval="with $fflag" ; else flagval="" ; fi
	    echo $ac_n "checking whether Fortran 77 routine names are case-insensitive $flagval""... $ac_c" 1>&6
echo "configure:7422: checking whether Fortran 77 routine names are case-insensitive $flagval" >&5
	                            ac_fcompilelink_test="${F77-f77} -o conftest $fflag $FFLAGS conftest.f $LDFLAGS $LIBS 1>&5"
	    if { (eval echo configure:7424: \"$ac_fcompilelink_test\") 1>&5; (eval $ac_fcompilelink_test) 2>&5; } && test -x conftest ; then
	        echo "$ac_t""yes" 1>&6
	    else
	        echo "$ac_t""no" 1>&6
	        opt_ok="no"
            fi
        fi
        if test "$opt_ok" = "yes" ; then
	    trial_FLAGS="$trial_FLAGS
$flag"
        fi
    done
    IFS="$save_IFS"
    # Name of routines.  Since these are in groups, we use a case statement
    # and loop until the end (accomplished by reaching the end of the
    # case statement
    # For one version of Nag F90, the names are 
    # call f90_unix_MP_getarg(i,s) and f90_unix_MP_iargc().
    trial=0
    while test -z "$pac_cv_prog_f77_cmdarg" ; do
        case $trial in 
	0) # User-specified values, if any
	   if test -z "$F77_GETARG" -o -z "$F77_IARGC" ; then 
	       trial=`expr $trial + 1`
	       continue 
           fi
           MSG="Using environment values of F77_GETARG etc."
	   ;;
	1) # Standard practice, uppercase (some compilers are case-sensitive)
	   FXX_MODULE=""
	   F77_GETARGDECL="external GETARG"
	   F77_GETARG="call GETARG(i,s)"
	   F77_IARGC="IARGC()"
	   MSG="GETARG and IARGC"
	   ;;
	2) # Standard practice, lowercase
	   FXX_MODULE=""
           F77_GETARGDECL="external getarg"
	   F77_GETARG="call getarg(i,s)"
	   F77_IARGC="iargc()"
	   MSG="getarg and iargc"
	   ;;
	3) # Posix alternative
	   FXX_MODULE=""
	   F77_GETARGDECL="external pxfgetarg"
	   F77_GETARG="call pxfgetarg(i,s,l,ier)"
	   F77_IARGC="ipxfargc()"
	   MSG="pxfgetarg and ipxfargc"
	   ;;
	4) # Nag f90_unix_env module
	   FXX_MODULE="        use f90_unix_env"
	   F77_GETARGDECL=""
	   F77_GETARG="call getarg(i,s)"
	   F77_IARGC="iargc()"
	   MSG="f90_unix_env module"
	   ;;
        5) # Nag f90_unix module
	   FXX_MODULE="        use f90_unix"
	   F77_GETARGDECL=""
	   F77_GETARG="call getarg(i,s)"
	   F77_IARGC="iargc()"
	   MSG="f90_unix module"
	   ;;
	6) # user spec in a file
	   if test -s f77argdef ; then
		. ./f77argdef
	       MSG="Using definitions in the file f77argdef"
	   else
	        trial=`expr $trial + 1`
		continue
	   fi
	   ;;
        *) # exit from while loop
	   FXX_MODULE=""
	   F77_GETARGDECL=""
	   F77_GETARG=""
	   F77_IARGC=""
           break
	   ;;
	esac
	# Create the program.  Make sure that we can run it.
	# Force a divide-by-zero if there is a problem (but only at runtime!
        # (the Absoft compiler does divide-by-zero at compile time)
        cat > conftest.f <<EOF
        program main
$FXX_MODULE
        integer i, j
        character*20 s
        $F77_GETARGDECL
        i = 0
        $F77_GETARG
        i=$F77_IARGC
        if (i .gt. 1) then
            j = i - $F77_IARGC
            j = 1.0 / j
        endif
        end
EOF
    #
    # Now, try to find some way to compile and link that program, looping 
    # over the possibilities of options and libraries
        save_IFS="$IFS"
        IFS=" 
"
        for libs in $trial_LIBS ; do
            if test -n "$pac_cv_prog_f77_cmdarg" ; then break ; fi
	    if test "$libs" = " " -o "$libs" = "0" ; then libs="" ; fi
            for flags in $trial_FLAGS ; do
	        if test "$flags" = " " -o "$flags" = "000"; then flags="" ; fi
                echo $ac_n "checking whether ${F77-f77} $flags $libs works with $MSG""... $ac_c" 1>&6
echo "configure:7534: checking whether ${F77-f77} $flags $libs works with $MSG" >&5
		IFS="$save_IFS"
			        ac_fcompilelink_test="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $libs $LIBS 1>&5"
		found_answer="no"
                if { (eval echo configure:7538: \"$ac_fcompilelink_test\") 1>&5; (eval $ac_fcompilelink_test) 2>&5; } && test -x conftest ; then
		    if test "$ac_cv_prog_f77_cross" != "yes" ; then
			if ./conftest >/dev/null 2>&1 ; then
			    found_answer="yes"
			fi
		    else 
			found_answer="yes"
		    fi
                fi
	        IFS=" 
"
		if test "$found_answer" = "yes" ; then
	            echo "$ac_t""yes" 1>&6
		    pac_cv_prog_f77_cmdarg="$MSG"
		    pac_cv_prog_f77_cmdarg_fflags="$flags"
		    pac_cv_prog_f77_cmdarg_ldflags="$libs"
		    break
	        else
                    echo "$ac_t""no" 1>&6
		    echo "configure: failed program was:" >&5
                    cat conftest.f >&5
	        fi
            done
        done
        IFS="$save_IFS"   
	rm -f conftest.*
        trial=`expr $trial + 1`   
    done
fi
pac_cv_F77_GETARGDECL="$F77_GETARGDECL"
pac_cv_F77_IARGC="$F77_IARGC"
pac_cv_F77_GETARG="$F77_GETARG"
pac_cv_FXX_MODULE="$FXX_MODULE"

fi

if test "$found_cached" = "yes" ; then 
    echo "$ac_t""$pac_cv_prog_f77_cmdarg" 1>&6
elif test -z "$pac_cv_F77_IARGC" ; then
    echo "configure: warning: Could not find a way to access the command line from Fortran 77" 1>&2
fi
# Set the variable values based on pac_cv_prog_xxx
F77_GETARGDECL="$pac_cv_F77_GETARGDECL"
F77_IARGC="$pac_cv_F77_IARGC"
F77_GETARG="$pac_cv_F77_GETARG"
FXX_MODULE="$pac_cv_FXX_MODULE"
F77_GETARG_FFLAGS="$pac_cv_prog_f77_cmdarg_fflags"
F77_GETARG_LDFLAGS="$pac_cv_prog_f77_cmdarg_ldflags"







        
pac_save_level=`expr $pac_save_level - 1`
if test "X$pac_save_level" = "X0" ; then
    CC="$pac_save_CC"
    CXX="$pac_save_CXX"
    F77="$pac_save_F77"
    F90="$pac_save_F90"
    CPP="$pac_save_CPP"
    ac_cv_prog_cc_cross="$pac_save_prog_cc_cross"
    ac_cv_prog_f77_cross="$pac_save_prog_f77_cross"
    ac_cv_prog_cxx_cross="$pac_save_prog_cxx_cross"
    pac_cv_prog_f90_cross="$pac_save_prog_f90_cross"
    pac_save_level=""
fi

        FARGOBJ="farg.o"
    else
        echo "$ac_t""yes" 1>&6
        FARGOBJ=""
    fi
    # Test for MPICH error handling routine
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    echo $ac_n "checking for MPIR_Err_setmsg""... $ac_c" 1>&6
echo "configure:7622: checking for MPIR_Err_setmsg" >&5
if eval "test \"`echo '$''{'ac_cv_func_MPIR_Err_setmsg'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7627 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char MPIR_Err_setmsg(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char MPIR_Err_setmsg();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_MPIR_Err_setmsg) || defined (__stub___MPIR_Err_setmsg)
choke me
#else
MPIR_Err_setmsg();
#endif

; return 0; }
EOF
if { (eval echo configure:7650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_MPIR_Err_setmsg=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_MPIR_Err_setmsg=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'MPIR_Err_setmsg`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

fi


# If the system is Cray or Cray-like, then we need to handle character
# data in a special way.  This code does that.
if test "$target_os" = "CRAY" ; then
    # If tested code does NOT compile, then define _TWO_WORD_FCD
    echo $ac_n "checking whether TWO_WORD_FCDs are used""... $ac_c" 1>&6
echo "configure:7677: checking whether TWO_WORD_FCDs are used" >&5
    cat > conftest.$ac_ext <<EOF
#line 7679 "configure"
#include "confdefs.h"
#include <fortran.h>
int main() {
void  *buf;_fcd temp;temp = _fcdtocp(buf);
; return 0; }
EOF
if { (eval echo configure:7686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  compile_check=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  compile_check=no
fi
rm -f conftest*
    echo "$ac_t""$compile_check" 1>&6
    if test "$compile_check" = "no" ; then
        TEMP_CFLAGS=$CFLAGS
        CFLAGS="-D_TWO_WORD_FCD $CFLAGS"
        echo $ac_n "checking whether program compiles if _TWO_WORD_FCD is defined ""... $ac_c" 1>&6
echo "configure:7701: checking whether program compiles if _TWO_WORD_FCD is defined " >&5
        cat > conftest.$ac_ext <<EOF
#line 7703 "configure"
#include "confdefs.h"
#include <fortran.h>
int main() {
void  *buf;_fcd temp;temp = _fcdtocp(buf);
; return 0; }
EOF
if { (eval echo configure:7710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  compile_check=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  compile_check=no
fi
rm -f conftest*
        echo "$ac_t""$compile_check" 1>&6
        if test "$compile_check" = "no" ; then
	    echo "configure: warning: You may have problems compiling the Fortran interface
specifically calls to  _fcdtocp" 1>&2
        elif test "$compile_check" = "yes" ; then
            cat >> confdefs.h <<\EOF
#define _TWO_WORD_FCD 1
EOF

        fi
        CFLAGS=$TEMP_CFLAGS
    fi
fi

if test -n "$arch_UXPM" -o -n "$arch_uxpv" ; then
    # This asserts that Fortran passes functions by passing the address of the
    # pointer to the function.
    # We really need a TEST for this
    cat >> confdefs.h <<\EOF
#define FORTRAN_SPECIAL_FUNCTION_PTR 1
EOF

    # Suggested values for these are
                fi

#
# For Fortran 90, we'll also need MPI_ADDRESS_KIND and MPI_OFFSET_KIND
# Since our compiler might BE a Fortran 90 compiler, try and determine the
# values.  
F90="${F90-$F77}"

if test "X$pac_save_level" = "X" ; then
    pac_save_CC="$CC"
    pac_save_CXX="$CXX"
    pac_save_F77="$F77"
    pac_save_F90="$F90"
    pac_save_prog_cc_cross="$ac_cv_prog_cc_cross"
    pac_save_prog_f77_cross="$ac_cv_prog_f77_cross"
    pac_save_prog_cxx_cross="$ac_cv_prog_cxx_cross"
    pac_save_prog_f90_cross="$pac_cv_prog_f90_cross"
    if test "X$CPP" = "X" ; then
	echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:7762: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 7777 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 7794 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 7811 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

    fi
    pac_save_CPP="$CPP"
    CC="${TESTCC:=$CC}"
    CXX="${TESTCXX:=$CXX}"
    F77="${TESTF77:=$F77}"
    F90="${TESTF90:=$F90}"
    if test -z "$TESTCPP" ; then
        
if test -z "$TESTCPP"; then
  if eval "test \"`echo '$''{'pac_cv_prog_TESTCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  rm -f conftest.*
  cat > conftest.c <<EOF
  #include <assert.h>
  Syntax Error
EOF
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  TESTCPP="${TESTCC-cc} -E"
  ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
  if { (eval echo configure:7863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
      pac_cv_prog_TESTCPP="$TESTCPP"
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      TESTCPP="${TESTCC-cc} -E -traditional-cpp"
      ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
      if { (eval echo configure:7869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
          pac_cv_prog_TESTCPP="$TESTCPP"
      fi
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      TESTCPP="${TESTCC-cc} -nologo -E"
      ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
      if { (eval echo configure:7876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then
          pac_cv_prog_TESTCPP="$TESTCPP"
      fi
  fi
  if test "X$pac_cv_prog_TESTCPP" = "X" ; then
      # Extract the first word of "cpp", so it can be a program name with args.
set dummy cpp; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7884: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TESTCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$TESTCPP" in
  /*)
  ac_cv_path_TESTCPP="$TESTCPP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_TESTCPP="$TESTCPP" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_TESTCPP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
TESTCPP="$ac_cv_path_TESTCPP"
if test -n "$TESTCPP"; then
  echo "$ac_t""$TESTCPP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi
  rm -f conftest.*
  
fi

else
  pac_cv_prog_TESTCPP="$TESTCPP"
fi

    fi
    CPP="${TESTCPP:=$CPP}"
    pac_save_level="0"
    # Recompute cross_compiling values and set for the current language
    # This is just:
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_cross_compiling" = "yes" ; then
        ac_cv_prog_cc_cross=yes
	ac_cv_prog_cc_works=yes
    else
        cat > conftest.$ac_ext << EOF

#line 7944 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:7949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
    fi
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    # Ignore Fortran if we aren't using it.
    if test -n "$F77" ; then
        
        ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

	if test "$pac_cross_compiling" = "yes" ; then
	    ac_cv_prog_f77_cross=yes
	    ac_cv_prog_f77_works=yes
	else
            cat > conftest.$ac_ext << EOF

      program conftest
      end

EOF
if { (eval echo configure:7989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_f77_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_f77_cross=no
  else
    ac_cv_prog_f77_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_f77_works=no
fi
rm -fr conftest*
	fi
        ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    fi
    # Ignore C++ if we aren't using it.
    if test -n "$CXX" ; then
        
        ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

        cat > conftest.$ac_ext << EOF

#line 8024 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:8029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
        ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    fi
    # Ignore Fortran 90 if we aren't using it.
    if test -n "$F90" ; then
        
        
ac_ext=$pac_cv_f90_ext
ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&5'
ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$pac_cv_prog_f90_cross

	        	if test "$pac_cross_compiling" = "yes" ; then
	    ac_cv_prog_f90_cross=yes
	    ac_cv_prog_f90_works=yes
	else
            cat > conftest.$ac_ext << EOF
      program conftest
      end
EOF
            if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
              ac_cv_prog_f90_works=yes
              # If we can't run a trivial program, we are probably using a cross compiler.
              if (./conftest; exit) 2>/dev/null; then
                  ac_cv_prog_f90_cross=no
              else
                  ac_cv_prog_f90_cross=yes
              fi
            else
              echo "configure: failed program was:" >&5
              cat conftest.$ac_ext >&5
              ac_cv_prog_f90_works=no
            fi
	fi
	pac_cv_prog_f90_cross="$ac_cv_prog_f90_cross"
	pac_cv_prog_f90_works="$ac_cv_prog_f90_works"
        rm -fr conftest*
        ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    fi
fi
pac_save_level=`expr $pac_save_level + 1`


ac_ext=$pac_cv_f90_ext
ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&5'
ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$pac_cv_prog_f90_cross

# Offset kind should be for 8 bytes if possible (Romio prefers that)
# address should be sizeof void *
testsize=$ac_cv_sizeof_voidp
if test "$testsize" = 0 ; then
    # Set a default
    testsize=4
fi

# Set the default
ADDRESS_KIND=-1
if test "$pac_cv_prog_f90_cross" = "yes" ; then
    ADDRESS_KIND="$CROSS_ADDRESS_KIND"
else
if test -n "$ac_f90compile" ; then
    echo $ac_n "checking for Fortran 90 integer kind for ${testsize}-byte integers""... $ac_c" 1>&6
echo "configure:8117: checking for Fortran 90 integer kind for ${testsize}-byte integers" >&5
    # Convert bytes to digits
    case ${testsize} in 
	1) sellen=2 ;;
	2) sellen=4 ;;
	4) sellen=8 ;;
	8) sellen=16 ;;
       16) sellen=30 ;;
	*) sellen=8 ;;
    esac
    # Check for cached value
    eval testval=\$"pac_cv_prog_f90_int_kind_$sellen"
    if test -n "$testval" ; then 
        echo "$ac_t""$testval (cached)" 1>&6
	ADDRESS_KIND=$testval
    else
        # must compute
        rm -f conftest*
        cat <<EOF > conftest.$ac_f90ext
      program main
      integer i
      i = selected_int_kind($sellen)
      open(8, file="conftest1.out", form="formatted")
      write (8,*) i
      close(8)
      stop
      end
EOF
        KINDVAL="unavailable"
        eval "pac_cv_prog_f90_int_kind_$sellen"=-1
        if { (eval echo configure:8147: \"$ac_f90link\") 1>&5; (eval $ac_f90link) 2>&5; } && test -s conftest ; then
            ./conftest 1>&5 2>&1
            if test -s conftest1.out ; then
	        # Because of write, there may be a leading blank.
                KINDVAL=`cat conftest1.out | sed 's/ //g'`
 	        eval "pac_cv_prog_f90_int_kind_$sellen"=$KINDVAL
	        ADDRESS_KIND=$KINDVAL
            fi
        fi
        rm -f conftest*
	# The intel compiler sometimes generates these work.pc and .pcl files
	rm -f work.pc work.pcl
	echo "$ac_t""$KINDVAL" 1>&6
    fi # not cached
fi # Has Fortran 90
fi # is not cross compiling

if test "$ac_cv_sizeof_void_p" = 8 ; then
    OFFSET_KIND=$ADDRESS_KIND
else
    
# Set the default
OFFSET_KIND=-1
if test "$pac_cv_prog_f90_cross" = "yes" ; then
    OFFSET_KIND="$CROSS_OFFSET_KIND"
else
if test -n "$ac_f90compile" ; then
    echo $ac_n "checking for Fortran 90 integer kind for 8-byte integers""... $ac_c" 1>&6
echo "configure:8175: checking for Fortran 90 integer kind for 8-byte integers" >&5
    # Convert bytes to digits
    case 8 in 
	1) sellen=2 ;;
	2) sellen=4 ;;
	4) sellen=8 ;;
	8) sellen=16 ;;
       16) sellen=30 ;;
	*) sellen=8 ;;
    esac
    # Check for cached value
    eval testval=\$"pac_cv_prog_f90_int_kind_$sellen"
    if test -n "$testval" ; then 
        echo "$ac_t""$testval (cached)" 1>&6
	OFFSET_KIND=$testval
    else
        # must compute
        rm -f conftest*
        cat <<EOF > conftest.$ac_f90ext
      program main
      integer i
      i = selected_int_kind($sellen)
      open(8, file="conftest1.out", form="formatted")
      write (8,*) i
      close(8)
      stop
      end
EOF
        KINDVAL="unavailable"
        eval "pac_cv_prog_f90_int_kind_$sellen"=-1
        if { (eval echo configure:8205: \"$ac_f90link\") 1>&5; (eval $ac_f90link) 2>&5; } && test -s conftest ; then
            ./conftest 1>&5 2>&1
            if test -s conftest1.out ; then
	        # Because of write, there may be a leading blank.
                KINDVAL=`cat conftest1.out | sed 's/ //g'`
 	        eval "pac_cv_prog_f90_int_kind_$sellen"=$KINDVAL
	        OFFSET_KIND=$KINDVAL
            fi
        fi
        rm -f conftest*
	# The intel compiler sometimes generates these work.pc and .pcl files
	rm -f work.pc work.pcl
	echo "$ac_t""$KINDVAL" 1>&6
    fi # not cached
fi # Has Fortran 90
fi # is not cross compiling

fi
#
# Some compilers won't allow a -1 kind (e.g., absoft), others won't 
# allow a 0 (Intel?).  In this case, use a fallback (sizeof(int) kind),
# which is correct for many but not all Fortran 90 compilers (the NAG
# F90 compiler uses consequetive integers, i.e., 1,2,3)
if test "$ADDRESS_KIND" = "-1" -o "$OFFSET_KIND" = "-1" -o \
        "$ADDRESS_KIND" = "0" -o "$OFFSET_KIND" = "0" ; then
    
# Set the default
simpleintkind=-1
if test "$pac_cv_prog_f90_cross" = "yes" ; then
    simpleintkind=""
else
if test -n "$ac_f90compile" ; then
    echo $ac_n "checking for Fortran 90 integer kind for ${pac_cv_f77_sizeof_integer}-byte integers""... $ac_c" 1>&6
echo "configure:8238: checking for Fortran 90 integer kind for ${pac_cv_f77_sizeof_integer}-byte integers" >&5
    # Convert bytes to digits
    case ${pac_cv_f77_sizeof_integer} in 
	1) sellen=2 ;;
	2) sellen=4 ;;
	4) sellen=8 ;;
	8) sellen=16 ;;
       16) sellen=30 ;;
	*) sellen=8 ;;
    esac
    # Check for cached value
    eval testval=\$"pac_cv_prog_f90_int_kind_$sellen"
    if test -n "$testval" ; then 
        echo "$ac_t""$testval (cached)" 1>&6
	simpleintkind=$testval
    else
        # must compute
        rm -f conftest*
        cat <<EOF > conftest.$ac_f90ext
      program main
      integer i
      i = selected_int_kind($sellen)
      open(8, file="conftest1.out", form="formatted")
      write (8,*) i
      close(8)
      stop
      end
EOF
        KINDVAL="unavailable"
        eval "pac_cv_prog_f90_int_kind_$sellen"=-1
        if { (eval echo configure:8268: \"$ac_f90link\") 1>&5; (eval $ac_f90link) 2>&5; } && test -s conftest ; then
            ./conftest 1>&5 2>&1
            if test -s conftest1.out ; then
	        # Because of write, there may be a leading blank.
                KINDVAL=`cat conftest1.out | sed 's/ //g'`
 	        eval "pac_cv_prog_f90_int_kind_$sellen"=$KINDVAL
	        simpleintkind=$KINDVAL
            fi
        fi
        rm -f conftest*
	# The intel compiler sometimes generates these work.pc and .pcl files
	rm -f work.pc work.pcl
	echo "$ac_t""$KINDVAL" 1>&6
    fi # not cached
fi # Has Fortran 90
fi # is not cross compiling

    if test "$simpleintkind" = "-1" ; then
	# Wild guess; probably means that Fortran 90 is not available
	simpleintkind=4
	echo "configure: warning: Unable to determine the size of a simple integer" 1>&2
    fi
    if test "$ADDRESS_KIND" = "-1" -o "$ADDRESS_KIND" = "0" ; then
        echo "configure: warning: Using $simpleintkind for the Fortran 90 KIND of an MPI_Aint" 1>&2
	ADDRESS_KIND=$simpleintkind
    fi
    if test "$OFFSET_KIND" = "-1" -o "$OFFSET_KIND" = "0" ; then
        echo "configure: warning: Using $simpleintkind for the Fortran 90 KIND of an MPI_Offset" 1>&2
	OFFSET_KIND=$simpleintkind
    fi
fi

pac_save_level=`expr $pac_save_level - 1`
if test "X$pac_save_level" = "X0" ; then
    CC="$pac_save_CC"
    CXX="$pac_save_CXX"
    F77="$pac_save_F77"
    F90="$pac_save_F90"
    CPP="$pac_save_CPP"
    ac_cv_prog_cc_cross="$pac_save_prog_cc_cross"
    ac_cv_prog_f77_cross="$pac_save_prog_f77_cross"
    ac_cv_prog_cxx_cross="$pac_save_prog_cxx_cross"
    pac_cv_prog_f90_cross="$pac_save_prog_f90_cross"
    pac_save_level=""
fi





if test -n "$F90" -a "$enable_f90" != "no" ; then
    F90_SUFFIX="$ac_f90ext"
    # For now, top_srcdir_val is MPIR_HOME; 
    # The build dir is relative at ../..
    top_srcdir_val="$MPIR_HOME"
    if test "$do_f90_modules" = "yes" -a -n "$top_srcdir_val" ; then
        echo "Setting up F90 Module support"
	if test ! -d ../../f90modules ; then mkdir ../../f90modules ; fi
	# if we're the developers, we may need to create the
	# initial configure files.
	if test ! -x $top_srcdir_val/f90modules/configure -a \
	          -s $top_srcdir_val/f90modules/configure.in -a \
		  -x $top_srcdir_val/f90modules/makeconfigure ; then
	    (cd $top_srcdir_val/f90modules ; ./makeconfigure)
	fi
	# Should F90LINKER be F90TESTLINKER?
        (cd ../../f90modules ; \
	            export F90 ; export MPIR_HOME ; export VPATH ; \
	   	    export libbuild_dir ; export includebuild_dir ; \
		    export MAKE ; F90LINKER="$F90LINKER" ; \
		    export F90LINKER ; export F77 ; \
 	   	    $top_srcdir_val/f90modules/configure --with-mpich)
        if test ! -s ../../f90modules/Makefile ; then 
	    # turn off f90
	    F90=""
	else		    
 	    F90_MODINCFLAG="`$MAKE -f ../../f90modules/Makefile f90modflag`"
  	    F90MODINCSPEC="`$MAKE -f ../../f90modules/Makefile f90modspec`"
            if test -z "$USER_SET_F90INC" -a -z "$F90INC" ; then 
	        # This should use a test or try to get it from the f90module.
	        F90INC=`$MAKE -f ../../f90modules/Makefile f90incflag`
            fi
        fi
    fi
else 
     # Remove the f90modules/Makefile since this is the only way
     # to tell the top-level makefile not to build the f90 modules.
     # (We need a better way)
     rm -f ../../f90modules/Makefile
fi

f90includedir='${includedir}'
f90libdir='${libdir}'









if test -z "$F90_LIBDIR_LEADER" ; then 
    F90_LIBDIR_LEADER="-L"
fi


echo $ac_n "checking whether using gcc and g77 together""... $ac_c" 1>&6
echo "configure:8376: checking whether using gcc and g77 together" >&5
if test "$ac_cv_prog_gcc" = "yes" -a "$ac_cv_prog_g77" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define USE_GCC_G77_DECLS 1
EOF

    echo "$ac_t""yes" 1>&6
else 
    echo "$ac_t""no" 1>&6
fi







trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs.  It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already.  You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  *ac_space=\ *)
    # `set' does not quote correctly, so add quotes (double-quote substitution
    # turns \\\\ into \\, and sed turns \\ into \).
    sed -n \
      -e "s/'/'\\\\''/g" \
      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
    ;;
  *)
    # `set' quotes correctly as required by POSIX, so do not add quotes.
    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
    ;;
  esac >> confcache
if cmp -s $cache_file confcache; then
  :
else
  if test -w $cache_file; then
    echo "updating cache $cache_file"
    cat confcache > $cache_file
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15

DEFS=-DHAVE_CONFIG_H

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir

trap 'rm -fr `echo "Makefile src/Makefile src/farg.f \
	  include/mpif.h include/mpi_fortdefs.h src/mpif77 src/mpif77.conf \
	  src/mpif90 src/mpif90.conf src/initfcmn.f src/initfdte.f  mpi_fortconf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@HAVE_MPID_FORTDEFS_H@%$HAVE_MPID_FORTDEFS_H%g
s%@COPTIONS@%$COPTIONS%g
s%@FLIBNAME@%$FLIBNAME%g
s%@FWRAPNAME@%$FWRAPNAME%g
s%@hasMPE@%$hasMPE%g
s%@OPTFLAGS@%$OPTFLAGS%g
s%@OPTFLAGSF@%$OPTFLAGSF%g
s%@MPI_STATUS_SIZE@%$MPI_STATUS_SIZE%g
s%@f77includedir@%$f77includedir%g
s%@f77libdir@%$f77libdir%g
s%@f77bindir@%$f77bindir%g
s%@subname@%$subname%g
s%@libbuild_dir@%$libbuild_dir%g
s%@FORTRAN_INITOBJ@%$FORTRAN_INITOBJ%g
s%@INCLUDES@%$INCLUDES%g
s%@MPIVERSION@%$MPIVERSION%g
s%@CC@%$CC%g
s%@F77@%$F77%g
s%@FOPTIONS@%$FOPTIONS%g
s%@FLINKER@%$FLINKER%g
s%@F90@%$F90%g
s%@F90LINKER@%$F90LINKER%g
s%@CXX@%$CXX%g
s%@MPICC@%$MPICC%g
s%@MPIF77@%$MPIF77%g
s%@MPIF90@%$MPIF90%g
s%@MPICXX@%$MPICXX%g
s%@MPIRUN@%$MPIRUN%g
s%@MPIBOOT@%$MPIBOOT%g
s%@MPIUNBOOT@%$MPIUNBOOT%g
s%@MAKE@%$MAKE%g
s%@VPATH@%$VPATH%g
s%@SET_CFLAGS@%$SET_CFLAGS%g
s%@SET_MAKE@%$SET_MAKE%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@F77LINKER@%$F77LINKER%g
s%@CPP@%$CPP%g
s%@MPILIBNAME@%$MPILIBNAME%g
s%@LIB_PATH@%$LIB_PATH%g
s%@BASE_LIB_LIST@%$BASE_LIB_LIST%g
s%@HASMPE@%$HASMPE%g
s%@F77_LDFLAGS@%$F77_LDFLAGS%g
s%@BASE_FFLAGS@%$BASE_FFLAGS%g
s%@includebuild_dir@%$includebuild_dir%g
s%@MPI_WITH_PMPI@%$MPI_WITH_PMPI%g
s%@SHAREDKIND@%$SHAREDKIND%g
s%@SHARED_LIB_SEARCH_PATH_LEADER@%$SHARED_LIB_SEARCH_PATH_LEADER%g
s%@SHARED_LIB_LOCALDIR@%$SHARED_LIB_LOCALDIR%g
s%@sharedlibbuild_dir@%$sharedlibbuild_dir%g
s%@sharedlib_dir@%$sharedlib_dir%g
s%@MPI2_OBJECTS@%$MPI2_OBJECTS%g
s%@TESTCPP@%$TESTCPP%g
s%@F77_GETARGDECL@%$F77_GETARGDECL%g
s%@F77_IARGC@%$F77_IARGC%g
s%@F77_GETARG@%$F77_GETARG%g
s%@FXX_MODULE@%$FXX_MODULE%g
s%@F77_GETARG_FFLAGS@%$F77_GETARG_FFLAGS%g
s%@F77_GETARG_LDFLAGS@%$F77_GETARG_LDFLAGS%g
s%@F90_GETARG_FFLAGS@%$F90_GETARG_FFLAGS%g
s%@F90_GETARG_LDFLAGS@%$F90_GETARG_LDFLAGS%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@FLIBS@%$FLIBS%g
s%@F77_NAME_MANGLE@%$F77_NAME_MANGLE%g
s%@F77_IN_C_LIBS@%$F77_IN_C_LIBS%g
s%@CHARDECL@%$CHARDECL%g
s%@F77_INCDIR@%$F77_INCDIR%g
s%@FINCLUDES@%$FINCLUDES%g
s%@F77_LIBDIR_LEADER@%$F77_LIBDIR_LEADER%g
s%@MPIFPMPI@%$MPIFPMPI%g
s%@F77_INT1@%$F77_INT1%g
s%@F77_INT2@%$F77_INT2%g
s%@F77_INT4@%$F77_INT4%g
s%@F77_INT8@%$F77_INT8%g
s%@F77_INT16@%$F77_INT16%g
s%@F77_REAL4@%$F77_REAL4%g
s%@F77_REAL8@%$F77_REAL8%g
s%@F77_REAL16@%$F77_REAL16%g
s%@F77_COMPLEX8@%$F77_COMPLEX8%g
s%@F77_COMPLEX16@%$F77_COMPLEX16%g
s%@F77_COMPLEX32@%$F77_COMPLEX32%g
s%@MPI_FINT_TYPE@%$MPI_FINT_TYPE%g
s%@FARGOBJ@%$FARGOBJ%g
s%@ADDRESS_KIND@%$ADDRESS_KIND%g
s%@OFFSET_KIND@%$OFFSET_KIND%g
s%@F90_SUFFIX@%$F90_SUFFIX%g
s%@f90includedir@%$f90includedir%g
s%@f90libdir@%$f90libdir%g
s%@F90_LDFLAGS@%$F90_LDFLAGS%g
s%@F90INC@%$F90INC%g
s%@F90_MODINCFLAG@%$F90_MODINCFLAG%g
s%@F90MODINCSPEC@%$F90MODINCSPEC%g
s%@F90FLAGS@%$F90FLAGS%g
s%@F90LIB_PATH@%$F90LIB_PATH%g
s%@F90_LIBDIR_LEADER@%$F90_LIBDIR_LEADER%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
  if test $ac_beg -gt 1; then
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi
EOF

cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile src/farg.f \
	  include/mpif.h include/mpi_fortdefs.h src/mpif77 src/mpif77.conf \
	  src/mpif90 src/mpif90.conf src/initfcmn.f src/initfdte.f "}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac


  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="mpi_fortconf.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  cat $ac_file_inputs > conftest.in

EOF

# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h.  And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr

# This sed command replaces #undef with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.

rm -f conftest.tail
while :
do
  ac_lines=`grep -c . conftest.vals`
  # grep -c gives empty output for an empty file on some AIX systems.
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  # Write a limited-size here document to conftest.frag.
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  echo 'CEOF
  sed -f conftest.frag conftest.in > conftest.out
  rm -f conftest.in
  mv conftest.out conftest.in
' >> $CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  rm -f conftest.vals
  mv conftest.tail conftest.vals
done
rm -f conftest.vals

cat >> $CONFIG_STATUS <<\EOF
  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done

EOF
cat >> $CONFIG_STATUS <<EOF



has_exclaim=$has_exclaim



EOF
cat >> $CONFIG_STATUS <<\EOF
if test "$enable_echo" ; then set -x ; fi 
if test -f ../../romio/include/mpiof.h -a "$ROMIO" = 1 ; then \
  sed -e '/MPI_OFFSET_KIND/d' ../../romio/include/mpiof.h | \
  cat include/mpif.h - > mpif-tmp.h ; \
  rm -f $includebuild_dir/mpif.h ; \
  mv mpif-tmp.h include/mpif.h ; fi
rm -f .tmp ; 
cat include/mpif.h include/mpif_bottom.h > .tmp ;
rm -f include/mpif.h ; mv .tmp include/mpif.h

if test "$has_exclaim" = "yes" ; then 
    rm -f .tmp
    cp include/mpif.h .tmp
    sed -e 's/^C/\!/g' .tmp > include/mpif.h
    rm -f .tmp
fi

chmod a+x src/mpif77
chmod a+x src/mpif90

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1

exit 0

if test -n "$F90" ; then
    # Remove all comments from mpif.h
    /bin/rm -f $includebuild_dir/mpif.h.copy
    cp $includebuild_dir/mpif.h $includebuild_dir/mpif.h.copy
    if test "$fixupmpif" = "no" ; then
	# Regular Fortran doesn't have ! for comments, so we just delete them
        sed -e '/^C/d' -e 's/\!.*$//g' $includebuild_dir/mpif.h.copy > $includebuild_dir/mpif.h
    else
        sed -e 's/^C/\!/g' $includebuild_dir/mpif.h.copy > $includebuild_dir/mpif.h
    fi
    /bin/rm -f $includebuild_dir/mpif.h.copy
else
    # ROMIO might have added ! comments to mpif.h
    if test -z "$fixupmpif" -o "$fixupmpif" = "no" ; then
        /bin/rm -f $includebuild_dir/mpif.h.copy
        cp $includebuild_dir/mpif.h $includebuild_dir/mpif.h.copy
	# Regular Fortran doesn't have ! for comments, so we just delete them
        sed -e '/^C/d' -e 's/\!.*$//g' $includebuild_dir/mpif.h.copy > $includebuild_dir/mpif.h
        /bin/rm -f $includebuild_dir/mpif.h.copy
    fi
fi
