#! /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_default_prefix=".."
ac_help="$ac_help
  --with-CC=ARG           User can manually set C compiler to ARG.  The
                          environment variables 'CC' will be overridden by 
                          the configure script."
ac_help="$ac_help
  --with-CXX=ARG          User can manually set C++ compiler to ARG.  The
                          environment variables 'CXX' will be overridden by 
                          the configure script."
ac_help="$ac_help
  --with-F77=ARG          User can manually set f77 compiler to ARG.  The
                          environment variables 'F77' will be overridden by 
                          the configure script."
ac_help="$ac_help
  --with-LD=ARG           User can manually set linker to ARG.  The
                          environment variables 'LD' will be overridden by 
                          the configure script."
ac_help="$ac_help
  --with-CFLAGS=ARG       User can manually set c compiler flags.  This option
		          is not necessary to turn on optimization or debug
			  flags unless you want to use an opt or debug flag
		          that is not the default.  To choose the default
			  use --enable-opt or --enable-debug. The 'CFLAGS'
                          environment variable will be overridden."
ac_help="$ac_help
  --with-CXXFLAGS=ARG     User can manually set c++ compiler flags. The 
                          'CXXFLAGS' environment variable will be overridden."
ac_help="$ac_help
  --with-F77FLAGS=ARG     User can manually set f77 compiler flags. The 
                          'F77FLAGS' environment variable will be overridden."
ac_help="$ac_help
  --with-LDFLAGS=ARG      User can manually set linker flags. The 'LDFLAGS'
                          environment variable will be overridden."
ac_help="$ac_help
  --with-extra-incpath=PATH    define extra include path, where PATH is a
                          space-separated list of directories."
ac_help="$ac_help
  --with-extra-ldpath=PATH     define extra ld path, where PATH is a
                          space-separated list of directories."
ac_help="$ac_help
  --with-purify=FLAGS     FLAGS are optional to pass to purify, e.g.
			  \"-log-file=struct_ls.purify 
			  -append-logfile=yes\" will send output to a file.
			  assign cc and CC as the C and C++ compilers 
			  if not already set by user and 
			  prepends "purify" to compile/link line-- no 
			  checking is done to ensure purify is present on 
			  the machine"
ac_help="$ac_help
  --with-purify-to-file   direct purify output to the file \"purify.log\""
ac_help="$ac_help
  --with-cegdb            assign gcc and g++ as the c and c++ compilers 
			  and -g as the compiler flag and link in -lcegdb and
                          include cegdb.h-- no checking is done to ensure
			  cegdb is on the machine"
ac_help="$ac_help
  --with-gdb              assign gcc and g++ as the C and c++ compilers
			  and -g and the compiler flag and link in -lgdb and
                          include gdb.h--not checking is done to ensure
			  gdb is on the machine"
ac_help="$ac_help
  --with-strict-checking  compiles with out MPI ('--without-MPI') and
			  assigns kcc and KCC as the c and c++ compilers 
			  and --c --strict as the compiler flag this 
			  enforces syntax described by ISO 9899-1990, 
			  the C language standard. Additional compiler
			  flags, --display_error_number --lint are enabled
			  for lint-type checking. Individual types of 
			  warnings can be suppressed using --diag_suppress
			  and the error numbers provided by 
			  --display_error_number"
ac_help="$ac_help
  --with-mpi-include=DIR  User specifies that mpi.h is in DIR.  The options
			  --with-mpi-include --with-mpi-libs and 
			  --with-mpi-lib-dirs must be used together."
ac_help="$ac_help
  --with-mpi-libs=LIBS    LIBS is space-separated list of library names 
			  needed for MPI, e.g. \"nsl socket mpi\".  The 
			  options --with-mpi-include --with-mpi-libs and 
			  --with-mpi-lib-dirs must be used together."
ac_help="$ac_help
  --with-mpi-lib-dirs=DIRS 
                          DIRS is space-separated list of directories
                          containing the libraries specified by
                          \`--with-mpi-libs',
                          e.g \"/usr/lib /usr/local/mpi/lib\".  The options
			  --with-mpi-include --with-mpi-libs and 
			  --with-mpi-lib-dirs must be used together."
ac_help="$ac_help
  --with-mpi-flags=FLAGS  FLAGS is a space seperated list of whatever
                       	  flags other than -l and -L are needed to link
                          with MPI libraries-- Does not de-activate auto
                          search for other MPI information. May be used with
			  the other three mpi options or alone in conjunction
			  with the automatic mpi search."
ac_help="$ac_help
  --with-MPI              compiles with MPI (this is the default).
                          Selecting '--without-MPI' may affect
			  which compiler is chosen"
ac_help="$ac_help
  --with-COMM_SIMPLE      Do not use MPI derived data types.  This option
			  is automatically chosen for IBM, but may be
			  selected for other platforms as well."
ac_help="$ac_help
  --with-dmalloc          use dmalloc package--no checking is done to ensure
			  the package is on the machine"
ac_help="$ac_help
  --with-timing           use HYPRE timing routines"
ac_help="$ac_help
  --with-pthreads         use pthreads-- this may affect which compiler
			  is chosen.  Tests are done to check for the
			  pthread library.  Supported on IBM only."
ac_help="$ac_help
  --with-openmp           use openMP--this may affect which compiler is 
                          chosen.  Supported on IBM and DECS, test on Linux."
ac_help="$ac_help
  --with-IBM_smp          use IBM SMP--not yet supported"
ac_help="$ac_help
  --with-SGI_smp          use SGI SMP--not yet supported"
ac_help="$ac_help
  --with-pgcc_smp         use pgcc SMP (Red)--not yet supported"
ac_help="$ac_help
  --with-blas             search for and use the BLAS"
ac_help="$ac_help
  --with-babel            use babel"
ac_help="$ac_help
  --with-mli             use MLI"
ac_help="$ac_help
  --with-petsc            use petsc"
ac_help="$ac_help
  --with-mpi-include=DIR  mpi.h is in DIR"
ac_help="$ac_help
  --with-mpi-libs=LIBS    LIBS is space-separated list of library names 
                          needed for MPI, e.g. \"nsl socket mpi\""
ac_help="$ac_help
  --with-mpi-lib-dirs=DIRS
                          DIRS is space-separated list of directories
                          containing the libraries specified by
                          \`--with-mpi-libs', e.g \"/usr/lib /usr/local/mpi/lib\""
ac_help="$ac_help
  --with-mpi-flags=FLAGS  FLAGS is space-separated list of whatever flags other
                          than -l and -L are needed to link with mpi libraries"
ac_help="$ac_help
  --enable-opt            Sets up compiler flags for optimization"
ac_help="$ac_help
  --enable-debug          Sets up compiler flags for debugging"
ac_help="$ac_help
  --with--dir=DIR     is installed in directory DIR
  --without--dir     do not look for "
ac_help="$ac_help
  --with-PETSC-dir=DIR    PETSC is installed in directory DIR
  --without-PETSC-dir     do not look for PETSC"
ac_help="$ac_help
  --with-petsc-include=DIRS DIRS is space-separates list of include directories"
ac_help="$ac_help
  --with-petsc-libs=LIBS    LIBS is space-separated list of library names
                             needed for PETSc, e.g. \"petscvec petscmat"\"
ac_help="$ac_help
  --with-petsc-lib-dirs=DIRS
                          DIRS is space-separated list of directories
                          containing the libraries specified by
                          \`--with-petsc-libs', e.g. 
                          \"/usr/lib /usr/local/petsc/lib\""
ac_help="$ac_help
  --enable-opt            Sets up compiler flags for optimization"
ac_help="$ac_help
  --enable-debug          Sets up compiler flags for debugging"
ac_help="$ac_help
  --with-BLAS=ARG         ARG is list of flags needed to link with the BLAS
                          (could also be complete path of BLAS library file)"

# 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=utilities/memory.c

# 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


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








   echo $ac_n "checking the hostname""... $ac_c" 1>&6
echo "configure:695: checking the hostname" >&5
   casc_hostname=hostname
   HOSTNAME="`$casc_hostname`"

   if test -z "$HOSTNAME" 
   then
         HOSTNAME=unknown
      echo "configure: warning: hostname is unknown" 1>&2
   else
      echo "$ac_t""$HOSTNAME" 1>&6
   fi
   

   echo $ac_n "checking the architecture""... $ac_c" 1>&6
echo "configure:709: checking the architecture" >&5

         if test -z "$ARCH"; then

                        casc_tarch_dir=
      for casc_dir in $srcdir $srcdir/.. $srcdir/../.. $srcdir/config; do
         if test -f $casc_dir/tarch; then
            casc_tarch_dir=$casc_dir
            casc_tarch=$casc_tarch_dir/tarch
            break
         fi
      done

                  if test -z "$casc_tarch_dir"; then
         echo "configure: warning: cannot find tarch" 1>&2
         ARCH=$HOSTTYPE
      else
         ARCH="`$casc_tarch`"

         if test -z "$ARCH" || test "$ARCH" = "unknown"; then
            ARCH=$HOSTTYPE
         fi
      fi

            if test -z "$ARCH"; then
         ARCH=unknown
         echo "configure: warning: architecture is unknown" 1>&2
      else
         echo "$ac_t""$ARCH" 1>&6
      fi    
   else
      echo "$ac_t""$ARCH" 1>&6
   fi

   
   




casc_user_chose_compilers=no
casc_user_chose_mpi=no
casc_using_pthreads=no
casc_using_babel=no
casc_using_mli=no
casc_using_petsc=no
casc_using_openmp=no   
casc_using_ibm_smp=no
casc_using_sgi_smp=no
casc_using_pgcc_smp=no


# Check whether --with-CC or --without-CC was given.
if test "${with_CC+set}" = set; then
  withval="$with_CC"
  case "${withval}" in
   yes) casc_user_chose_compilers=no ;;
   no)  casc_user_chose_compilers=no ;;
   *)   casc_user_chose_compilers=yes
        CC=$withval ;;
 esac
else
  casc_user_chose_compilers=no

fi


# Check whether --with-CXX or --without-CXX was given.
if test "${with_CXX+set}" = set; then
  withval="$with_CXX"
  case "${withval}" in
   yes) casc_user_chose_compilers=no ;;
   no)  casc_user_chose_compilers=no ;;
   *)   casc_user_chose_compilers=yes
        CXX=$withval ;;
 esac

fi


# Check whether --with-F77 or --without-F77 was given.
if test "${with_F77+set}" = set; then
  withval="$with_F77"
  case "${withval}" in
   yes) casc_user_chose_compilers=no ;;
   no)  casc_user_chose_compilers=no ;;
   *)   casc_user_chose_compilers=yes
        F77=$withval ;;
 esac

fi


# Check whether --with-LD or --without-LD was given.
if test "${with_LD+set}" = set; then
  withval="$with_LD"
  case "${withval}" in
   yes) casc_user_chose_compilers=no ;;
   no)  casc_user_chose_compilers=no ;;
   *)   casc_user_chose_compilers=yes
        LD=$withval ;;
 esac

fi


# Check whether --with-CFLAGS or --without-CFLAGS was given.
if test "${with_CFLAGS+set}" = set; then
  withval="$with_CFLAGS"
  CFLAGS=$withval

fi


# Check whether --with-CXXFLAGS or --without-CXXFLAGS was given.
if test "${with_CXXFLAGS+set}" = set; then
  withval="$with_CXXFLAGS"
  CXXFLAGS=$withval

fi


# Check whether --with-F77FLAGS or --without-F77FLAGS was given.
if test "${with_F77FLAGS+set}" = set; then
  withval="$with_F77FLAGS"
  F77FLAGS=$withval

fi


# Check whether --with-LDFLAGS or --without-LDFLAGS was given.
if test "${with_LDFLAGS+set}" = set; then
  withval="$with_LDFLAGS"
  LDFLAGS=$withval

fi


# Check whether --with-extra-incpath or --without-extra-incpath was given.
if test "${with_extra_incpath+set}" = set; then
  withval="$with_extra_incpath"
  CCFLAGS="${CCFLAGS} -I`echo ${withval}|sed 's/ /\ -I/g'`"

fi


# Check whether --with-extra-ldpath or --without-extra-ldpath was given.
if test "${with_extra_ldpath+set}" = set; then
  withval="$with_extra_ldpath"
  LDFLAGS="-L`echo ${withval}|sed 's/ /\ -L/g'` ${LDFLAGS}"

fi


# Check whether --with-purify or --without-purify was given.
if test "${with_purify+set}" = set; then
  withval="$with_purify"
  if test "$casc_user_chose_compilers" = "no"
 then
   CC=cc
   CXX=CC
   CFLAGS="$CFLAGS -g"
   CXXFLAGS="$CXXFLAGS -g"
   casc_user_chose_compilers=yes
 fi
 case "${withval}" in
   yes) PREPEND="purify" ;;
   no)  PREPEND="" ;;
   *)   PREPEND="purify $withval" ;;
 esac
else
  PREPEND=""

fi


# Check whether --with-purify-to-file or --without-purify-to-file was given.
if test "${with_purify_to_file+set}" = set; then
  withval="$with_purify_to_file"
  if test "$casc_user_chose_compilers" = "no"
 then
   CC=cc
   CXX=CC
   CFLAGS="$CFLAGS -g"
   CXXFLAGS="$CXXFLAGS -g"
   casc_user_chose_compilers=yes
 fi
 case "${withval}" in
   yes) PREPEND="purify -log-file=purify.log -append-logfile=yes -best-effort";;
   no)  PREPEND="" ;;
   *)   PREPEND="purify $withval" ;;
 esac

fi


echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:906: 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 921 "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:927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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 938 "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:944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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 955 "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:961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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

# Check whether --with-cegdb or --without-cegdb was given.
if test "${with_cegdb+set}" = set; then
  withval="$with_cegdb"
  CC=gcc
 CXX=g++
 CFLAGS="$CFLAGS -g"
 CXXFLAGS="$CXXFLAGS -g"
 
            for casc_dir in '' /home/casc/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/cegdb.h
      else
         casc_header=cegdb.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:1002: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1007 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for cegdb in -lcegdb""... $ac_c" 1>&6
echo "configure:1040: checking for cegdb in -lcegdb" >&5
ac_lib_var=`echo cegdb'_'cegdb | 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="$LDLIBDIRS $LDLIBS $LIBS -lcegdb"
cat > conftest.$ac_ext <<EOF
#line 1048 "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 cegdb();

int main() {
cegdb()
; return 0; }
EOF
if { (eval echo configure:1059: \"$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
  LDLIBS="$LDLIBS -lcegdb"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /home/casc/lib; do

         echo $ac_n "checking for cegdb in -lcegdb""... $ac_c" 1>&6
echo "configure:1084: checking for cegdb in -lcegdb" >&5
ac_lib_var=`echo cegdb'_'cegdb | 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="-L$casc_lib_dir $LDLIBDIRS $LDLIBS -lcegdb $LIBS -lcegdb"
cat > conftest.$ac_ext <<EOF
#line 1092 "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 cegdb();

int main() {
cegdb()
; return 0; }
EOF
if { (eval echo configure:1103: \"$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
  LDLIBDIRS="-L$casc_lib_dir $LDLIBDIRS"
            LDLIBS="$LDLIBS -lcegdb"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


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


   done

      

   unset casc_header_found

 casc_users_chose_compilers=yes

fi


# Check whether --with-gdb or --without-gdb was given.
if test "${with_gdb+set}" = set; then
  withval="$with_gdb"
  CC=gcc
 CXX=g++
 CFLAGS="$CFLAGS -g"
 CXXFLAGS="$CXXFLAGS -g"
 
            for casc_dir in '' /usr/local/include /usr/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/gdb.h
      else
         casc_header=gdb.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:1177: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1182 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for gdb in -lgdb""... $ac_c" 1>&6
echo "configure:1215: checking for gdb in -lgdb" >&5
ac_lib_var=`echo gdb'_'gdb | 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="$LDLIBDIRS $LDLIBS $LIBS -lgdb"
cat > conftest.$ac_ext <<EOF
#line 1223 "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 gdb();

int main() {
gdb()
; return 0; }
EOF
if { (eval echo configure:1234: \"$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
  LDLIBS="$LDLIBS -lgdb"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/local/lib /usr/lib; do

         echo $ac_n "checking for gdb in -lgdb""... $ac_c" 1>&6
echo "configure:1259: checking for gdb in -lgdb" >&5
ac_lib_var=`echo gdb'_'gdb | 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="-L$casc_lib_dir $LDLIBDIRS $LDLIBS -lgdb $LIBS -lgdb"
cat > conftest.$ac_ext <<EOF
#line 1267 "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 gdb();

int main() {
gdb()
; return 0; }
EOF
if { (eval echo configure:1278: \"$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
  LDLIBDIRS="-L$casc_lib_dir $LDLIBDIRS"
            LDLIBS="$LDLIBS -lgdb"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


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


   done

      

   unset casc_header_found

 casc_users_chose_compilers=yes

fi


# Check whether --with-strict-checking or --without-strict-checking was given.
if test "${with_strict_checking+set}" = set; then
  withval="$with_strict_checking"
  CC=kcc
 CXX=KCC
 CFLAGS="$CFLAGS --c --strict --lint --display_error_number"
 CFLAGS="$CFLAGS --diag_suppress 236,826,1018,1021,1022,1023,1024,1030,1041"
 CXXFLAGS="$CXXFLAGS --strict --lint --display_error_number"
 casc_users_chose_compilers=yes
 casc_using_mpi=no
 cat >> confdefs.h <<\EOF
#define HYPRE_SEQUENTIAL 1
EOF


fi


# Check whether --with-mpi-include or --without-mpi-include was given.
if test "${with_mpi_include+set}" = set; then
  withval="$with_mpi_include"
  for mpi_dir in $withval; do
   MPIINCLUDE="$MPIINCLUDE -I$withval"
 done;
 casc_user_chose_mpi=yes
else
  casc_user_chose_mpi=no

fi


# Check whether --with-mpi-libs or --without-mpi-libs was given.
if test "${with_mpi_libs+set}" = set; then
  withval="$with_mpi_libs"
  for mpi_lib in $withval; do
   MPILIBS="$MPILIBS -l$mpi_lib"
 done;
 casc_user_chose_mpi=yes

fi


# Check whether --with-mpi-lib-dirs or --without-mpi-lib-dirs was given.
if test "${with_mpi_lib_dirs+set}" = set; then
  withval="$with_mpi_lib_dirs"
  for mpi_lib_dir in $withval; do
   MPILIBDIRS="-L$mpi_lib_dir $MPILIBDIRS"
 done;
 casc_user_chose_mpi=yes

fi


# Check whether --with-mpi-flags or --without-mpi-flags was given.
if test "${with_mpi_flags+set}" = set; then
  withval="$with_mpi_flags"
  case "${withval}" in
   yes) MPIFLAGS="" ;;
   no)  MPIFLAGS="" ;;
   *)   MPIFLAGS=$withval ;;
 esac
else
  MPIFLAGS=""

fi



# Check whether --with-MPI or --without-MPI was given.
if test "${with_MPI+set}" = set; then
  withval="$with_MPI"
  case "${withval}" in
   yes) casc_using_mpi=yes ;;
   no)  casc_using_mpi=no ;;
   *)   casc_using_mpi=$withval ;;
 esac
else
  casc_using_mpi=yes

fi

if test $casc_using_mpi = "no"
then
  cat >> confdefs.h <<\EOF
#define HYPRE_SEQUENTIAL 1
EOF

fi

# Check whether --with-COMM_SIMPLE or --without-COMM_SIMPLE was given.
if test "${with_COMM_SIMPLE+set}" = set; then
  withval="$with_COMM_SIMPLE"
  if test "$withval" = "yes"
 then
   CFLAGS="$CFLAGS -DHYPRE_COMM_SIMPLE"
 fi

fi


# Check whether --with-dmalloc or --without-dmalloc was given.
if test "${with_dmalloc+set}" = set; then
  withval="$with_dmalloc"
  if test "$withval" = "yes"
 then
   
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for malloc in -ldmalloc""... $ac_c" 1>&6
echo "configure:1448: checking for malloc in -ldmalloc" >&5
ac_lib_var=`echo dmalloc'_'malloc | 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="$LDLIBDIRS $LDLIBS $LIBS -ldmalloc"
cat > conftest.$ac_ext <<EOF
#line 1456 "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 malloc();

int main() {
malloc()
; return 0; }
EOF
if { (eval echo configure:1467: \"$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
  LDLIBS="$LDLIBS -ldmalloc"
                          casc_lib_found=yes 
                          cat >> confdefs.h <<\EOF
#define HYPRE_MEMORY_DMALLOC 1
EOF
 
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /home/casc/lib /usr/local/lib; do

         echo $ac_n "checking for malloc in -ldmalloc""... $ac_c" 1>&6
echo "configure:1495: checking for malloc in -ldmalloc" >&5
ac_lib_var=`echo dmalloc'_'malloc | 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="-L$casc_lib_dir $LDLIBDIRS $LDLIBS -ldmalloc $LIBS -ldmalloc"
cat > conftest.$ac_ext <<EOF
#line 1503 "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 malloc();

int main() {
malloc()
; return 0; }
EOF
if { (eval echo configure:1514: \"$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
  LDLIBDIRS="-L$casc_lib_dir $LDLIBDIRS"
            LDLIBS="$LDLIBS -ldmalloc"
            casc_lib_found=yes
            cat >> confdefs.h <<\EOF
#define HYPRE_MEMORY_DMALLOC 1
EOF
 
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


 fi

fi


# Check whether --with-timing or --without-timing was given.
if test "${with_timing+set}" = set; then
  withval="$with_timing"
  if test "$withval" = "yes"
 then
   cat >> confdefs.h <<\EOF
#define HYPRE_TIMING 1
EOF

 fi

fi


# Check whether --with-pthreads or --without-pthreads was given.
if test "${with_pthreads+set}" = set; then
  withval="$with_pthreads"
  case "${withval}" in
   yes) casc_using_pthreads=yes
     echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:1582: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | 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=" $LIBS -lpthread"
cat > conftest.$ac_ext <<EOF
#line 1590 "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 pthread_create();

int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:1601: \"$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 pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lpthread $LIBS" 

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

  
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
echo "configure:1629: checking for pthread_create in -lpthreads" >&5
ac_lib_var=`echo pthreads'_'pthread_create | 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=" $LIBS -lpthreads"
cat > conftest.$ac_ext <<EOF
#line 1637 "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 pthread_create();

int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:1648: \"$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 pthreads | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lpthreads $LIBS" 

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


fi


     if test "$ac_cv_lib_pthread_pthread_create" = "yes" ||
       test "$ac_cv_lib_pthreads_pthread_create" = "yes"
     then
       cat >> confdefs.h <<\EOF
#define HYPRE_USE_PTHREADS 1
EOF

     fi ;;
   no)  casc_using_pthreads=no ;;
 esac
else
  casc_using_pthreads=no

fi


# Check whether --with-openmp or --without-openmp was given.
if test "${with_openmp+set}" = set; then
  withval="$with_openmp"
  case "${withval}" in
   yes) casc_using_openmp=yes
   cat >> confdefs.h <<\EOF
#define HYPRE_USING_OPENMP 1
EOF
 ;;
   no)  casc_using_openmp=no ;;
 esac
else
  casc_using_openmp=no

fi


# Check whether --with-IBM_smp or --without-IBM_smp was given.
if test "${with_IBM_smp+set}" = set; then
  withval="$with_IBM_smp"
  case "${withval}" in
   yes) casc_using_ibm_smp=yes
     cat >> confdefs.h <<\EOF
#define HYPRE_USING_IBM_SMP 1
EOF
 ;;
   no)  casc_using_ibm_smp=no ;;
 esac
else
  casc_using_ibm_smp=no

fi


# Check whether --with-SGI_smp or --without-SGI_smp was given.
if test "${with_SGI_smp+set}" = set; then
  withval="$with_SGI_smp"
  case "${withval}" in
   yes) casc_using_sgi_smp=yes
     cat >> confdefs.h <<\EOF
#define HYPRE_USING_SGI_SMP 1
EOF
 ;;
   no)  casc_using_sgi_smp=no ;;
 esac
else
  casc_using_sgi_smp=no

fi


# Check whether --with-pgcc_smp or --without-pgcc_smp was given.
if test "${with_pgcc_smp+set}" = set; then
  withval="$with_pgcc_smp"
  case "${withval}" in
   yes) casc_using_pgcc_smp=yes 
     cat >> confdefs.h <<\EOF
#define HYPRE_USING_PGCC_SMP 1
EOF
 ;;
   no)  casc_using_sgi_smp=no ;;
 esac
else
  casc_using_pgcc_smp=no

fi


# Check whether --with-blas or --without-blas was given.
if test "${with_blas+set}" = set; then
  withval="$with_blas"
  case "${withval}" in
   yes) casc_using_blas="" ;;
   no)  casc_using_blas="" ;;
   *)   casc_using_blas=$withval ;;
 esac
else
  casc_using_blas=""

fi


HYPRE_TOP_SRC_DIR=`pwd`

# Check whether --with-babel or --without-babel was given.
if test "${with_babel+set}" = set; then
  withval="$with_babel"
  case "${withval}" in
   yes) casc_using_babel=yes ;;
   no)  casc_using_babel=no ;;
 esac
else
  casc_using_babel=no

fi


# Check whether --with-mli or --without-mli was given.
if test "${with_mli+set}" = set; then
  withval="$with_mli"
  case "${withval}" in
   yes) casc_using_mli=yes ;;
   no)  casc_using_mli=no ;;
 esac
else
  casc_using_mli=no

fi


# Check whether --with-petsc or --without-petsc was given.
if test "${with_petsc+set}" = set; then
  withval="$with_petsc"
  case "${withval}" in
   yes) casc_using_petsc=yes
     HYPRE_PETSCDEFS="$HYPRE_PETSCDEFS -DPETSC_AVAILABLE"
     HYPRE_PETSCLIBDIRS="$HYPRE_TOP_SRC_DIR/PETScMat_ls/pilut \
$HYPRE_TOP_SRC_DIR/PETSc_ls/ParILUT "
     HYPRE_PETSCLIBS=" -l_HYPRE_PETScSolverParILUT \
-l_HYPRE_PETScMatPilutSolver " ;;
   no)  casc_using_petsc=no ;;
 esac
else
  casc_using_petsc=no

fi


# 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:1826: 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



case $HOSTNAME in
   sasn100 )

     if  test "$casc_user_chose_compilers" = "no"
     then
        for ac_prog in cicc cc
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:1865: 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

        for ac_prog in ciCC CC
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:1899: 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
 
        for ac_prog in cif77 f77
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:1933: 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

     fi

     if  test "$casc_user_chose_mpi" = "no" && test "$casc_using_mpi" = "yes"
     then
        
            for casc_dir in '' /opt/intel/tflop/current/tflops/cougar/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/mpi.h
      else
         casc_header=mpi.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:1976: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1981 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
         break 
else
  echo "$ac_t""no" 1>&6
fi


   done

      

   unset casc_header_found

        MPIINCLUDE="$MPIINCLUDE $INCLUDES"
        
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:2028: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="$MPILIBDIRS $MPILIBS $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 2036 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2043: \"$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
  MPILIBS="$MPILIBS -lmpi"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /opt/intel/tflop/current/tflops/cougar/lib/puma; do

         echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:2068: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="-L$casc_lib_dir $MPILIBDIRS $MPILIBS -lmpi $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 2076 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2083: \"$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
  MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
            MPILIBS="$MPILIBS -lmpi"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


        if test -z "$MPILIBS"
        then
           echo "configure: warning: MPI not found--in sasn100 test-must set manually using --with-flags" 1>&2
        fi
     fi

     CFLAGS="$CFLAGS"
     
   if test -z "$COPT"; then
      COPT="-O"
   fi
   

     
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

     
   if test -z "$CXXOPT"; then
      CXXOPT="-O"
   fi
   

     
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   
 
     
   if test -z "$FOPT"; then
      FOPT="-O"
   fi
   

     
   if test -z "$FDEBUG"; then
      FDEBUG="-g"
   fi
   

     if test -z "$casc_using_blas"
     then
       casc_using_blas=yes
     fi

   ;;

   janus )

     if  test "$casc_user_chose_compilers" = "no"
     then
        for ac_prog in pgcc cc
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:2182: 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

        for ac_prog in pgCC CC
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:2216: 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
 
        for ac_prog in pgf77 f77
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:2250: 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

     fi

     if  test "$casc_user_chose_mpi" = "no" && test "$casc_using_mpi" = "yes"
     then
        
            for casc_dir in '' /cougar/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/mpi.h
      else
         casc_header=mpi.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:2293: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2298 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
         break 
else
  echo "$ac_t""no" 1>&6
fi


   done

      

   unset casc_header_found

        MPIINCLUDE="$MPIINCLUDE $INCLUDES"
        
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:2345: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="$MPILIBDIRS $MPILIBS $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 2353 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2360: \"$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
  MPILIBS="$MPILIBS -lmpi"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /cougar/lib/puma; do

         echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:2385: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="-L$casc_lib_dir $MPILIBDIRS $MPILIBS -lmpi $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 2393 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2400: \"$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
  MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
            MPILIBS="$MPILIBS -lmpi"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


        if test -z "$MPILIBS"
        then
           echo "configure: warning: MPI not found--in janus test-must set manually using --with-flags" 1>&2
        fi
     fi
     
     CFLAGS="$CFLAGS -cougar -mp -Mx,123,0x2000"
     LIBS="$LIBS -cougar -mp -Mx,123,0x2000"
     
   if test -z "$COPT"; then
      COPT="-O"
   fi
   

     
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

     
   if test -z "$CXXOPT"; then
      CXXOPT="-O"
   fi
   

     
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   
 
     
   if test -z "$FOPT"; then
      FOPT="-O"
   fi
   

     
   if test -z "$FDEBUG"; then
      FDEBUG="-g"
   fi
   

     if test -z "$casc_using_blas"
     then
       casc_using_blas=yes
     fi
      
   ;;

   nirvana )

     if  test "$casc_user_chose_compilers" = "no"
     then
        for ac_prog in cc kcc 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:2500: 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

        for ac_prog in CC KCC g++
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:2534: 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
 
        for ac_prog in f77 g77
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:2568: 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

     fi

     if  test "$casc_user_chose_mpi" = "no" && test "$casc_using_mpi" = "yes"
     then
        
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:2609: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="$MPILIBDIRS $MPILIBS $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 2617 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2624: \"$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
  MPILIBS="$MPILIBS -lmpi"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/lib; do

         echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:2649: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="-L$casc_lib_dir $MPILIBDIRS $MPILIBS -lmpi $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 2657 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2664: \"$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
  MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
            MPILIBS="$MPILIBS -lmpi"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


        if test -z "$MPILIBS"
        then
           echo "configure: warning: MPI not found--in nirvana test-must set manually using --with-flags" 1>&2
        fi
     fi

     
   if test -z "$COPT"; then
      COPT="-O"
   fi
   

     
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

     
   if test -z "$CXXOPT"; then
      CXXOPT="-O"
   fi
   

     
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   

     
   if test -z "$FOPT"; then
      FOPT="-O"
   fi
   

     
   if test -z "$FDEBUG"; then
      FDEBUG="-g"
   fi
   

     if test -z "$casc_using_blas"
     then
       casc_using_blas=yes
     fi
      
   ;;

   n02 )

     if  test "$casc_user_chose_compilers" = "no"
     then
        for ac_prog in cc kcc 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:2762: 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

        for ac_prog in CC KCC g++
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:2796: 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
 
        for ac_prog in f77 g77
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:2830: 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

     fi

     if  test "$casc_user_chose_mpi" = "no" && test "$casc_using_mpi" = "yes"
     then
        
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:2871: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="$MPILIBDIRS $MPILIBS $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 2879 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2886: \"$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
  MPILIBS="$MPILIBS -lmpi"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/lib; do

         echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:2911: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="-L$casc_lib_dir $MPILIBDIRS $MPILIBS -lmpi $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 2919 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:2926: \"$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
  MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
            MPILIBS="$MPILIBS -lmpi"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


        if test -z "$MPILIBS"
        then
           echo "configure: warning: MPI not found--in n02 test-must set manually using --with-flags" 1>&2
        fi
     fi

     
   if test -z "$COPT"; then
      COPT="-O -64"
   fi
   

     
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

     
   if test -z "$CXXOPT"; then
      CXXOPT="-64"
   fi
   

     
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   

     
   if test -z "$FOPT"; then
      FOPT="-O -64"
   fi
   

     
   if test -z "$FDEBUG"; then
      FDEBUG="-g"
   fi
   

     LDFLAGS="-O -64 ${LDFLAGS}"
     if test -z "$casc_using_blas"
     then
       casc_using_blas=yes
     fi
      
   ;;
        
esac

case $ARCH in
  sun4 | solaris )
    if test -z "$CC"; then
      if test "$casc_using_mpi" = "no" ; then
        for ac_prog in cc gcc kcc
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:3027: 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

      else
        for ac_prog in mpicc
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:3062: 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

      fi
    fi
    if test -z "$CXX"; then
      if test "$casc_using_mpi" = "no" ; then
        for ac_prog in CC g++
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:3100: 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

      else
        for ac_prog in mpiCC
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:3135: 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

      fi
    fi
    if test -z "$F77"; then
      if test "$casc_using_mpi" = "no" ; then
        for ac_prog in f77 g77
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:3173: 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

      else
        for ac_prog in mpif77
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:3208: 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

      fi
    fi

    if test -z "$CFLAGS"; then
      
   if test -z "$COPT"; then
      COPT="-O"
   fi
   

    fi
    if test -z "$CXXFLAGS"; then
      
   if test -z "$CXXOPT"; then
      CXXOPT="-O"
   fi
   

    fi
    if test -z "$F77FLAGS"; then
      
   if test -z "$FOPT"; then
      FOPT="-O -silent"
   fi
   

    fi
    
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

    
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   

    
   if test -z "$FDEBUG"; then
      FDEBUG="-g -silent"
   fi
   

  ;;

  LINUX | Linux )
    if test -z "$CC"; then
      if test "$casc_using_mpi" = "no" &&
        test "$casc_using_openmp" = "no"
      then
        for ac_prog in ccc cc gcc kcc
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:3294: 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

      else
        if test "$casc_using_openmp" = "no" ; then
          for ac_prog in mpicc
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:3330: 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

        else
          for ac_prog in ompcc
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:3365: 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
 
          
            for casc_dir in '' /usr/local/omni/lib/openmp/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/omp.h
      else
         casc_header=omp.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:3404: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3409 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
         break 
else
  echo "$ac_t""no" 1>&6
fi


   done

      

   unset casc_header_found

          
            for casc_dir in '' /usr/local/mpich-1.2.1/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/mpi.h
      else
         casc_header=mpi.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:3457: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3462 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3467: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
         break 
else
  echo "$ac_t""no" 1>&6
fi


   done

      

   unset casc_header_found

          
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lompc""... $ac_c" 1>&6
echo "configure:3508: checking for main in -lompc" >&5
ac_lib_var=`echo ompc'_'main | 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="$LIBDIRS $LIBS $LIBS -lompc"
cat > conftest.$ac_ext <<EOF
#line 3516 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:3523: \"$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
  LIBS="$LIBS -lompc"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/local/omni/lib/openmp/lib; do

         echo $ac_n "checking for main in -lompc""... $ac_c" 1>&6
echo "configure:3548: checking for main in -lompc" >&5
ac_lib_var=`echo ompc'_'main | 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="-L$casc_lib_dir $LIBDIRS $LIBS -lompc $LIBS -lompc"
cat > conftest.$ac_ext <<EOF
#line 3556 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:3563: \"$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
  LIBDIRS="-L$casc_lib_dir $LIBDIRS"
            LIBS="$LIBS -lompc"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


        fi
      fi
    fi
    if test -z "$CXX"; then
      if test "$casc_using_mpi" = "no" &&
        test "$casc_using_openmp" = "no"
      then
        for ac_prog in CC g++
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:3615: 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

      else
        if test "$casc_using_openmp" = "no" ; then
          for ac_prog in mpiCC
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:3651: 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

        else
          for ac_prog in ompcc
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:3686: 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
 
        fi
      fi
    fi
    if test -z "$F77"; then
      if test "$casc_using_mpi" = "no" &&
        test "$casc_using_openmp" = "no"
      then
        for ac_prog in fort f77 g77
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:3727: 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

      else
        if test "$casc_using_openmp" = "no" ; then
          for ac_prog in mpif77
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:3763: 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

        else
          for ac_prog in ompf77
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:3798: 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

        fi
      fi
    fi

    if test -z "$CFLAGS"; then
      
   if test -z "$COPT"; then
      COPT="-O"
   fi
   

    fi
    if test -z "$CXXFLAGS"; then
      
   if test -z "$CXXOPT"; then
      CXXOPT="-O"
   fi
   

    fi
    if test -z "$F77FLAGS"; then
      
   if test -z "$FOPT"; then
      FOPT="-O"
   fi
   

    fi
    
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

    
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   

    
   if test -z "$FDEBUG"; then
      FDEBUG="-g"
   fi
   

  ;;

  alpha)
    if test -z "$CC"; then
      if test "$casc_using_mpi" = "no" &&
        test "$casc_using_openmp" = "no"
      then
        for ac_prog in cc kcc gcc c89
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:3885: 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

      else
        if test "$casc_using_openmp" = "no" ; then
          for ac_prog in mpicc cc kcc
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:3921: 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
 
        else
          for ac_prog in guidec
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:3956: 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
 
        fi
      fi
    fi
    if test -z "$CXX"; then
      if test "$casc_using_mpi" = "no" &&
        test "$casc_using_openmp" = "no"
      then
        for ac_prog in cxx KCC g++
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:3997: 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

      else
        if test "$casc_using_openmp" = "no" ; then
          for ac_prog in mpicxx cxx KCC
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:4033: 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
 
        else
          for ac_prog in guidec++
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:4068: 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
 
        fi
      fi
    fi
    if test -z "$F77"; then
      if test "$casc_using_mpi" = "no" &&
        test "$casc_using_openmp" = "no"
      then
        for ac_prog in f77 kf77 g77
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:4109: 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

      else
        if test "$casc_using_openmp" = "no" ; then
          for ac_prog in mpif77 f77 kf77
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:4145: 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

        else
          for ac_prog in guidef77
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:4180: 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

        fi
      fi
    fi

    if test "$casc_user_chose_mpi" = "no" &&
        test "$casc_using_mpi" = "yes" &&
        test "$CC" != "mpicc"
    then
      
            for casc_dir in '' /usr/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/mpi.h
      else
         casc_header=mpi.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:4227: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4232 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
         break 
else
  echo "$ac_t""no" 1>&6
fi


   done

      

   unset casc_header_found

      MPIINCLUDE="$MPIINCLUDE $INCLUDES"
      
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lrt""... $ac_c" 1>&6
echo "configure:4279: checking for main in -lrt" >&5
ac_lib_var=`echo rt'_'main | 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="$LIBDIRS $LIBS $LIBS -lrt"
cat > conftest.$ac_ext <<EOF
#line 4287 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:4294: \"$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
  LIBS="$LIBS -lrt"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/lib; do

         echo $ac_n "checking for main in -lrt""... $ac_c" 1>&6
echo "configure:4319: checking for main in -lrt" >&5
ac_lib_var=`echo rt'_'main | 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="-L$casc_lib_dir $LIBDIRS $LIBS -lrt $LIBS -lrt"
cat > conftest.$ac_ext <<EOF
#line 4327 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:4334: \"$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
  LIBDIRS="-L$casc_lib_dir $LIBDIRS"
            LIBS="$LIBS -lrt"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


      
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:4382: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="$MPILIBDIRS $MPILIBS $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 4390 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:4397: \"$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
  MPILIBS="$MPILIBS -lmpi"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/lib; do

         echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:4422: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="-L$casc_lib_dir $MPILIBDIRS $MPILIBS -lmpi $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 4430 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:4437: \"$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
  MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
            MPILIBS="$MPILIBS -lmpi"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


      if test -z "$MPILIBS"
      then
        echo "configure: warning: MPI not found--in alpha test-must set manually using --with-flags" 1>&2
      fi
    fi

    if test -z "$CFLAGS"; then
      if test "$CC" = "cc" ||
        test "$CC" = "mpicc" ; then
        
   if test -z "$COPT"; then
      COPT="-fast"
   fi
   

      elif test "$CC" = "kcc" ; then
        
   if test -z "$COPT"; then
      COPT="-o=5"
   fi
   

      else 
        
   if test -z "$COPT"; then
      COPT="-O"
   fi
   

      fi
    fi
    if test -z "$CXXFLAGS"; then
      if test "$CXX" = "cxx" ||
        test "$CXX" = "mpicxx" ; then
        
   if test -z "$CXXOPT"; then
      CXXOPT="-fast"
   fi
   

      else 
        
   if test -z "$CXXOPT"; then
      CXXOPT="-O"
   fi
   

      fi
    fi
    if test -z "$F77FLAGS"; then
      if test "$F77" = "f77" ||
        test "$F77" = "mpif77" ; then
        
   if test -z "$FOPT"; then
      FOPT="-fast"
   fi
   

      else 
        
   if test -z "$FOPT"; then
      FOPT="-O"
   fi
   

      fi
    fi
    
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

    
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   

    
   if test -z "$FDEBUG"; then
      FDEBUG=""
   fi
   

  ;;

  rs6000)
    if test -z "$CC"; then
      if test "$casc_using_mpi" = "no" ; then
        if test "$casc_using_pthreads" = "no" &&
          test "$casc_using_openmp" = "no"
        then
          for ac_prog in xlc gcc cc c89
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:4575: 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

        else
          if test "$casc_using_pthreads" = "yes" ; then
            for ac_prog in xlc_r 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:4611: 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

          fi
          if test "$casc_using_openmp" = "yes" ; then
            for ac_prog in guidec
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:4647: 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

          fi
        fi
      else
        if test "$casc_using_pthreads" = "no" &&
          test "$casc_using_openmp" = "no"
        then
          for ac_prog in mpcc mpicc
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:4687: 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

        else
          if test "$casc_using_pthreads" = "yes" ; then
            for ac_prog in mpxlc_r mpcc_r mpicc
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:4723: 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

          fi
          if test "$casc_using_openmp" = "yes" ; then
            for ac_prog in mpguidec
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:4759: 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

          fi
        fi
      fi
    fi
    if test -z "$CXX"; then
      if test "$casc_using_mpi" = "no" ; then
        if test "$casc_using_pthreads" = "no" &&
          test "$casc_using_openmp" = "no"
        then
          for ac_prog in xlC KCC g++
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:4802: 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

        else
          if test "$casc_using_pthreads" = "yes" ; then
            for ac_prog in xlC_r g++
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:4838: 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

          fi
          if test "$casc_using_openmp" = "yes" ; then
            for ac_prog in guidec++
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:4874: 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

          fi
        fi
      else
        if test "$casc_using_pthreads" = "no" &&
          test "$casc_using_openmp" = "no"
        then
          for ac_prog in mpCC mpKCC mpiCC
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:4914: 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

          echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:4944: 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 4959 "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:4965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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 4976 "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:4982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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 4993 "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:4999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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

        else
          if test "$casc_using_pthreads" = "yes" ; then
            for ac_prog in mpxlC_r mpCC_r mpiCC
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:5030: 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

          fi
          if test "$casc_using_openmp" = "yes" ; then
            for ac_prog in mpguidec++
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:5066: 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

          fi
        fi
      fi
    fi
    if test -z "$F77"; then
      if test "$casc_using_mpi" = "no" ; then
        if test "$casc_using_pthreads" = "no" &&
          test "$casc_using_openmp" = "no"
        then
          for ac_prog in xlf g77
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:5109: 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

        else
          if test "$casc_using_pthreads" = "yes" ; then
            for ac_prog in xlf_r g77
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:5145: 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

          fi
          if test "$casc_using_openmp" = "yes" ; then
            for ac_prog in guidef77
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:5181: 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

          fi
        fi
      else
        if test "$casc_using_pthreads" = "no" &&
          test "$casc_using_openmp" = "no"
        then
          for ac_prog in mpxlf mpif77
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:5221: 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

        else
          if test "$casc_using_pthreads" = "yes" ; then
            for ac_prog in mpxlf_r mpif77
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:5257: 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

          fi
          if test "$casc_using_openmp" = "yes" ; then
            for ac_prog in mpguidef77
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:5293: 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

          fi
        fi
      fi
    fi

    if test -z "$CFLAGS"; then
      if test "$CC" = "gcc" ; then
        
   if test -z "$COPT"; then
      COPT="-O"
   fi
   

      else
        
   if test -z "$COPT"; then
      COPT="-O3 -qstrict"
   fi
   

        if test "$casc_using_openmp" = "yes" ; then
          CFLAGS="$CFLAGS -qsmp=omp "
        fi
      fi
    fi
    if test -z "$CXXFLAGS"; then
      if test "$CXX" = "g++" ; then
        
   if test -z "$CXXOPT"; then
      CXXOPT="-O"
   fi
   

      elif test "$CXX" = "KCC" ||
           test "$CXX" = "mpKCC" ; then
        
   if test -z "$COPT"; then
      COPT="+K2"
   fi
   

      else
        
   if test -z "$CXXOPT"; then
      CXXOPT="-O3 -qstrict"
   fi
   

        if test "$casc_using_openmp" = "yes" ; then
          CXXFLAGS="$CXXFLAGS -qsmp=omp "
        fi
      fi
    fi
    if test -z "$F77FLAGS"; then
      if test "$F77" = "g77" ; then
        
   if test -z "$FOPT"; then
      FOPT="-O"
   fi
   

      else
        
   if test -z "$FOPT"; then
      FOPT="-O3 -qstrict"
   fi
   

      fi
    fi
    CFLAGS="$CFLAGS -qmaxmem=8192 -DHYPRE_COMM_SIMPLE"
    CXXFLAGS="$CXXFLAGS -qmaxmem=8192 -DHYPRE_COMM_SIMPLE"
    
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

    
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   

    
   if test -z "$FDEBUG"; then
      FDEBUG="-g"
   fi
   
 
  ;;

  IRIX64)
    if test -z "$CC"; then
      for ac_prog in cc gcc c89
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:5421: 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

    fi
    if test -z "$CXX"; then
      for ac_prog in cxx CC g++
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:5457: 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
 
    fi
    if test -z "$F77"; then
      for ac_prog in f77 g77
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:5493: 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

    fi

    if test "$CC" = "cc" ||
      test "$CC" = "gcc" &&
      test "$casc_user_chose_mpi" = "no" &&
      test "$casc_using_mpi" = "yes"
    then
      
            for casc_dir in '' /usr/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/mpi.h
      else
         casc_header=mpi.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:5539: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5544 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
         break 
else
  echo "$ac_t""no" 1>&6
fi


   done

      

   unset casc_header_found

      MPIINCLUDE="$MPIINCLUDE $INCLUDES"
      
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:5591: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="$MPILIBDIRS $MPILIBS $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 5599 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:5606: \"$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
  MPILIBS="$MPILIBS -lmpi"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/lib; do

         echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:5631: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="-L$casc_lib_dir $MPILIBDIRS $MPILIBS -lmpi $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 5639 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:5646: \"$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
  MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
            MPILIBS="$MPILIBS -lmpi"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


      if test -z "$MPILIBS" ; then
        echo "configure: warning: MPI not found--in IRIX64 test-must set manually using --with-flags" 1>&2
      fi
    fi

    if test -z "$CFLAGS"; then
      
   if test -z "$COPT"; then
      COPT="-O -64 -OPT:Olimit=0"
   fi
   

      if test "$casc_using_openmp" = "yes" ; then
        CFLAGS="$CFLAGS -mp"
      fi
    fi
    if test -z "$CXXFLAGS"; then
      
   if test -z "$CXXOPT"; then
      CXXOPT="-64"
   fi
   

      if test "$casc_using_openmp" = "yes" ; then
        CXXFLAGS="$CXXFLAGS -mp"
      fi
    fi
    if test -z "$F77FLAGS"; then
      
   if test -z "$FOPT"; then
      FOPT="-O -64"
   fi
   

      if test "$casc_using_openmp" = "yes" ; then
        F77FLAGS="$F77FLAGS -mp"
      fi
    fi
    LDFLAGS="$LDFLAGS -O -64"
    
   if test -z "$CDEBUG"; then
      CDEBUG="-g"
   fi
   

    
   if test -z "$CXXDEBUG"; then
      CXXDEBUG="-g"
   fi
   

    
   if test -z "$FDEBUG"; then
      FDEBUG="-g"
   fi
   

  ;;
   
esac

case $ARCH in
  sun4 | solaris )
    cat >> confdefs.h <<\EOF
#define HYPRE_SOLARIS 1
EOF

  ;;
  LINUX | Linux )
    cat >> confdefs.h <<\EOF
#define HYPRE_LINUX 1
EOF

  ;;
  alpha)
    cat >> confdefs.h <<\EOF
#define HYPRE_ALPHA 1
EOF

    if test -z "$casc_using_blas" ; then
      casc_using_blas=yes
    fi
  ;;
  rs6000)
    cat >> confdefs.h <<\EOF
#define HYPRE_RS6000 1
EOF

    if test -z "$casc_using_blas" ; then
      casc_using_blas=yes
    fi
  ;;
  IRIX64)
    cat >> confdefs.h <<\EOF
#define HYPRE_IRIX64 1
EOF

  ;;
esac

if test -z "$CC" ; then
  if test "$casc_using_mpi" = "no" ; then
    for ac_prog in cc kcc gcc c89
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:5793: 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

  else 
    for ac_prog in mpicc mpcc tmcc hcc
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:5828: 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

  fi

  if test "$CC" = "cc" ||
     test "$CC" = "gcc" ||
     test "$CC" = "kcc" &&
     test "$casc_user_chose_mpi" = "no" &&
     test "$casc_using_mpi" = "yes"
  then
    
            for casc_dir in '' /usr/include /usr/local/include /usr/local/mpi/include ; do
      if test -n "$casc_dir"; then
         casc_header=$casc_dir/mpi.h
      else
         casc_header=mpi.h
      fi

            ac_safe=`echo "$casc_header" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_header""... $ac_c" 1>&6
echo "configure:5875: checking for $casc_header" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5880 "configure"
#include "confdefs.h"
#include <$casc_header>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5885: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  if test -n "$casc_dir"; then
            INCLUDES="$INCLUDES -I$casc_dir"
         fi
         casc_header_found=yes
         
         break 
else
  echo "$ac_t""no" 1>&6
fi


   done

      

   unset casc_header_found

    MPIINCLUDE="$MPIINCLUDE $INCLUDES"
    
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:5927: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="$MPILIBDIRS $MPILIBS $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 5935 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:5942: \"$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
  MPILIBS="$MPILIBS -lmpi"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/lib /usr/local/lib /usr/local/mpi/lib; do

         echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
echo "configure:5967: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | 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="-L$casc_lib_dir $MPILIBDIRS $MPILIBS -lmpi $LIBS -lmpi"
cat > conftest.$ac_ext <<EOF
#line 5975 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:5982: \"$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
  MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
            MPILIBS="$MPILIBS -lmpi"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


    if test -z "$MPILIBS" ; then
      echo "configure: warning: MPI not found--in default test-must set manually using --with-flags" 1>&2
    fi
  fi

  if test "$CC" = "kcc" ; then
    
   if test -z "$COPT"; then
      COPT="-o5"
   fi
   

  else 
    
   if test -z "$COPT"; then
      COPT="-O"
   fi
   

  fi
fi
if test -z "$CXX" ; then
  if test "$casc_using_mpi" = "no" ; then
    for ac_prog in cxx CC KCC g++
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:6050: 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
 
  else 
    for ac_prog in mpiCC
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:6085: 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

  fi
fi
if test -z "$F77" ; then
  if test "$casc_using_mpi" = "no" ; then
    for ac_prog in f77 kf77 g77
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:6123: 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

  else 
    for ac_prog in mpif77
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:6158: 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

  fi
  if test "$F77" = "kf77"  ;then
    
   if test -z "$FOPT"; then
      FOPT="-o5"
   fi
   

  else 
    
   if test -z "$FOPT"; then
      FOPT="-O"
   fi
   

  fi
fi


echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:6207: 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 6222 "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:6228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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 6239 "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:6245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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 6256 "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:6262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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

echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:6287: 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 6300 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | 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=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
CXXCPP="$ac_cv_prog_CXXCPP"
echo "$ac_t""$CXXCPP" 1>&6


   for ac_prog in fpp cpp "$CC -E" "cc -E" "gcc -E"
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:6335: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_FPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$FPP"; then
  ac_cv_prog_FPP="$FPP" # 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_FPP="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
FPP="$ac_cv_prog_FPP"
if test -n "$FPP"; then
  echo "$ac_t""$FPP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$FPP" && break
done

   test -z "$FPP" && { echo "configure: error: no acceptable fpp found in \$PATH" 1>&2; exit 1; }



if test "$casc_user_chose_compilers" = "yes" &&
   test "$casc_using_mpi" = "yes" && 
   test "$casc_user_chose_mpi" = "no"
then
  
   echo $ac_n "checking the architecture""... $ac_c" 1>&6
echo "configure:6374: checking the architecture" >&5

         if test -z "$ARCH"; then

                        casc_tarch_dir=
      for casc_dir in $srcdir $srcdir/.. $srcdir/../.. $srcdir/config; do
         if test -f $casc_dir/tarch; then
            casc_tarch_dir=$casc_dir
            casc_tarch=$casc_tarch_dir/tarch
            break
         fi
      done

                  if test -z "$casc_tarch_dir"; then
         echo "configure: warning: cannot find tarch, using \$HOSTTYPE as the architecture" 1>&2
         ARCH=$HOSTTYPE
      else
         ARCH="`$casc_tarch`"

         if test -z "$ARCH" || test "$ARCH" = "unknown"; then
            ARCH=$HOSTTYPE
         fi
      fi

            if test -z "$ARCH"; then
         ARCH=unknown
         echo "configure: warning: architecture is unknown" 1>&2
      else
         echo "$ac_t""$ARCH" 1>&6
      fi    
   else
      echo "$ac_t""$ARCH" 1>&6
   fi

   




   casc_find_mpi_cache_used=yes

   echo $ac_n "checking for MPI""... $ac_c" 1>&6
echo "configure:6416: checking for MPI" >&5
   if eval "test \"`echo '$''{'casc_cv_mpi_include'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  casc_find_mpi_cache_used=no
fi

   if eval "test \"`echo '$''{'casc_cv_mpi_libs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  casc_find_mpi_cache_used=no
fi

   if eval "test \"`echo '$''{'casc_cv_mpi_lib_dirs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  casc_find_mpi_cache_used=no
fi

   if eval "test \"`echo '$''{'casc_cv_mpi_flags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  casc_find_mpi_cache_used=no
fi

   echo "$ac_t""" 1>&6

   if test "$casc_find_mpi_cache_used" = "yes"; then
      echo $ac_n "checking for location of mpi.h""... $ac_c" 1>&6
echo "configure:6445: checking for location of mpi.h" >&5
      MPIINCLUDE=$casc_cv_mpi_include
      echo "$ac_t"""\(cached\) $MPIINCLUDE"" 1>&6

      echo $ac_n "checking for MPI library directories""... $ac_c" 1>&6
echo "configure:6450: checking for MPI library directories" >&5
      MPILIBDIRS=$casc_cv_mpi_lib_dirs
      echo "$ac_t"""\(cached\) $MPILIBDIRS"" 1>&6

      echo $ac_n "checking for MPI libraries""... $ac_c" 1>&6
echo "configure:6455: checking for MPI libraries" >&5
      MPILIBS=$casc_cv_mpi_libs
      echo "$ac_t"""\(cached\) $MPILIBS"" 1>&6

      echo $ac_n "checking for other MPI-related flags""... $ac_c" 1>&6
echo "configure:6460: checking for other MPI-related flags" >&5
      MPIFLAGS=$casc_cv_mpi_flags
      echo "$ac_t"""\(cached\) $MPIFLAGS"" 1>&6
   else
   

            
      casc_user_chose_mpi=no
      # Check whether --with-mpi-include or --without-mpi-include was given.
if test "${with_mpi_include+set}" = set; then
  withval="$with_mpi_include"
  for mpi_dir in $withval; do
                     MPIINCLUDE="$MPIINCLUDE -I$withval"
                  done; casc_user_chose_mpi=yes
fi


      # Check whether --with-mpi-libs or --without-mpi-libs was given.
if test "${with_mpi_libs+set}" = set; then
  withval="$with_mpi_libs"
  for mpi_lib in $withval; do
                     MPILIBS="$MPILIBS -l$mpi_lib"
                  done; casc_user_chose_mpi=yes
fi



      # Check whether --with-mpi-lib-dirs or --without-mpi-lib-dirs was given.
if test "${with_mpi_lib_dirs+set}" = set; then
  withval="$with_mpi_lib_dirs"
  for mpi_lib_dir in $withval; do
                     MPILIBDIRS="-L$mpi_lib_dir $MPILIBDIRS"
                  done; casc_user_chose_mpi=yes
fi


            
      # Check whether --with-mpi-flags or --without-mpi-flags was given.
if test "${with_mpi_flags+set}" = set; then
  withval="$with_mpi_flags"
  MPIFLAGS=$withval
fi


         for ac_prog in mpcc mpicc tmcc hcc
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:6509: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MPICC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$MPICC"; then
  ac_cv_prog_MPICC="$MPICC" # 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_MPICC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
MPICC="$ac_cv_prog_MPICC"
if test -n "$MPICC"; then
  echo "$ac_t""$MPICC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MPICC" && break
done


         if test -z "$MPICC"; then
            echo "configure: warning: no acceptable mpicc found in \$PATH" 1>&2
            

         ac_help="$ac_help
  --with-mpi-include=DIR  mpi.h is in DIR"
# Check whether --with-mpi-include or --without-mpi-include was given.
if test "${with_mpi_include+set}" = set; then
  withval="$with_mpi_include"
  casc_mpi_include_dir=$withval
fi


      ac_help="$ac_help
  --with-mpi-libs=LIBS    LIBS is space-separated list of library names
                          needed for MPI, e.g. \"nsl socket mpi\""
# Check whether --with-mpi-libs or --without-mpi-libs was given.
if test "${with_mpi_libs+set}" = set; then
  withval="$with_mpi_libs"
  casc_mpi_libs=$withval
fi


      ac_help="$ac_help
  --with-mpi-lib-dirs=DIRS
                          DIRS is space-separated list of directories
                          containing the libraries specified by
                          \`--with-mpi-libs', e.g \"/usr/lib /usr/local/mpi/lib\""
# Check whether --with-mpi-lib-dirs or --without-mpi-lib-dirs was given.
if test "${with_mpi_lib_dirs+set}" = set; then
  withval="$with_mpi_lib_dirs"
  casc_mpi_lib_dirs=$withval
fi

   

   if test -z "$casc_mpi_libs"; then
      

            case $ARCH in

         sun4 | solaris)
            case $F77 in
               *g77)
                   if test -z "$casc_mpi_include_dir"; then
                      casc_mpi_include_dir=/usr/local/mpi/lam/h
                   fi
                   
                   if test -z "$casc_mpi_lib_dirs"; then
                      casc_mpi_lib_dirs="/usr/local/mpi/lam/lib"
                   fi

                   casc_mpi_libs="socket mpi trillium args tstdio t";;

               *)

                  if test -z "$casc_mpi_include_dir"; then
                     MPIINCLUDE="-I/usr/local/mpi/mpich/include \
                                 -I/usr/local/mpi/mpich/lib/solaris/ch_p4"
                  fi

                  if test -z "$casc_mpi_lib_dirs"; then
                     casc_mpi_lib_dirs="/usr/local/mpi/mpich/lib/solaris/ch_p4 \
                                       /usr/lib"
                  fi
            
               casc_mpi_libs="nsl socket mpi";;
               esac

            if test -z "$MPIINCLUDE"; then
               ac_safe=`echo "$casc_mpi_include_dir/mpi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_mpi_include_dir/mpi.h""... $ac_c" 1>&6
echo "configure:6611: checking for $casc_mpi_include_dir/mpi.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6616 "configure"
#include "confdefs.h"
#include <$casc_mpi_include_dir/mpi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MPIINCLUDE="-I$casc_mpi_include_dir"
else
  echo "$ac_t""no" 1>&6
fi

            fi
         ;;

         alpha)
            if test -z "$casc_mpi_include_dir"; then
               casc_mpi_include_dir=/usr/local/mpi/include
            fi
            ac_safe=`echo "$casc_mpi_include_dir/mpi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_mpi_include_dir/mpi.h""... $ac_c" 1>&6
echo "configure:6651: checking for $casc_mpi_include_dir/mpi.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6656 "configure"
#include "confdefs.h"
#include <$casc_mpi_include_dir/mpi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MPIINCLUDE="-I$casc_mpi_include_dir"
else
  echo "$ac_t""no" 1>&6
fi


            if test -z "$casc_mpi_lib_dirs"; then
               casc_mpi_lib_dirs="/usr/local/mpi/lib/alpha/ch_shmem \
                                  /usr/local/lib"
            fi

            casc_mpi_libs="mpich gs";;

         rs6000) 
            if test -z "$casc_mpi_include_dir"; then
               casc_mpi_include_dir=/usr/lpp/ppe.poe/include
            fi
            ac_safe=`echo "$casc_mpi_include_dir/mpi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_mpi_include_dir/mpi.h""... $ac_c" 1>&6
echo "configure:6696: checking for $casc_mpi_include_dir/mpi.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6701 "configure"
#include "confdefs.h"
#include <$casc_mpi_include_dir/mpi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MPIINCLUDE="-I$casc_mpi_include_dir"
else
  echo "$ac_t""no" 1>&6
fi


            if test -z "$casc_mpi_lib_dirs"; then
               casc_mpi_lib_dirs=/usr/lpp/ppe.poe/lib
            fi

            casc_mpi_libs=mpi

            MPIFLAGS="-binitfini:poe_remote_main";;

         IRIX64 | iris4d) 
            if test -z "$casc_mpi_include_dir"; then
               casc_mpi_include_dir=/usr/local/mpi/include
            fi
            ac_safe=`echo "$casc_mpi_include_dir/mpi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_mpi_include_dir/mpi.h""... $ac_c" 1>&6
echo "configure:6742: checking for $casc_mpi_include_dir/mpi.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6747 "configure"
#include "confdefs.h"
#include <$casc_mpi_include_dir/mpi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MPIINCLUDE="-I$casc_mpi_include_dir"
else
  echo "$ac_t""no" 1>&6
fi


            if test -z "$casc_mpi_lib_dirs"; then
               casc_mpi_lib_dirs=/usr/local/mpi/lib/IRIX64/ch_p4
            fi

            casc_mpi_libs=mpi;; 
        
         *)
echo "configure: warning: trying naive MPI settings - can use --with flags to change" 1>&2
            if test -z "$casc_mpi_include_dir"; then
               casc_mpi_include_dir=/usr/local/mpi/include
            fi
            ac_safe=`echo "$casc_mpi_include_dir/mpi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $casc_mpi_include_dir/mpi.h""... $ac_c" 1>&6
echo "configure:6787: checking for $casc_mpi_include_dir/mpi.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6792 "configure"
#include "confdefs.h"
#include <$casc_mpi_include_dir/mpi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MPIINCLUDE="-I$casc_mpi_include_dir"
else
  echo "$ac_t""no" 1>&6
fi


            if test -z "$casc_mpi_lib_dirs"; then
               casc_mpi_lib_dirs=/usr/local/mpi/lib
            fi
            casc_mpi_libs=mpi ;;
      esac

      for casc_lib in $casc_mpi_libs; do
         
   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -l$casc_lib""... $ac_c" 1>&6
echo "configure:6834: checking for main in -l$casc_lib" >&5
ac_lib_var=`echo $casc_lib'_'main | 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="$MPILIBDIRS $MPILIBS $LIBS -l$casc_lib"
cat > conftest.$ac_ext <<EOF
#line 6842 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:6849: \"$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
  MPILIBS="$MPILIBS -l$casc_lib"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in $casc_mpi_lib_dirs; do

         echo $ac_n "checking for main in -l$casc_lib""... $ac_c" 1>&6
echo "configure:6874: checking for main in -l$casc_lib" >&5
ac_lib_var=`echo $casc_lib'_'main | 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="-L$casc_lib_dir $MPILIBDIRS $MPILIBS -l$casc_lib $LIBS -l$casc_lib"
cat > conftest.$ac_ext <<EOF
#line 6882 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:6889: \"$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
  MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
            MPILIBS="$MPILIBS -l$casc_lib"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   


      done

   else
      if test -n "$casc_mpi_include_dir"; then
         MPIINCLUDE="-I$casc_mpi_include_dir"
      else
         MPIINCLUDE=
      fi

      if test -n "$casc_mpi_lib_dirs"; then
         for casc_lib_dir in $casc_mpi_lib_dirs; do
            MPILIBDIRS="-L$casc_lib_dir $MPILIBDIRS"
         done
      else
         MPILIBDIRS=
      fi

      for casc_lib in $casc_mpi_libs; do
         MPILIBS="$MPILIBS -l$casc_lib"
      done
   fi

            if test -z "$MPILIBS"; then
               echo "configure: warning: MPI not found - must set manually using --with flags" 1>&2
            fi

                  
         else      
 
            
            echo $ac_n "checking for location of mpi.h""... $ac_c" 1>&6
echo "configure:6960: checking for location of mpi.h" >&5

                                    cat > mpconftest.c << EOF
#include "mpi.h"

main(int argc, char **argv)
{
   int rank, size;
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Finalize();
   return 0;
}
EOF

            casc_mplibs=
            casc_mplibdirs=
            casc_flags=
            casc_lmpi_exists=no

                                    
            for casc_command in "$MPICC -show"\
                                "$MPICC -v"\
                                "$MPICC -#"\
                                "$MPICC"; do

               casc_this_output=`$casc_command mpconftest.c -o mpconftest 2>&1`

                              xlc_p=`echo $casc_this_output | grep xlcentry`
               if test -n "$xlc_p"; then
                  casc_this_output=`echo $casc_this_output | sed 's/,/ /g'`
               fi

                              lmpi_p=`echo $casc_this_output | grep "\-lmpi"`
               if test -n "$lmpi_p"; then
                  casc_lmpi_exists=yes
               fi

               casc_mpoutput="$casc_mpoutput $casc_this_output"
               casc_this_output=

            done

            rm -rf mpconftest*

                        echo "main() {}" > cc_conftest.c
            cc_output=`${CC-cc} -v -o cc_conftest cc_conftest.c 2>&1`
            xlc_p=`echo $cc_output | grep xlcentry`
            if test -n "$xlc_p"; then
               casc_compiler_is_xlc=yes
            fi 
            rm -rf cc_conftest*

                                    if test "$casc_lmpi_exists" = "no"; then
               casc_mplibs="-lmpi"
            else
               casc_mplibs=
            fi

            casc_want_arg=

                                                                                                                                                
            for casc_arg in $casc_mpoutput; do
 
               casc_old_want_arg=$casc_want_arg
               casc_want_arg=  

               if test -n "$casc_old_want_arg"; then
                  case "$casc_arg" in
                  -*)
                     casc_old_want_arg=
                  ;;
                  esac
               fi

               case "$casc_old_want_arg" in
               '')
                  case $casc_arg in
                  /*.a)
                     exists=false
                     for f in $casc_flags; do
                        if test x$casc_arg = x$f; then
                           exists=true
                        fi
                     done
                     if $exists; then
                        casc_arg=
                     else
                        casc_flags="$casc_flags $casc_arg"
                     fi
                  ;;
                  -binitfini:poe_remote_main)
                     exists=false
                     for f in $casc_flags; do
                        if test x$casc_arg = x$f; then
                           exists=true
                        fi
                     done
                     if $exists; then
                        casc_arg=
                     else
                        casc_flags="$casc_flags $casc_arg"
                     fi
                  ;;
                  -lang*)
                     casc_arg=
                  ;;
                  -[lLR])
                     casc_want_arg=$casc_arg
                     casc_arg=
                  ;;
                  -[lLR]*)
                     exists=false
                     for f in $casc_flags; do
                        if test x$casc_arg = x$f; then
                           exists=true
                        fi
                     done
                     if $exists; then
                        casc_arg=
                     else
                       casc_flags="$casc_flags $casc_arg"
                     fi
                  ;;
                  -u)
                     casc_want_arg=$casc_arg
                     casc_arg=
                  ;;
                  -Y)
                     casc_want_arg=$casc_arg
                     casc_arg=
                  ;;
                  -I)
                     casc_want_arg=$casc_arg
                     casc_arg=
                  ;;
                  -I*)
                     exists=false
                     for f in $casc_flags; do
                        if test x$casc_arg = x$f; then
                           exists=true
                        fi
                     done
                     if $exists; then
                        casc_arg=
                     else
                        casc_flags="$casc_flags $casc_arg"
                     fi
                  ;;
                  *)
                     casc_arg=
                  ;;
                  esac

               ;;
               -[lLRI])
                  casc_arg="casc_old_want_arg $casc_arg"
               ;;
               -u)
                  casc_arg="-u $casc_arg"
               ;;
               -Y)
                  casc_arg=`echo $casc_arg | sed -e 's%^P,%%'`
                  SAVE_IFS=$IFS
                  IFS=:
                  casc_list=
                  for casc_elt in $casc_arg; do
                     casc_list="$casc_list -L$casc_elt"
                  done
                  IFS=$SAVE_IFS
                  casc_arg="$casc_list"
               ;;
               esac

                                             if test -n "$casc_arg"; then
                  case $casc_arg in
                  -I*)

                                                               if test -z "$MPIINCLUDE"; then
                        casc_cppflags="$casc_cppflags $casc_arg"
                        casc_include_dir=`echo "$casc_arg" | sed 's/-I//g'` 

                        SAVE_CPPFLAGS="$CPPFLAGS"
                        CPPFLAGS="$casc_cppflags"
                        
                        unset ac_cv_header_mpi_h
                        ac_safe=`echo "mpi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for mpi.h""... $ac_c" 1>&6
echo "configure:7149: 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
  cat > conftest.$ac_ext <<EOF
#line 7154 "configure"
#include "confdefs.h"
#include <mpi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MPIINCLUDE="$casc_cppflags"
else
  echo "$ac_t""no" 1>&6
fi


                                                CPPFLAGS="$SAVE_CPPFLAGS"

                     else
                        casc_arg=
                     fi
                  ;;
                  -[LR]*)

                                          casc_mplibdirs="$casc_mplibdirs $casc_arg"
                  ;;
                  -l* | /*)

                                          casc_mplibs="$casc_mplibs $casc_arg"
                  ;;
                  -binitfini:poe_remote_main)
                     if test "$casc_compiler_is_xlc" = "yes"; then
                        casc_mpflags="$casc_mpflags $casc_arg"
                     fi
                  ;;
                  *)
                                          casc_mpflags="$casc_mpflags $casc_arg"
                  ;;
                  esac

                                                      LIBS_SAVE=$LIBS
                  LIBS="$MPIINCLUDE $casc_mpflags $casc_mplibdirs $casc_mplibs"

                  if test -n "`echo $LIBS | grep '\-R/'`"; then
                     LIBS=`echo $LIBS | sed 's/-R\//-R \//'`
                  fi

                  

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

int main() {
int rank, size;
   int argc;
   char **argv;
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Finalize();

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

                  LIBS=$LIBS_SAVE

                  if test "$casc_result" = yes; then
                     casc_result=
                     break
                  fi
               fi
            done

                        MPILIBS=$casc_mplibs
            MPILIBDIRS=$casc_mplibdirs
            MPIFLAGS="$MPIFLAGS $casc_mpflags"

                                                            

            if test -n "`echo $MPILIBS | grep pmpich`" &&
               test -z "`echo $MPILIBS | grep pthread`"; then
                  LIBS_SAVE=$LIBS
                  LIBS="$MPIINCLUDE $MPIFLAGS $MPILIBDIRS $MPILIBS -lpthread"
                  cat > conftest.$ac_ext <<EOF
#line 7259 "configure"
#include "confdefs.h"
#include "mpi.h"

int main() {
int rank, size;
   int argc;
   char **argv;
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Finalize();

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


            echo "$ac_t""$MPIINCLUDE" 1>&6
            echo $ac_n "checking for MPI library directories""... $ac_c" 1>&6
echo "configure:7289: checking for MPI library directories" >&5
            echo "$ac_t""$MPILIBDIRS" 1>&6
            echo $ac_n "checking for MPI libraries""... $ac_c" 1>&6
echo "configure:7292: checking for MPI libraries" >&5
            echo "$ac_t""$MPILIBS" 1>&6
            echo $ac_n "checking for other MPI-related flags""... $ac_c" 1>&6
echo "configure:7295: checking for other MPI-related flags" >&5
            echo "$ac_t""$MPIFLAGS" 1>&6
         fi
      

      if eval "test \"`echo '$''{'casc_cv_mpi_include'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  casc_cv_mpi_include=$MPIINCLUDE
fi

      if eval "test \"`echo '$''{'casc_cv_mpi_lib_dirs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  casc_cv_mpi_lib_dirs=$MPILIBDIRS
fi

      if eval "test \"`echo '$''{'casc_cv_mpi_libs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  casc_cv_mpi_libs=$MPILIBS
fi

      if eval "test \"`echo '$''{'casc_cv_mpi_flags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  casc_cv_mpi_flags=$MPIFLAGS
fi

   fi

   
   
   
   


fi

HYPRE_BABELLIBDIR=""
if test "$casc_using_babel" = "yes"
then
# jfp still unsatisfactory...
 BABEL_DIR="${HOME}/babel-0.4.1/source/runtime/"
 BABEL_HYPRE_INCLUDES="\
 -I../hypre/include\
 -I../babel/Hypre\
 -I../babel\
 -I../babel/babel\
 -I../babel/babel_stubs_c\
 -I${BABEL_DIR}\
 -I${BABEL_DIR}/babel"
BABELLIBFLAGS="-L../babel/Hypre -lhypre_class -L${BABEL_DIR}/babel -lbabel"
# jfp: ...above line is normal, following is for temporary Fortran+C work...
#BABELLIBFLAGS="-L../babel/Hypre -lhypre_class -L../babel/Hypre_C1 -lhypre_class_C1 -L${BABEL_DIR}/babel -lbabel"

 babeldir="$HOME"
 

 HYPRE_BABELLIBDIR="$HYPRE_TOP_SRC_DIR/babel/Hypre"



  ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 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.

# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:7389: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    case "$ac_dir/" in
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL="$ac_cv_path_install"
  else
    # As a last resort, use the slow shell script.  We don't cache a
    # path for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the path is relative.
    INSTALL="$ac_install_sh"
  fi
fi
echo "$ac_t""$INSTALL" 1>&6

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'

echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
echo "configure:7442: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   if test "$*" = "X"; then
      # -L didn't work.
      set X `ls -t $srcdir/configure conftestfile`
   fi
   if test "$*" != "X $srcdir/configure conftestfile" \
      && test "$*" != "X conftestfile $srcdir/configure"; then

      # If neither matched, then we have a broken ls.  This can happen
      # if, for instance, CONFIG_SHELL is bash and it inherits a
      # broken ls alias from the environment.  This has actually
      # happened.  Such a system could not be considered "sane".
      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment" 1>&2; exit 1; }
   fi

   test "$2" = conftestfile
   )
then
   # Ok.
   :
else
   { echo "configure: error: newly created file is older than distributed files!
Check your system clock" 1>&2; exit 1; }
fi
rm -f conftest*
echo "$ac_t""yes" 1>&6
if test "$program_transform_name" = s,x,x,; then
  program_transform_name=
else
  # Double any \ or $.  echo might interpret backslashes.
  cat <<\EOF_SED > conftestsed
s,\\,\\\\,g; s,\$,$$,g
EOF_SED
  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
  rm -f conftestsed
fi
test "$program_prefix" != NONE &&
  program_transform_name="s,^,${program_prefix},; $program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"

# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:7499: 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


PACKAGE=

VERSION=

if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
fi
cat >> confdefs.h <<EOF
#define PACKAGE "$PACKAGE"
EOF

cat >> confdefs.h <<EOF
#define VERSION "$VERSION"
EOF



missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
echo "configure:7545: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (aclocal --version) < /dev/null > /dev/null 2>&1; then
   ACLOCAL=aclocal
   echo "$ac_t""found" 1>&6
else
   ACLOCAL="$missing_dir/missing aclocal"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
echo "configure:7558: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
   AUTOCONF=autoconf
   echo "$ac_t""found" 1>&6
else
   AUTOCONF="$missing_dir/missing autoconf"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working automake""... $ac_c" 1>&6
echo "configure:7571: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (automake --version) < /dev/null > /dev/null 2>&1; then
   AUTOMAKE=automake
   echo "$ac_t""found" 1>&6
else
   AUTOMAKE="$missing_dir/missing automake"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
echo "configure:7584: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoheader --version) < /dev/null > /dev/null 2>&1; then
   AUTOHEADER=autoheader
   echo "$ac_t""found" 1>&6
else
   AUTOHEADER="$missing_dir/missing autoheader"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
echo "configure:7597: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
   MAKEINFO=makeinfo
   echo "$ac_t""found" 1>&6
else
   MAKEINFO="$missing_dir/missing makeinfo"
   echo "$ac_t""missing" 1>&6
fi


fi

if test "$casc_using_mli" = "yes"
then
   MLI_DIR="$HYPRE_TOP_SRC_DIR/mli/matrix"
   MLILIBS="-lHYPRE_mli_mat"
   MLILIBDIRS="-L $MLI_DIR"
   MLIINCLUDE="-I $MLI_DIR"
   MLILIBDIRS="$MLILIBDIRS -L/usr/openwin/lib"
   MLILIBS="$MLILIBS -lX11"
fi

if test "$casc_using_petsc" = "yes"
then
   
         casc_opt=yes
   casc_debug=no
   casc_both=no

            # Check whether --enable-opt or --disable-opt was given.
if test "${enable_opt+set}" = set; then
  enableval="$enable_opt"
  casc_opt=yes; casc_enable_opt_called=yes; 
else
  casc_enable_opt_called=no 
fi


                     # Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval="$enable_debug"
  casc_debug=yes
                 if test "$casc_enable_opt_called" = "no"; then
                    casc_opt=no
                 else
                    casc_both=yes
                 fi 
fi


                        if test "$casc_both" = "no"; then
      if test "$casc_opt" = "yes"; then
         CDEBUG=
         CXXDEBUG=
         FDEBUG=
         OPTCHOICE=O
      else
         COPT=
         CXXOPT=
         FOPT=  
         OPTCHOICE=g
      fi
   else
      OPTCHOICE=O
   fi

   



   echo $ac_n "checking for  directory""... $ac_c" 1>&6
echo "configure:7671: checking for  directory" >&5

                           casc_result=
   casc_env__dir=$_DIR
   _DIR=

   # Check whether --with--dir or --without--dir was given.
if test "${with__dir+set}" = set; then
  withval="$with__dir"
  if test "$withval" = "no"; then
                  casc_result="configuring without "
                  _DIR=
               fi
               
fi


                                                                                                         
   if test "$with__dir" != "no"; then

      if test -d "$with__dir"; then

         

               casc_result="$with__dir"
               _DIR="$casc_result"

         
      fi

      if test -z "$casc_result"; then

         if test -d "$casc_env__dir"; then

            

                  casc_result="$casc_env__dir"
                  _DIR="$casc_result"

            
         fi
      fi



      if test -z "$casc_result"; then
         _DIR=
   
         casc_result="none" 
      fi
   fi

               
   if test "$casc_result" = "none"; then

      if test -n "$casc_env__dir"; then

         casc_result="$casc_env__dir"
         _DIR="$casc_result"
      fi
   fi

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


 
 
 
   echo $ac_n "checking for PETSC directory""... $ac_c" 1>&6
echo "configure:7741: checking for PETSC directory" >&5

                           casc_result=
   casc_env_PETSC_dir=$PETSC_DIR
   PETSC_DIR=

   # Check whether --with-PETSC-dir or --without-PETSC-dir was given.
if test "${with_PETSC_dir+set}" = set; then
  withval="$with_PETSC_dir"
  if test "$withval" = "no"; then
                  casc_result="configuring without PETSC"
                  PETSC_DIR=
               fi
               
fi


                                                                                                         
   if test "$with_PETSC_dir" != "no"; then

      if test -d "$with_PETSC_dir"; then

         if test -f $with_PETSC_dir/include/petsc.h; then

               casc_result="$with_PETSC_dir"
               PETSC_DIR="$casc_result"

         fi
      fi

      if test -z "$casc_result"; then

         if test -d "$casc_env_PETSC_dir"; then

            if test -f $casc_env_PETSC_dir/include/petsc.h; then

                  casc_result="$casc_env_PETSC_dir"
                  PETSC_DIR="$casc_result"

            fi
         fi
      fi



      if test -z "$casc_result"; then
         PETSC_DIR=
   
         for casc_dir in /usr/local/petsc /usr/local/apps/petsc \
                            /home/casc/petsc-2.0.22; do

               if test -d "$casc_dir"; then

                  if test -f $casc_dir/include/petsc.h; then

                        PETSC_DIR=$casc_dir

                        break

                  fi
               fi
            done

            if test -z "$PETSC_DIR"; then
               casc_result="none"

            else
               casc_result="$PETSC_DIR"
            fi
         
      fi
   fi

               
   if test "$casc_result" = "none"; then

      if test -n "$casc_env_PETSC_dir"; then

         casc_result="$casc_env_PETSC_dir"
         PETSC_DIR="$casc_result"
      fi
   fi

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

   
   casc_user_chose_petscinc=no
   # Check whether --with-petsc-include or --without-petsc-include was given.
if test "${with_petsc_include+set}" = set; then
  withval="$with_petsc_include"
  for petsc_inc in $withval; do
                 PETSCINCLUDE="$PETSCINCLUDE -I$petsc_inc"
               done; casc_user_chose_petscinc=yes
fi

   
   casc_user_chose_petsclibs=no
   # Check whether --with-petsc-libs or --without-petsc-libs was given.
if test "${with_petsc_libs+set}" = set; then
  withval="$with_petsc_libs"
  for petsc_lib in $withval; do
                 PETSCLIBS="$PETSCLIBS -l$petsc_lib"
               done; casc_user_chose_petsclibs=yes
fi


   casc_user_chose_petsclibdirs=no
   # Check whether --with-petsc-lib-dirs or --without-petsc-lib-dirs was given.
if test "${with_petsc_lib_dirs+set}" = set; then
  withval="$with_petsc_lib_dirs"
  for petsc_lib_dir in $withval; do
                 PETSCLIBDIRS="$PETSCLIBDIRS -L$petsc_lib_dir"
               done; casc_user_chose_petsclibdirs=yes
fi


 if test -z "$PETSC_DIR"; then
   echo "configure: warning: PETSC not found - must set manually using --with-PETSC-dir" 1>&2
   cat >> confdefs.h <<\EOF
#define LACKS_PETSC 1
EOF

   have_PETSC=no   
 else
   cat >> confdefs.h <<\EOF
#define HAVE_PETSC 1
EOF

   have_PETSC=yes
               
      echo $ac_n "checking for PETSc libraries""... $ac_c" 1>&6
echo "configure:7873: checking for PETSc libraries" >&5
   
      if test "$casc_user_chose_petsclibs" = "no"; then
      PETSCLIBS="-lpetscvec -lpetscts -lpetscsys -lpetscsnes -lpetscsles \
                 -lpetscmat -lpetscgvec -lpetscfortran -lpetsccontrib \
                 -lmpiuni"
   fi
   if test "$casc_user_chose_petsclibdirs" = "no"; then
      PETSCLIBDIRS="-L$PETSC_DIR/lib/lib$OPTCHOICE/$ARCH"
   fi
   if test "$casc_user_chose_petscinc" = "no"; then
      PETSCINCLUDE="-I$PETSC_DIR -I$PETSC_DIR/include -I$PETSC_DIR/src/vec \
                    -I$PETSC_DIR/src/vec -I$PETSC_DIR/bmake/$ARCH"
   fi

 fi

   PETSCLIBDIRS="$PETSCLIBDIRS -L/usr/openwin/lib"
   PETSCLIBS="$PETSCLIBS -lX11"
fi


if test "$casc_user_chose_compilers" = "no"
then
  
         casc_opt=yes
   casc_debug=no
   casc_both=no

            # Check whether --enable-opt or --disable-opt was given.
if test "${enable_opt+set}" = set; then
  enableval="$enable_opt"
  casc_opt=yes; casc_enable_opt_called=yes; 
else
  casc_enable_opt_called=no 
fi


                     # Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval="$enable_debug"
  casc_debug=yes
                 if test "$casc_enable_opt_called" = "no"; then
                    casc_opt=no
                 else
                    casc_both=yes
                 fi 
fi


                        if test "$casc_both" = "no"; then
      if test "$casc_opt" = "yes"; then
         CDEBUG=
         CXXDEBUG=
         FDEBUG=
         OPTCHOICE=O
      else
         COPT=
         CXXOPT=
         FOPT=  
         OPTCHOICE=g
      fi
   else
      OPTCHOICE=O
   fi

   


fi

CFLAGS="$CFLAGS $COPT $CDEBUG"
CXXFLAGS="$CXXFLAGS $CXXOPT $CXXDEBUG"
F77FLAGS="$F77FLAGS $FOPT $FDEBUG"

if test -z "$casc_using_blas"
then
  casc_using_blas=no
fi

if test "$casc_using_blas" = "yes"
then
 
   for ac_prog in f77 g77 xlf cf77 if77 nf77
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:7961: 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 f77 found in \$PATH" 1>&2; exit 1; }
   FFLAGS="-g -O"
   


   
   # 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).
   cat > confftest.f <<EOF
       subroutine mpir_init_fop( a )
       integer a
       a = 1
       return
       end
EOF
   $F77 $FFLAGS -c confftest.f > /dev/null 2>&1
   if test ! -s confftest.o ; then
        { echo "configure: error: Unable to compile a Fortran test program" 1>&2; exit 1; }
        NOF77=1
        HAS_FORTRAN=0
   elif test -z "$FORTRANNAMES" ; then
    # We have to be careful here, since the name may occur in several  
    # forms.  We try to handle this by testing for several forms
    # directly.
    if test $arch_CRAY ; then
     # Cray doesn't accept -a ...
     nameform1=`strings confftest.o | grep mpir_init_fop_  | head -1`
     nameform2=`strings confftest.o | grep MPIR_INIT_FOP   | head -1`
     nameform3=`strings confftest.o | grep mpir_init_fop   | head -1`
     nameform4=`strings confftest.o | grep mpir_init_fop__ | head -1`
    else
     nameform1=`strings -a confftest.o | grep mpir_init_fop_  | head -1`
     nameform2=`strings -a confftest.o | grep MPIR_INIT_FOP   | head -1`
     nameform3=`strings -a confftest.o | grep mpir_init_fop   | head -1`
     nameform4=`strings -a confftest.o | grep mpir_init_fop__ | head -1`
    fi
    /bin/rm -f confftest.f confftest.o
    if test -n "$nameform4" ; then
        cat >> confdefs.h <<\EOF
#define FORTRAN_DOUBLE_UNDERSCORE 1
EOF

        echo "Fortran externals are lower case and have 1 or 2 trailing underscores"
        FORTRANNAMES="FORTRANDOUBLEUNDERSCORE"
    elif test -n "$nameform1" ; then
        # We don't set this in CFLAGS; it is a default case
        cat >> confdefs.h <<\EOF
#define FORTRAN_UNDERSCORE 1
EOF

        echo "Fortran externals have a trailing underscore and are lowercase"
        FORTRANNAMES="FORTRANUNDERSCORE"
    elif test -n "$nameform2" ; then
        cat >> confdefs.h <<\EOF
#define FORTRAN_CAPS 1
EOF

        echo "Fortran externals are uppercase"
        FORTRANNAMES="FORTRANCAPS"
    elif test -n "$nameform3" ; then
        cat >> confdefs.h <<\EOF
#define FORTRAN_NO_UNDERSCORE 1
EOF

        echo "Fortran externals are lower case"
        FORTRANNAMES="FORTRANNOUNDERSCORE"
    else
        { echo "configure: error: Unable to determine the form of Fortran external names" 1>&2; exit 1; }
#       print_error "If you have problems linking, try using the -nof77 option"
#        print_error "to configure and rebuild MPICH."
        NOF77=1
        HAS_FORTRAN=0
    fi
    fi
    rm -f confftest.f confftest.o
    if test -n "$FORTRANNAMES" ; then
        WDEF="-D$FORTRANNAMES"
    fi  
    


   echo $ac_n "checking for fortran libraries""... $ac_c" 1>&6
echo "configure:8079: checking for fortran libraries" >&5
if eval "test \"`echo '$''{'casc_cv_f77flags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
      if test -z "$F77LIBFLAGS"; then

                           
  echo $ac_n "checking for Fortran libraries""... $ac_c" 1>&6
echo "configure:8088: checking for Fortran libraries" >&5
            echo "      END" > conftest.f
  foutput=`${F77-f77} -v -o conftest conftest.f 2>&1`
            xlf_p=`echo $foutput | sed -n -e '/xlfentry/p'`
  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 )
          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
                  *-*-cygwin32)
                  ;;
                  *)
                    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
    rm -f conftest.f conftest.o conftest
        FLIBS="$flibs_result"
  echo "$ac_t""$FLIBS" 1>&6


         for casc_flag in $flibs_result; do

                        case $casc_flag in
            -l* | /*)
               casc_f77_libs="$casc_f77_libs $casc_flag"
            ;;
            -L*)
               casc_f77_dirs="$casc_flag $casc_f77_dirs"
            ;;
            *)
               casc_other_flags="$casc_other_flags $casc_flag"
            ;;
            esac

         done

         F77LIBFLAGS="$casc_other_flags $casc_f77_dirs"

         if test -n "`echo $F77LIBFLAGS | grep '\-R/'`"; then
            F77LIBFLAGS=`echo $F77LIBFLAGS | sed 's/-R\//-R \//'`
         fi

                                                               for casc_flag in $casc_f77_libs; do
            case $casc_flag in
            /*)
               if test -f "$casc_flag"; then
                  F77LIBFLAGS="$F77LIBFLAGS $casc_flag"
               fi
            ;;
            -l*)
               casc_lib_name=`echo "$casc_flag" | sed 's/-l//g'`
               
   # This macro needs a f77 compiler and knowledge of the name-mangling scheme
   
   

   if test -z "$FORTRANNAMES" ; then
      NAMESTYLE="FORTRANNOUNDERSCORE"
   else
      NAMESTYLE=$FORTRANNAMES
   fi

   # This is a little subroutine to be called later by a C main function
   cat > testflib_.f << EOF
        subroutine testflib(i)
        integer i
        print *, "This tests which libraries work"
        return
        end
EOF

   $F77 -c testflib_.f 2>&5 

   # Mangle testflib's name appropriatiately
   case $NAMESTYLE in
      FORTRANDOUBLEUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANCAPS)
         THIS_FUNCTION=TESTFLIB;;

      FORTRANNOUNDERSCORE)
         THIS_FUNCTION=testflib;;

   esac

   # Checks if the LIBRARY from the argument list can be used to link
   # a C test program with testflib
   echo $ac_n "checking for $THIS_FUNCTION in -l$casc_lib_name""... $ac_c" 1>&6
echo "configure:8307: checking for $THIS_FUNCTION in -l$casc_lib_name" >&5
ac_lib_var=`echo $casc_lib_name'_'$THIS_FUNCTION | 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="testflib_.o $F77LIBFLAGS $LIBS -l$casc_lib_name"
cat > conftest.$ac_ext <<EOF
#line 8315 "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 $THIS_FUNCTION();

int main() {
$THIS_FUNCTION()
; return 0; }
EOF
if { (eval echo configure:8326: \"$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
  F77LIBFLAGS="$F77LIBFLAGS $casc_flag"
                  casc_result=yes
else
  echo "$ac_t""no" 1>&6

  
F77LIBFLAGS="$F77LIBFLAGS $casc_flag"
fi



   rm -f testflib_.o testflib_.f


 
            if test "$casc_result" = yes; then 
               casc_result=
               break
            fi
            ;;
         esac
         done
 
         # if this macro didn't work call CASC_SET_F77LIBS
         if test -z "$F77LIBFLAGS"; then
            
   
   

   if test -z "$casc_f77_libs"; then
      case $ARCH in 
         sun4 | solaris)
            case $F77 in
               *g77)
                   
   # This macro needs a f77 compiler and knowledge of the name-mangling scheme
   
   

   if test -z "$FORTRANNAMES" ; then
      NAMESTYLE="FORTRANNOUNDERSCORE"
   else
      NAMESTYLE=$FORTRANNAMES
   fi

   # This is a little subroutine to be called later by a C main function
   cat > testflib_.f << EOF
        subroutine testflib(i)
        integer i
        print *, "This tests which libraries work"
        return
        end
EOF

   $F77 -c testflib_.f 2>&5 

   # Mangle testflib's name appropriatiately
   case $NAMESTYLE in
      FORTRANDOUBLEUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANCAPS)
         THIS_FUNCTION=TESTFLIB;;

      FORTRANNOUNDERSCORE)
         THIS_FUNCTION=testflib;;

   esac

   # Checks if the LIBRARY from the argument list can be used to link
   # a C test program with testflib
   echo $ac_n "checking for $THIS_FUNCTION in -lf2c""... $ac_c" 1>&6
echo "configure:8416: checking for $THIS_FUNCTION in -lf2c" >&5
ac_lib_var=`echo f2c'_'$THIS_FUNCTION | 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="testflib_.o -L/home/casc/g77/lib -lf2c $LIBS -lf2c"
cat > conftest.$ac_ext <<EOF
#line 8424 "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 $THIS_FUNCTION();

int main() {
$THIS_FUNCTION()
; return 0; }
EOF
if { (eval echo configure:8435: \"$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
  F77LIBDIRS="-L/home/casc/g77/lib"
                                          F77LIBS="-lf2c"
                                          
else
  echo "$ac_t""no" 1>&6
fi



   rm -f testflib_.o testflib_.f

;;
               *)
                  
   # This macro needs a f77 compiler and knowledge of the name-mangling scheme
   
   

   if test -z "$FORTRANNAMES" ; then
      NAMESTYLE="FORTRANNOUNDERSCORE"
   else
      NAMESTYLE=$FORTRANNAMES
   fi

   # This is a little subroutine to be called later by a C main function
   cat > testflib_.f << EOF
        subroutine testflib(i)
        integer i
        print *, "This tests which libraries work"
        return
        end
EOF

   $F77 -c testflib_.f 2>&5 

   # Mangle testflib's name appropriatiately
   case $NAMESTYLE in
      FORTRANDOUBLEUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANCAPS)
         THIS_FUNCTION=TESTFLIB;;

      FORTRANNOUNDERSCORE)
         THIS_FUNCTION=testflib;;

   esac

   # Checks if the LIBRARY from the argument list can be used to link
   # a C test program with testflib
   echo $ac_n "checking for $THIS_FUNCTION in -lsunmath""... $ac_c" 1>&6
echo "configure:8504: checking for $THIS_FUNCTION in -lsunmath" >&5
ac_lib_var=`echo sunmath'_'$THIS_FUNCTION | 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="testflib_.o -L/opt/SUNWspro/SC4.2/lib -lF77 -lsunmath $LIBS -lsunmath"
cat > conftest.$ac_ext <<EOF
#line 8512 "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 $THIS_FUNCTION();

int main() {
$THIS_FUNCTION()
; return 0; }
EOF
if { (eval echo configure:8523: \"$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
  F77LIBDIRS="-L/opt/SUNWspro/SC4.2/lib"
                                   F77LIBS="-lF77 -lsunmath"
                                   
else
  echo "$ac_t""no" 1>&6
fi



   rm -f testflib_.o testflib_.f

;;
               esac
         ;;
         alpha)
            
   # This macro needs a f77 compiler and knowledge of the name-mangling scheme
   
   

   if test -z "$FORTRANNAMES" ; then
      NAMESTYLE="FORTRANNOUNDERSCORE"
   else
      NAMESTYLE=$FORTRANNAMES
   fi

   # This is a little subroutine to be called later by a C main function
   cat > testflib_.f << EOF
        subroutine testflib(i)
        integer i
        print *, "This tests which libraries work"
        return
        end
EOF

   $F77 -c testflib_.f 2>&5 

   # Mangle testflib's name appropriatiately
   case $NAMESTYLE in
      FORTRANDOUBLEUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANCAPS)
         THIS_FUNCTION=TESTFLIB;;

      FORTRANNOUNDERSCORE)
         THIS_FUNCTION=testflib;;

   esac

   # Checks if the LIBRARY from the argument list can be used to link
   # a C test program with testflib
   echo $ac_n "checking for $THIS_FUNCTION in -lfor""... $ac_c" 1>&6
echo "configure:8594: checking for $THIS_FUNCTION in -lfor" >&5
ac_lib_var=`echo for'_'$THIS_FUNCTION | 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="testflib_.o  $LIBS -lfor"
cat > conftest.$ac_ext <<EOF
#line 8602 "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 $THIS_FUNCTION();

int main() {
$THIS_FUNCTION()
; return 0; }
EOF
if { (eval echo configure:8613: \"$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
  F77LIBS="-lfor"
else
  echo "$ac_t""no" 1>&6
fi



   rm -f testflib_.o testflib_.f

;;

         rs6000)
            
   # This macro needs a f77 compiler and knowledge of the name-mangling scheme
   
   

   if test -z "$FORTRANNAMES" ; then
      NAMESTYLE="FORTRANNOUNDERSCORE"
   else
      NAMESTYLE=$FORTRANNAMES
   fi

   # This is a little subroutine to be called later by a C main function
   cat > testflib_.f << EOF
        subroutine testflib(i)
        integer i
        print *, "This tests which libraries work"
        return
        end
EOF

   $F77 -c testflib_.f 2>&5 

   # Mangle testflib's name appropriatiately
   case $NAMESTYLE in
      FORTRANDOUBLEUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANCAPS)
         THIS_FUNCTION=TESTFLIB;;

      FORTRANNOUNDERSCORE)
         THIS_FUNCTION=testflib;;

   esac

   # Checks if the LIBRARY from the argument list can be used to link
   # a C test program with testflib
   echo $ac_n "checking for $THIS_FUNCTION in -lxlf90""... $ac_c" 1>&6
echo "configure:8681: checking for $THIS_FUNCTION in -lxlf90" >&5
ac_lib_var=`echo xlf90'_'$THIS_FUNCTION | 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="testflib_.o  $LIBS -lxlf90"
cat > conftest.$ac_ext <<EOF
#line 8689 "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 $THIS_FUNCTION();

int main() {
$THIS_FUNCTION()
; return 0; }
EOF
if { (eval echo configure:8700: \"$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
  F77LIBS="-lxlf90"
else
  echo "$ac_t""no" 1>&6
fi



   rm -f testflib_.o testflib_.f

;;

         IRIX64 | iris4d)
            
   # This macro needs a f77 compiler and knowledge of the name-mangling scheme
   
   

   if test -z "$FORTRANNAMES" ; then
      NAMESTYLE="FORTRANNOUNDERSCORE"
   else
      NAMESTYLE=$FORTRANNAMES
   fi

   # This is a little subroutine to be called later by a C main function
   cat > testflib_.f << EOF
        subroutine testflib(i)
        integer i
        print *, "This tests which libraries work"
        return
        end
EOF

   $F77 -c testflib_.f 2>&5 

   # Mangle testflib's name appropriatiately
   case $NAMESTYLE in
      FORTRANDOUBLEUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANUNDERSCORE)
         THIS_FUNCTION=testflib_;;

      FORTRANCAPS)
         THIS_FUNCTION=TESTFLIB;;

      FORTRANNOUNDERSCORE)
         THIS_FUNCTION=testflib;;

   esac

   # Checks if the LIBRARY from the argument list can be used to link
   # a C test program with testflib
   echo $ac_n "checking for $THIS_FUNCTION in -lI77""... $ac_c" 1>&6
echo "configure:8768: checking for $THIS_FUNCTION in -lI77" >&5
ac_lib_var=`echo I77'_'$THIS_FUNCTION | 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="testflib_.o -lF77 -lU77 -lI77 -lisam $LIBS -lI77"
cat > conftest.$ac_ext <<EOF
#line 8776 "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 $THIS_FUNCTION();

int main() {
$THIS_FUNCTION()
; return 0; }
EOF
if { (eval echo configure:8787: \"$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
  F77LIBS="-lF77 -lU77 -lI77 -lisam"
else
  echo "$ac_t""no" 1>&6
fi



   rm -f testflib_.o testflib_.f

;;

         *)
            echo "configure: warning: unable to set F77LIBFLAGS.  They must be set as a shell variable or
 with a command-line option" 1>&2
         ;;             

      esac

   else
      if test -n "$casc_f77_lib_dirs"; then
         for casc_lib_dir in $casc_f77_lib_dirs; do
            F77LIBDIRS="-L$casc_lib_dir $F77LIBDIRS"       
         done
      fi

      for casc_lib in $casc_f77_libs; do
         F77LIBS="$F77LIBS -l$casc_lib"
      done
   fi

   F77LIBFLAGS="$F77LIBDIRS $F77LIBS"

         fi        

                                             

      fi

      casc_cv_f77flags=$F77LIBFLAGS
   
fi

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

   



   
   
   

   echo $ac_n "checking for the BLAS""... $ac_c" 1>&6
echo "configure:8855: checking for the BLAS" >&5
if eval "test \"`echo '$''{'casc_cv_blasflags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
      # Check whether --with-BLAS or --without-BLAS was given.
if test "${with_BLAS+set}" = set; then
  withval="$with_BLAS"
  casc_blas_arg=$withval
else
  casc_blas_arg=yes
fi


      if test "$casc_blas_arg" = "no"; then
         casc_cv_blasflags=none
      else
         if test "$casc_blas_arg" != "yes"; then
            casc_cv_blasflags=$casc_blas_arg
         else
            case $FORTRANNAMES in
               FORTRANDOUBLEUNDERSCORE)
                  casc_blas_func=daxpy_
               ;;
               FORTRANUNDERSCORE)
                  casc_blas_func=daxpy_
               ;;
               FORTRANCAPS)
                  casc_blas_func=DAXPY
               ;;
               FORTRANNOUNDERSCORE)
                  casc_blas_func=daxpy
               ;;
            esac
            case $ARCH in
               sun4 | solaris)
                  casc_blas_name=sunperf
                  casc_blas_extra_flags="-L/opt/SUNWspro/lib $F77LIBFLAGS -lm"
                  echo $ac_n "checking for main in -lSUNWPro_lic""... $ac_c" 1>&6
echo "configure:8894: checking for main in -lSUNWPro_lic" >&5
ac_lib_var=`echo SUNWPro_lic'_'main | 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="-lSUNWPro_lic $casc_blas_extra_flags $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8902 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:8909: \"$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
  casc_blas_extra_flags="$casc_blas_extra_flags -lSUNWPro_lic"
else
  echo "$ac_t""no" 1>&6
 
fi

                  echo $ac_n "checking for $casc_blas_func in -l$casc_blas_name""... $ac_c" 1>&6
echo "configure:8931: checking for $casc_blas_func in -l$casc_blas_name" >&5
ac_lib_var=`echo $casc_blas_name'_'$casc_blas_func | 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="-l$casc_blas_name $casc_blas_extra_flags $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8939 "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 $casc_blas_func();

int main() {
$casc_blas_func()
; return 0; }
EOF
if { (eval echo configure:8950: \"$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
  casc_cv_blasflags="-l$casc_blas_name $casc_blas_extra_flags"
                     casc_blas_found=yes
else
  echo "$ac_t""no" 1>&6
casc_blas_found=no
fi

               ;;
               alpha)
                  casc_blas_name=dxml
                  echo $ac_n "checking for $casc_blas_func in -l$casc_blas_name""... $ac_c" 1>&6
echo "configure:8976: checking for $casc_blas_func in -l$casc_blas_name" >&5
ac_lib_var=`echo $casc_blas_name'_'$casc_blas_func | 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="-l$casc_blas_name  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8984 "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 $casc_blas_func();

int main() {
$casc_blas_func()
; return 0; }
EOF
if { (eval echo configure:8995: \"$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
  casc_cv_blasflags="-l$casc_blas_name"
                                 casc_blas_found=yes
else
  echo "$ac_t""no" 1>&6
casc_blas_found=no
fi

               ;;
               rs6000)
                  casc_blas_name=essl
                  echo $ac_n "checking for $casc_blas_func in -l$casc_blas_name""... $ac_c" 1>&6
echo "configure:9021: checking for $casc_blas_func in -l$casc_blas_name" >&5
ac_lib_var=`echo $casc_blas_name'_'$casc_blas_func | 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="-l$casc_blas_name  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9029 "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 $casc_blas_func();

int main() {
$casc_blas_func()
; return 0; }
EOF
if { (eval echo configure:9040: \"$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
  casc_cv_blasflags="-l$casc_blas_name"
                                 casc_blas_found=yes
else
  echo "$ac_t""no" 1>&6
casc_blas_found=no
fi

               ;;
               *)
                  casc_blas_name=blas
                  echo $ac_n "checking for $casc_blas_func in -l$casc_blas_name""... $ac_c" 1>&6
echo "configure:9066: checking for $casc_blas_func in -l$casc_blas_name" >&5
ac_lib_var=`echo $casc_blas_name'_'$casc_blas_func | 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="-l$casc_blas_name  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9074 "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 $casc_blas_func();

int main() {
$casc_blas_func()
; return 0; }
EOF
if { (eval echo configure:9085: \"$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
  casc_cv_blasflags="-l$casc_blas_name" 
                               casc_blas_found=yes
else
  echo "$ac_t""no" 1>&6
casc_blas_found=no
fi

               ;;
            esac

            if test "$casc_blas_found" = "no"; then
               if test "$casc_blas_name" != "blas"; then
                  echo $ac_n "checking for $casc_blas_func in -lblas""... $ac_c" 1>&6
echo "configure:9113: checking for $casc_blas_func in -lblas" >&5
ac_lib_var=`echo blas'_'$casc_blas_func | 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="-lblas  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9121 "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 $casc_blas_func();

int main() {
$casc_blas_func()
; return 0; }
EOF
if { (eval echo configure:9132: \"$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
  casc_cv_blasflags="-lblas" 
                               casc_blas_found=yes
else
  echo "$ac_t""no" 1>&6
casc_blas_found=no
fi

               fi
            fi

            if test "$casc_blas_found" = "no"; then
               casc_cv_blasflags=none
            fi
         fi
      fi
   
fi

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

   if test "$casc_cv_blasflags" != "none"; then
      BLASLIBFLAGS=$casc_cv_blasflags
   else
      BLASLIBFLAGS=
   fi

   

 if test "$BLASLIBFLAGS" = "-lessl"
 then
   cat >> confdefs.h <<\EOF
#define HYPRE_USING_ESSL 1
EOF

 elif test "$BLASLIBFLAGS" = "-ldxml"
 then
   cat >> confdefs.h <<\EOF
#define HYPRE_USING_DXML 1
EOF

 elif test "$BLASLIBFLAGS" = ""
 then
   casc_using_blas=no
 fi
fi

if test "$casc_using_blas" = "no"
then
 BLASLIBFLAGS=-lHYPRE_blas
 cat >> confdefs.h <<\EOF
#define HYPRE_USING_HYPRE_BLAS 1
EOF

fi



   # define some macros to hopefully improve readability
   
   

   # check for the library from first argument.  If linking is successful
   # the first time, the job is done, otherwise loop through DIRECTORY-LIST
   echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
echo "configure:9211: checking for main in -lm" >&5
ac_lib_var=`echo m'_'main | 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="$LIBDIRS $LIBS $LIBS -lm"
cat > conftest.$ac_ext <<EOF
#line 9219 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:9226: \"$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
  LIBS="$LIBS -lm"
                          casc_lib_found=yes 
                          
else
  echo "$ac_t""no" 1>&6

unset ac_cv_lib_$ac_lib_var  
      for casc_lib_dir in /usr/lib /usr/ccs/lib; do

         echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
echo "configure:9251: checking for main in -lm" >&5
ac_lib_var=`echo m'_'main | 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="-L$casc_lib_dir $LIBDIRS $LIBS -lm $LIBS -lm"
cat > conftest.$ac_ext <<EOF
#line 9259 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:9266: \"$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
  LIBDIRS="-L$casc_lib_dir $LIBDIRS"
            LIBS="$LIBS -lm"
            casc_lib_found=yes
            
            break
            
else
  echo "$ac_t""no" 1>&6
fi
unset ac_cv_lib_$ac_lib_var

      done
      
fi
unset ac_cv_lib_$ac_lib_var
                                               
   # ACTION-IF-NOT_FOUND for when the library is found nowhere
   

   unset casc_lib_found

   
   




CC="$PREPEND $CC"
CXX="$PREPEND $CXX"



















































         

   if test -z "$srcdir"; then
      srcdir=.
   fi

      if test -n ""; then
      casc_output_file=
   else   
      casc_output_file=Makefile
   fi   
      
      for casc_dir in \
 .\
 babel\
 babel/Hypre\
 blas\
 distributed_ls\
 distributed_ls/Euclid\
 distributed_ls/pilut\
 distributed_ls/ParaSails\
 distributed_matrix\
 docs\
 FEI_mv\
 FEI_mv/SuperLU\
 FEI_mv/fei-hypre\
 FEI_mv/fei-isis\
 FEI_mv/fei-isis/src\
 FEI_mv/isis-mv\
 IJ_mv\
 krylov\
 matrix_matrix\
 mli\
 mli/matrix\
 parcsr_ls\
 parcsr_mv\
 PETSc_ls\
 PETSc_ls/ParILUT\
 PETScMat_ls\
 PETScMat_ls/pilut\
 seq_mv\
 seq_ls\
 seq_ls/amge\
 seq_ls/amge_ag\
 seq_ls/pamg\
 sstruct_mv\
 sstruct_ls\
 struct_mv\
 struct_ls\
 test\
 tools\
 utilities; do
      if test -f $srcdir/$casc_dir/$casc_output_file.in; then
         Makefile_list="$Makefile_list $casc_dir/$casc_output_file"
      fi
   done


trap '' 1 2 15

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
ac_given_INSTALL="$INSTALL"

trap 'rm -fr `echo "$Makefile_list HYPRE_config.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%@ARCH@%$ARCH%g
s%@HOSTNAME@%$HOSTNAME%g
s%@CPP@%$CPP%g
s%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
s%@CXX@%$CXX%g
s%@F77@%$F77%g
s%@COPT@%$COPT%g
s%@CDEBUG@%$CDEBUG%g
s%@CXXOPT@%$CXXOPT%g
s%@CXXDEBUG@%$CXXDEBUG%g
s%@FOPT@%$FOPT%g
s%@FDEBUG@%$FDEBUG%g
s%@CXXCPP@%$CXXCPP%g
s%@FPP@%$FPP%g
s%@MPICC@%$MPICC%g
s%@MPIINCLUDE@%$MPIINCLUDE%g
s%@MPILIBDIRS@%$MPILIBDIRS%g
s%@MPILIBS@%$MPILIBS%g
s%@MPIFLAGS@%$MPIFLAGS%g
s%@babeldir@%$babeldir%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@ACLOCAL@%$ACLOCAL%g
s%@AUTOCONF@%$AUTOCONF%g
s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
s%@OPTCHOICE@%$OPTCHOICE%g
s%@_DIR@%$_DIR%g
s%@PETSC_DIR@%$PETSC_DIR%g
s%@F77LIBFLAGS@%$F77LIBFLAGS%g
s%@BLASLIBFLAGS@%$BLASLIBFLAGS%g
s%@INCLUDES@%$INCLUDES%g
s%@LIBDIRS@%$LIBDIRS%g
s%@TIMERDEFS@%$TIMERDEFS%g
s%@LDLIBS@%$LDLIBS%g
s%@LDLIBDIRS@%$LDLIBDIRS%g
s%@F77FLAGS@%$F77FLAGS%g
s%@PREPEND@%$PREPEND%g
s%@BABEL_DIR@%$BABEL_DIR%g
s%@BABEL_HYPRE_INCLUDES@%$BABEL_HYPRE_INCLUDES%g
s%@BABELLIBFLAGS@%$BABELLIBFLAGS%g
s%@HYPRE_BABELLIBDIR@%$HYPRE_BABELLIBDIR%g
s%@MLI_DIR@%$MLI_DIR%g
s%@MLILIBS@%$MLILIBS%g
s%@MLILIBDIRS@%$MLILIBDIRS%g
s%@MLIINCLUDE@%$MLIINCLUDE%g
s%@PETSCLIBS@%$PETSCLIBS%g
s%@PETSCLIBDIRS@%$PETSCLIBDIRS%g
s%@PETSCINCLUDE@%$PETSCINCLUDE%g
s%@HYPRE_PETSCDEFS@%$HYPRE_PETSCDEFS%g
s%@HYPRE_PETSCLIBS@%$HYPRE_PETSCLIBS%g
s%@HYPRE_PETSCLIBDIRS@%$HYPRE_PETSCLIBDIRS%g
s%@HYPRE_TOP_SRC_DIR@%$HYPRE_TOP_SRC_DIR%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_list"}
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

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  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
s%@INSTALL@%$INSTALL%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="HYPRE_config.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

EOF
cat >> $CONFIG_STATUS <<\EOF

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


