hypre/configure.in
2003-04-08 22:18:40 +00:00

1440 lines
40 KiB
Plaintext

dnl *********************************************************************
dnl * configure.in, when autoconf is run, this file is read and
dnl * the script configure is generated. Configure.in is structured
dnl * as follows: initialization, the current architecture is determined,
dnl * user specified compilers are set,
dnl * other user specifieds options are determined and relevant macros
dnl * assigned. Then, given the architecture, an optimal compiler is
dnl * found (if not specified by the user). If the archtecture is
dnl * unknown or none of the preferred compilers are available then
dnl * default compilers are found. For each chosen compiler, the
dnl * appropriate flags are set for optimization or debugging and MPI
dnl * and pthreading (if required). The C preprocessor is also checked.
dnl * Finally, library flags are added and AC_SUBST is used to export
dnl * all necessary macro values.
dnl *********************************************************************
dnl *********************************************************************
dnl * The first macro called must be AC_INIT with a unique file from the
dnl * package as its argument. configure checks for the existence of this
dnl * file to make sure it is located in the right place
dnl *********************************************************************
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl
AC_INIT(utilities/memory.c)
AC_CONFIG_HEADER(HYPRE_config.h)
AC_CONFIG_AUX_DIR(config)
AC_PREFIX_DEFAULT(`pwd`/hypre)
dnl *********************************************************************
dnl * Set the variable ARCH, (CASC_GUESS_ARCH uses tarch). ARCH will
dnl * be used throught this file to determine optimal compilers, options
dnl * flag, etc for each supported architecture. If ARCH is unknown
dnl * then default settings will apply.
dnl *********************************************************************
HYPRE_GUESS_ARCH
dnl *********************************************************************
dnl * If the user has specified a c, c++, or fortran compiler on the
dnl * command line, that compiler will be used. No checks are done
dnl * to assure this compiler is present or working. Additionally,
dnl * if the user indicated any MPI include, library, or directory
dnl * to use with the chosen compiler those options are identified
dnl * and the appropriate macros are assigned values.
dnl *********************************************************************dnl *
casc_user_chose_compilers=no
casc_user_chose_mpi=no
casc_using_babel=no
casc_using_mli=no
casc_using_openmp=no
#casc_using_ibm_smp=no
#casc_using_sgi_smp=no
#casc_using_pgcc_smp=no
AC_ARG_WITH(CC,
[ --with-CC=ARG User can manually set C compiler to ARG. The
environment variables 'CC' will be overridden by
the configure script.],
[case "${withval}" in
yes) casc_user_chose_compilers=no ;;
no) casc_user_chose_compilers=no ;;
*) casc_user_chose_compilers=yes
CC=$withval ;;
esac],
[casc_user_chose_compilers=no]
)
AC_ARG_WITH(CXX,
[ --with-CXX=ARG User can manually set C++ compiler to ARG. The
environment variables 'CXX' will be overridden by
the configure script.],
[case "${withval}" in
yes) casc_user_chose_compilers=no ;;
no) casc_user_chose_compilers=no ;;
*) casc_user_chose_compilers=yes
CXX=$withval ;;
esac]
)
AC_ARG_WITH(F77,
[ --with-F77=ARG User can manually set f77 compiler to ARG. The
environment variables 'F77' will be overridden by
the configure script.],
[case "${withval}" in
yes) casc_user_chose_compilers=no ;;
no) casc_user_chose_compilers=no ;;
*) casc_user_chose_compilers=yes
F77=$withval ;;
esac]
)
AC_ARG_WITH(LD,
[ --with-LD=ARG User can manually set linker to ARG. The
environment variables 'LD' will be overridden by
the configure script.],
[case "${withval}" in
yes) casc_user_chose_compilers=no ;;
no) casc_user_chose_compilers=no ;;
*) casc_user_chose_compilers=yes
LD=$withval ;;
esac]
)
AC_ARG_WITH(CFLAGS,
[ --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.],
[CFLAGS=$withval]
)
AC_ARG_WITH(CXXFLAGS,
[ --with-CXXFLAGS=ARG User can manually set c++ compiler flags. The
'CXXFLAGS' environment variable will be overridden.],
[CXXFLAGS=$withval]
)
AC_ARG_WITH(F77FLAGS,
[ --with-F77FLAGS=ARG User can manually set f77 compiler flags. The
'F77FLAGS' environment variable will be overridden.],
[F77FLAGS=$withval]
)
AC_ARG_WITH(LDFLAGS,
[ --with-LDFLAGS=ARG User can manually set linker flags. The 'LDFLAGS'
environment variable will be overridden.],
[LDFLAGS=$withval]
)
AC_ARG_WITH(extra-incpath,
[ --with-extra-incpath=PATH define extra include path, where PATH is a
space-separated list of directories.],
[CCFLAGS="${CCFLAGS} -I`echo ${withval}|sed 's/ /\ -I/g'`"]
)
AC_ARG_WITH(extra-ldpath,
[ --with-extra-ldpath=PATH define extra ld path, where PATH is a
space-separated list of directories.],
[LDFLAGS="-L`echo ${withval}|sed 's/ /\ -L/g'` ${LDFLAGS}"]
)
AC_ARG_WITH(insure,
[ --with-insure=FLAGS FLAGS are optional to pass to insure, e.g.
-Zoi \"report_file stderr\"
will send output to standard error, while
-Zoi \"report_file insure.log\"
will send output to a file.
assign cc and CC as the C and C++ compilers
if not already set by user and
prepends "insure" to compile/link line-- no
checking is done to ensure insure is present on
the machine],
[if test "$casc_user_chose_compilers" = "no"
then
CC=insure
CXX=insure
CFLAGS="$CFLAGS -g"
CXXFLAGS="$CXXFLAGS -g"
casc_user_chose_compilers=yes
fi],
[PREPEND=""]
)
AC_ARG_WITH(purify,
[ --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],
[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],
[PREPEND=""]
)
AC_ARG_WITH(insure-to-file,
[ --with-insure-to-file direct insure output to the file \"insure.log\"],
[if test "$casc_user_chose_compilers" = "no"
then
CC=insure
CXX=insure
CFLAGS="$CFLAGS -Zoi \"report_file insure.log\""
CXXFLAGS="$CXXFLAGS -Zoi \"report_file insure.log\""
casc_user_chose_compilers=yes
fi]
)
AC_ARG_WITH(purify-to-file,
[ --with-purify-to-file direct purify output to the file \"purify.log\"],
[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]
)
AC_ARG_WITH(cegdb,
[ --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],
[CC=gcc
CXX=g++
CFLAGS="$CFLAGS -g"
CXXFLAGS="$CXXFLAGS -g"
CASC_CHECK_HEADER(cegdb.h, /home/casc/include,
CASC_ADD_LIB(cegdb, cegdb, /home/casc/lib, LD))
casc_users_chose_compilers=yes]
)
AC_ARG_WITH(gdb,
[ --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],
[CC=gcc
CXX=g++
CFLAGS="$CFLAGS -g"
CXXFLAGS="$CXXFLAGS -g"
CASC_CHECK_HEADER(gdb.h, /usr/local/include /usr/include,
CASC_ADD_LIB(gdb, gdb, /usr/local/lib /usr/lib, LD))
casc_users_chose_compilers=yes]
)
AC_ARG_WITH(strict-checking,
[ --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],
[CC=KCC
CXX=KCC
CFLAGS="$CFLAGS --c --strict --lint --display_error_number"
CFLAGS="$CFLAGS --diag_suppress 45,236,450,826"
CFLAGS="$CFLAGS,1018,1021,1022,1023,1024,1030,1041"
CXXFLAGS="$CXXFLAGS --c++ --strict --lint --display_error_number"
CXXFLAGS="$CXXFLAGS --diag_suppress 236,381,450,826"
CXXFLAGS="$CXXFLAGS,1018,1022,1023,1024,1025,1029,1030"
casc_users_chose_compilers=yes
casc_using_mpi=no
AC_DEFINE(HYPRE_SEQUENTIAL)]
)
AC_ARG_WITH(mpi-include,
[ --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.],
[for mpi_dir in $withval; do
MPIINCLUDE="$MPIINCLUDE -I$withval"
done;
casc_user_chose_mpi=yes],
[casc_user_chose_mpi=no]
)
AC_ARG_WITH(mpi-libs,
[ --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.],
[for mpi_lib in $withval; do
MPILIBS="$MPILIBS -l$mpi_lib"
done;
casc_user_chose_mpi=yes]
)
AC_ARG_WITH(mpi-lib-dirs,
[ --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.],
[for mpi_lib_dir in $withval; do
MPILIBDIRS="-L$mpi_lib_dir $MPILIBDIRS"
done;
casc_user_chose_mpi=yes]
)
AC_ARG_WITH(mpi-flags,
[ --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.],
[case "${withval}" in
yes) MPIFLAGS="" ;;
no) MPIFLAGS="" ;;
*) MPIFLAGS=$withval ;;
esac],
[MPIFLAGS=""]
)
dnl *********************************************************************
dnl * If the user has specified any other command line options (without-MPI,
dnl * with-dmalloc etc.) then this section identifies the
dnl * options and assigns yes or no values to appropriate macros. These
dnl * values will be used to determine compilers, flags and libraries needed.
dnl *********************************************************************
AC_ARG_WITH(MPI,
[ --with-MPI compiles with MPI (this is the default).
Selecting '--without-MPI' may affect
which compiler is chosen],
[case "${withval}" in
yes) casc_using_mpi=yes ;;
no) casc_using_mpi=no ;;
*) casc_using_mpi=$withval ;;
esac],
[casc_using_mpi=yes]
)
if test $casc_using_mpi = "no"
then
AC_DEFINE(HYPRE_SEQUENTIAL)
fi
AC_ARG_WITH(COMM_SIMPLE,
[ --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.],
[if test "$withval" = "yes"
then
CFLAGS="$CFLAGS -DHYPRE_COMM_SIMPLE"
fi]
)
AC_ARG_WITH(dmalloc,
[ --with-dmalloc use dmalloc package--no checking is done to ensure
the package is on the machine],
[if test "$withval" = "yes"
then
CASC_ADD_LIB(dmalloc, malloc, /home/casc/lib /usr/local/lib,
LD, AC_DEFINE(HYPRE_MEMORY_DMALLOC) )
fi]
)
AC_ARG_WITH(timing,
[ --with-timing use HYPRE timing routines],
[if test "$withval" = "yes"
then
AC_DEFINE(HYPRE_TIMING)
fi]
)
AC_ARG_WITH(openmp,
[ --with-openmp use openMP--this may affect which compiler is
chosen. Supported on IBM and DECS, test on Linux.],
[case "${withval}" in
yes) casc_using_openmp=yes
AC_DEFINE(HYPRE_USING_OPENMP) ;;
no) casc_using_openmp=no ;;
esac],
[casc_using_openmp=no]
)
#AC_ARG_WITH(IBM_smp,
#[ --with-IBM_smp use IBM SMP--not yet supported],
#[case "${withval}" in
# yes) casc_using_ibm_smp=yes
# AC_DEFINE(HYPRE_USING_IBM_SMP) ;;
# no) casc_using_ibm_smp=no ;;
# esac],
#[casc_using_ibm_smp=no]
#)
#AC_ARG_WITH(SGI_smp,
#[ --with-SGI_smp use SGI SMP--not yet supported],
#[case "${withval}" in
# yes) casc_using_sgi_smp=yes
# AC_DEFINE(HYPRE_USING_SGI_SMP) ;;
# no) casc_using_sgi_smp=no ;;
# esac],
#[casc_using_sgi_smp=no]
#)
#AC_ARG_WITH(pgcc_smp,
#[ --with-pgcc_smp use pgcc SMP (Red)--not yet supported],
#[case "${withval}" in
# yes) casc_using_pgcc_smp=yes
# AC_DEFINE(HYPRE_USING_PGCC_SMP) ;;
# no) casc_using_sgi_smp=no ;;
# esac],
#[casc_using_pgcc_smp=no]
#)
AC_ARG_WITH(blas,
[ --with-blas search for and use the BLAS],
[case "${withval}" in
yes) casc_using_blas="" ;;
no) casc_using_blas="" ;;
*) casc_using_blas=$withval ;;
esac],
[casc_using_blas=""]
)
dnl top level source directory
HYPRE_TOP_SRC_DIR=`pwd`
AC_ARG_WITH(babel,
[ --with-babel use babel],
[case "${withval}" in
yes) casc_using_babel=yes ;;
no) casc_using_babel=no ;;
esac],
[casc_using_babel=no]
)
AC_ARG_WITH(mli,
[ --with-mli use MLI],
[case "${withval}" in
yes) casc_using_mli=yes ;;
no) casc_using_mli=no ;;
esac],
[casc_using_mli=no]
)
AC_ARG_WITH(FEI_BASE_DIR,
[ --with-FEI_BASE_DIR specify the directory where the fei header
files live.],
[case "${withval}" in
yes) FEI_BASE_DIR="" ;;
no) FEI_BASE_DIR="" ;;
*) FEI_BASE_DIR=$wddithval ;;
esac],
[FEI_BASE_DIR=""]
)
AC_ARG_WITH(FEI_LIB_DIR,
[ --with-FEI_LIB_DIR specify an additional directory for fei library
intalls.],
[case "${withval}" in
yes) FEI_LIB_DIR="" ;;
no) FEI_LIB_DIR="" ;;
*) FEI_LIB_DIR=$withval ;;
esac],
[FEI_LIB_DIR=""]
)
AC_ARG_WITH(FEI_INC_DIR,
[ --with-FEI_INC_DIR specify an additional directory for fei include
installs.],
[case "${withval}" in
yes) FEI_INC_DIR="" ;;
no) FEI_INC_DIR="" ;;
*) FEI_INC_DIR=$withval ;;
esac],
[FEI_INC_DIR=""]
)
dnl *********************************************************************
dnl * For each ARCH (6 supported platforms and 1 default) the "best"
dnl * compilers are chosen based on, the architecture, MPI or no-MPI,
dnl * and the preference list of compilers.
dnl * If none of the preferred compilers are available then the default
dnl * compilers will be searched for (using CASC_FIND_MPI or AC_PROG_CC,
dnl * AC_PROG_CXX, and AC_PROG_F77). Depending on the compiler chosen,
dnl * flags are set as needed. The supported platforms are IRIX, DEC alpha,
dnl * sun/solaris, IBM rs6000, Intel ??, and SGI ??.
dnl *********************************************************************
case $HOSTNAME in
sasn100 )
if test "$casc_user_chose_compilers" = "no"
then
AC_CHECK_PROGS(CC, cicc cc)
AC_CHECK_PROGS(CXX, ciCC CC)
AC_CHECK_PROGS(F77, cif77 f77)
fi
if test "$casc_user_chose_mpi" = "no" && test "$casc_using_mpi" = "yes"
then
CASC_CHECK_HEADER(mpi.h, /opt/intel/tflop/current/tflops/cougar/include)
MPIINCLUDE="$MPIINCLUDE $INCLUDES"
CASC_ADD_LIB(mpi, main, /opt/intel/tflop/current/tflops/cougar/lib/puma, MPI)
if test -z "$MPILIBS"
then
AC_MSG_WARN([MPI not found--in sasn100 test-must set manually using --with-flags])
fi
fi
CFLAGS="$CFLAGS"
CASC_SET_COPT(-O)
CASC_SET_CDEBUG(-g)
CASC_SET_CXXOPT(-O)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FOPT(-O)
CASC_SET_FDEBUG(-g)
if test -z "$casc_using_blas"
then
casc_using_blas=yes
fi
;;
janus )
if test "$casc_user_chose_compilers" = "no"
then
AC_CHECK_PROGS(CC, pgcc cc)
AC_CHECK_PROGS(CXX, pgCC CC)
AC_CHECK_PROGS(F77, pgf77 f77)
fi
if test "$casc_user_chose_mpi" = "no" && test "$casc_using_mpi" = "yes"
then
CASC_CHECK_HEADER(mpi.h, /cougar/include)
MPIINCLUDE="$MPIINCLUDE $INCLUDES"
CASC_ADD_LIB(mpi, main, /cougar/lib/puma, MPI)
if test -z "$MPILIBS"
then
AC_MSG_WARN([MPI not found--in janus test-must set manually using --with-flags])
fi
fi
CFLAGS="$CFLAGS -cougar -mp -Mx,123,0x2000"
LIBS="$LIBS -cougar -mp -Mx,123,0x2000"
CASC_SET_COPT(-O)
CASC_SET_CDEBUG(-g)
CASC_SET_CXXOPT(-O)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FOPT(-O)
CASC_SET_FDEBUG(-g)
if test -z "$casc_using_blas"
then
casc_using_blas=yes
fi
;;
nirvana )
if test "$casc_user_chose_compilers" = "no"
then
AC_CHECK_PROGS(CC, cc kcc gcc)
AC_CHECK_PROGS(CXX, CC KCC g++)
AC_CHECK_PROGS(F77, f77 g77)
fi
if test "$casc_user_chose_mpi" = "no" && test "$casc_using_mpi" = "yes"
then
CASC_ADD_LIB(mpi, main, /usr/lib, MPI)
if test -z "$MPILIBS"
then
AC_MSG_WARN([MPI not found--in nirvana test-must set manually using --with-flags])
fi
fi
CASC_SET_COPT(-O)
CASC_SET_CDEBUG(-g)
CASC_SET_CXXOPT(-O)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FOPT(-O)
CASC_SET_FDEBUG(-g)
if test -z "$casc_using_blas"
then
casc_using_blas=yes
fi
;;
n02 )
if test "$casc_user_chose_compilers" = "no"
then
AC_CHECK_PROGS(CC, cc kcc gcc)
AC_CHECK_PROGS(CXX, CC KCC g++)
AC_CHECK_PROGS(F77, f77 g77)
fi
if test "$casc_user_chose_mpi" = "no" && test "$casc_using_mpi" = "yes"
then
CASC_ADD_LIB(mpi, main, /usr/lib, MPI)
if test -z "$MPILIBS"
then
AC_MSG_WARN([MPI not found--in n02 test-must set manually using --with-flags])
fi
fi
CASC_SET_COPT(-O -64)
CASC_SET_CDEBUG(-g)
CASC_SET_CXXOPT(-64)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FOPT(-O -64)
CASC_SET_FDEBUG(-g)
[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
AC_CHECK_PROGS(CC, cc gcc kcc)
else
AC_CHECK_PROGS(CC, mpicc)
fi
fi
if test -z "$CXX"; then
if test "$casc_using_mpi" = "no" ; then
AC_CHECK_PROGS(CXX, CC g++)
else
AC_CHECK_PROGS(CXX, mpiCC)
fi
fi
if test -z "$F77"; then
if test "$casc_using_mpi" = "no" ; then
AC_CHECK_PROGS(F77, f77 g77)
else
AC_CHECK_PROGS(F77, mpif77)
fi
fi
if test -z "$CFLAGS"; then
CASC_SET_COPT(-O)
fi
if test -z "$CXXFLAGS"; then
CASC_SET_CXXOPT(-O)
fi
if test -z "$F77FLAGS"; then
CASC_SET_FOPT(-O -silent)
fi
CASC_SET_CDEBUG(-g)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FDEBUG(-g -silent)
;;
LINUX | Linux )
if test -z "$CC"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CC, ccc icc pgcc cc gcc kcc KCC)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(CC, mpiicc mpipgcc icc mpicc)
else
AC_CHECK_PROGS(CC, mpiicc mpipgcc icc pgcc)
fi
fi
fi
if test -z "$CXX"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CXX, icc pgCC CC g++ KCC)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(CXX, mpiicc mpipgCC icc mpiCC)
else
AC_CHECK_PROGS(CXX, mpiicc mpipgCC icc pgCC)
fi
fi
fi
if test -z "$F77"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(F77, ifc pgf77 fort f77 g77)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(F77, mpiifc mpipgf77 ifc mpif77)
else
AC_CHECK_PROGS(F77, mpiifc mpipgf77 ifc pgf77)
fi
fi
fi
if test "$casc_using_mpi" = "yes" &&
test "$casc_user_chose_mpi" = "no"
then
if test "$CC" = "icc" ; then
MPIINCLUDE="-I/usr/lib/mpi_ifc/include"
MPILIBS="-lmpi -lelan -lmpif -lelan3 -lrmscall"
MPILIBDIRS="-L/usr/lib/mpi_ifc/lib"
fi
fi
if test "$casc_using_openmp" = "no" ; then
if test -z "$CFLAGS"; then
if test "$CC" = "pgcc" ; then
CASC_SET_COPT(-fast)
elif test "$CC" = "icc" ; then
CASC_SET_COPT(-O3 -xW -tpp7)
else
CASC_SET_COPT(-O)
fi
fi
if test -z "$CXXFLAGS"; then
if test "$CXX" = "pgCC" ; then
CASC_SET_CXXOPT(-fast)
elif test "$CXX" = "icc" ; then
CASC_SET_CXXOPT(-O3 -xW -tpp7)
else
CASC_SET_CXXOPT(-O)
fi
fi
if test -z "$F77FLAGS"; then
if test "$F77" = "pgf77" ; then
CASC_SET_FOPT(-fast)
elif test "$F77" = "ifc" ; then
CASC_SET_FOPT(-O3 -xW -tpp7)
else
CASC_SET_FOPT(-O)
fi
fi
else
if test -z "$CFLAGS"; then
if test "$CC" = "pgcc" ; then
CASC_SET_COPT(-fast -mp)
elif test "$CC" = "icc" ; then
CASC_SET_COPT(-O3 -openmp -xW -tpp7)
else
CASC_SET_COPT(-O)
fi
fi
if test -z "$CXXFLAGS"; then
if test "$CXX" = "pgCC" ; then
CASC_SET_CXXOPT(-fast -mp)
elif test "$CXX" = "icc" ; then
CASC_SET_CXXOPT(-O3 -openmp -xW -tpp7)
else
CASC_SET_CXXOPT(-O)
fi
fi
if test -z "$F77FLAGS"; then
if test "$F77" = "pgf77" ; then
CASC_SET_FOPT(-fast -mp)
elif test "$F77" = "ifc" ; then
CASC_SET_FOPT(-O3 -openmp -xW -tpp7)
else
CASC_SET_FOPT(-O)
fi
fi
fi
CASC_SET_CDEBUG(-g)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FDEBUG(-g)
;;
hpux | HPUX | hppa | HPPA )
if test -z "$CC"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CC, c89 cc gcc kcc)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(CC, mpicc)
else
AC_CHECK_PROGS(CC,guidec)
fi
fi
fi
if test -z "$CXX"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CXX, aCC CC g++)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(CXX, mpiCC)
else
AC_CHECK_PROGS(CXX,guidec++)
fi
fi
fi
if test -z "$F77"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(F77, fort77 f77 g77)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(F77, mpif77)
else
AC_CHECK_PROGS(F77,guidef77)
fi
fi
fi
if test -z "$CFLAGS"; then
CASC_SET_COPT(-O)
fi
if test -z "$CXXFLAGS"; then
CASC_SET_CXXOPT(-O)
fi
if test -z "$F77FLAGS"; then
CASC_SET_FOPT(-O)
fi
CASC_SET_CDEBUG(-g)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FDEBUG(-g)
;;
alpha)
if test -z "$CC"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CC,cc kcc gcc c89)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(CC,mpicc cc kcc)
else
AC_CHECK_PROGS(CC,guidec)
fi
fi
fi
if test -z "$CXX"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CXX,cxx KCC g++)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(CXX,mpicxx cxx KCC)
else
AC_CHECK_PROGS(CXX,guidec++)
fi
fi
fi
if test -z "$F77"; then
if test "$casc_using_mpi" = "no" &&
test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(F77,f77 kf77 g77)
else
if test "$casc_using_openmp" = "no" ; then
AC_CHECK_PROGS(F77,mpif77 f77 kf77)
else
AC_CHECK_PROGS(F77,guidef77)
fi
fi
fi
if test "$casc_user_chose_mpi" = "no" &&
test "$casc_using_mpi" = "yes" &&
test "$CC" != "mpicc"
then
CASC_CHECK_HEADER(mpi.h, /usr/include)
MPIINCLUDE="$MPIINCLUDE $INCLUDES"
CASC_ADD_LIB(rt, main, /usr/lib)
CASC_ADD_LIB(mpi, main, /usr/lib, MPI)
if test -z "$MPILIBS"
then
AC_MSG_WARN([MPI not found--in alpha test-must set manually using --with-flags])
fi
fi
if test -z "$CFLAGS"; then
if test "$CC" = "cc" ||
test "$CC" = "mpicc" ; then
CASC_SET_COPT(-fast)
if test "$casc_using_openmp" = "yes"; then
CASC_SET_COPT(-fast -omp)
fi
elif test "$CC" = "kcc" ; then
CASC_SET_COPT(-o=5)
else
CASC_SET_COPT(-O)
fi
fi
if test -z "$CXXFLAGS"; then
if test "$CXX" = "cxx" ||
test "$CXX" = "mpicxx" ; then
CASC_SET_CXXOPT(-fast)
if test "$casc_using_openmp" = "yes"; then
CASC_SET_CXXOPT(-fast -omp)
fi
else
CASC_SET_CXXOPT(-O)
fi
fi
if test -z "$F77FLAGS"; then
if test "$F77" = "f77" ||
test "$F77" = "mpif77" ; then
CASC_SET_FOPT(-fast)
else
CASC_SET_FOPT(-O)
fi
fi
CASC_SET_CDEBUG(-g)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FDEBUG()
;;
rs6000)
if test -z "$CC"; then
if test "$casc_using_mpi" = "no" ; then
if test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CC,xlc gcc cc c89)
else
if test "$casc_using_openmp" = "yes" ; then
AC_CHECK_PROGS(CC,guidec)
fi
fi
else
if test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CC,mpcc mpicc)
else
if test "$casc_using_openmp" = "yes" ; then
AC_CHECK_PROGS(CC,mpguidec)
fi
fi
fi
fi
if test -z "$CXX"; then
if test "$casc_using_mpi" = "no" ; then
if test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CXX,xlC KCC g++)
else
if test "$casc_using_openmp" = "yes" ; then
AC_CHECK_PROGS(CXX,guidec++)
fi
fi
else
if test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(CXX,mpCC mpKCC mpiCC)
AC_PROG_CPP
else
if test "$casc_using_openmp" = "yes" ; then
AC_CHECK_PROGS(CXX,mpguidec++)
fi
fi
fi
fi
if test -z "$F77"; then
if test "$casc_using_mpi" = "no" ; then
if test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(F77,xlf g77)
else
if test "$casc_using_openmp" = "yes" ; then
AC_CHECK_PROGS(F77,guidef77)
fi
fi
else
if test "$casc_using_openmp" = "no"
then
AC_CHECK_PROGS(F77,mpxlf mpif77)
else
if test "$casc_using_openmp" = "yes" ; then
AC_CHECK_PROGS(F77,mpguidef77)
fi
fi
fi
fi
if test -z "$CFLAGS"; then
if test "$CC" = "gcc" ; then
CASC_SET_COPT(-O)
else
CASC_SET_COPT(-O3 -qstrict)
if test "$casc_using_openmp" = "yes" ; then
CFLAGS="$CFLAGS -qsmp=omp "
fi
fi
fi
if test -z "$CXXFLAGS"; then
if test "$CXX" = "g++" ; then
CASC_SET_CXXOPT(-O)
elif test "$CXX" = "KCC" ||
test "$CXX" = "mpKCC" ; then
CASC_SET_COPT(+K2)
else
CASC_SET_CXXOPT(-O3 -qstrict)
if test "$casc_using_openmp" = "yes" ; then
CXXFLAGS="$CXXFLAGS -qsmp=omp "
fi
fi
fi
if test -z "$F77FLAGS"; then
if test "$F77" = "g77" ; then
CASC_SET_FOPT(-O)
else
CASC_SET_FOPT(-O3 -qstrict)
fi
fi
CFLAGS="$CFLAGS -qmaxmem=8192 -DHYPRE_COMM_SIMPLE"
CXXFLAGS="$CXXFLAGS -qmaxmem=8192 -DHYPRE_COMM_SIMPLE"
CASC_SET_CDEBUG(-g)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FDEBUG(-g)
;;
IRIX64 | IRIX )
if test -z "$CC"; then
AC_CHECK_PROGS(CC, cc gcc c89)
fi
if test -z "$CXX"; then
AC_CHECK_PROGS(CXX, cxx CC g++)
fi
if test -z "$F77"; then
AC_CHECK_PROGS(F77, f77 g77)
fi
if test "$CC" = "cc" ||
test "$CC" = "gcc" &&
test "$casc_user_chose_mpi" = "no" &&
test "$casc_using_mpi" = "yes"
then
CASC_CHECK_HEADER(mpi.h, /usr/include)
MPIINCLUDE="$MPIINCLUDE $INCLUDES"
CASC_ADD_LIB(mpi, main, /usr/lib, MPI)
if test -z "$MPILIBS" ; then
AC_MSG_WARN([MPI not found--in IRIX64 test-must set manually using --with-flags])
fi
fi
if test -z "$CFLAGS"; then
CASC_SET_COPT(-O -64 -OPT:Olimit=0)
if test "$casc_using_openmp" = "yes" ; then
CFLAGS="$CFLAGS -mp"
fi
fi
if test -z "$CXXFLAGS"; then
CASC_SET_CXXOPT(-64)
if test "$casc_using_openmp" = "yes" ; then
CXXFLAGS="$CXXFLAGS -mp"
fi
fi
if test -z "$F77FLAGS"; then
CASC_SET_FOPT(-O -64)
if test "$casc_using_openmp" = "yes" ; then
F77FLAGS="$F77FLAGS -mp"
fi
fi
LDFLAGS="$LDFLAGS -O -64"
CASC_SET_CDEBUG(-g)
CASC_SET_CXXDEBUG(-g)
CASC_SET_FDEBUG(-g)
;;
esac
case $ARCH in
sun4 | solaris )
AC_DEFINE(HYPRE_SOLARIS)
CSUPERLUFLAGS=-DAdd_
;;
LINUX | Linux )
AC_DEFINE(HYPRE_LINUX)
CSUPERLUFLAGS=-DAdd_
;;
hpux | HPUX | hppa | HPPA )
AC_DEFINE(HYPRE_HPPA)
CSUPERLUFLAGS=-DNoChange
if test -z "$casc_using_blas" ; then
casc_using_blas=yes
fi
;;
alpha)
AC_DEFINE(HYPRE_ALPHA)
CSUPERLUFLAGS=-DAdd_
if test -z "$casc_using_blas" ; then
casc_using_blas=yes
fi
;;
rs6000)
AC_DEFINE(HYPRE_RS6000)
CSUPERLUFLAGS=-DNoChange
if test -z "$casc_using_blas" ; then
casc_using_blas=yes
fi
;;
IRIX64)
AC_DEFINE(HYPRE_IRIX64)
CSUPERLUFLAGS=-DAdd_
;;
esac
if test -z "$CC" ; then
if test "$casc_using_mpi" = "no" ; then
AC_CHECK_PROGS(CC, kcc gcc cc c89)
else
AC_CHECK_PROGS(CC, mpicc mpcc tmcc hcc)
fi
if test "$CC" = "cc" ||
test "$CC" = "gcc" ||
test "$CC" = "kcc" &&
test "$casc_user_chose_mpi" = "no" &&
test "$casc_using_mpi" = "yes"
then
CASC_CHECK_HEADER(mpi.h, /usr/include /usr/local/include /usr/local/mpi/include)
MPIINCLUDE="$MPIINCLUDE $INCLUDES"
CASC_ADD_LIB(mpi, main, /usr/lib /usr/local/lib /usr/local/mpi/lib, MPI)
if test -z "$MPILIBS" ; then
AC_MSG_WARN([MPI not found--in default test-must set manually using --with-flags])
fi
fi
if test "$CC" = "kcc" ; then
CASC_SET_COPT(-o5)
else
CASC_SET_COPT(-O)
fi
CASC_SET_CDEBUG(-g)
fi
if test -z "$CXX" ; then
if test "$casc_using_mpi" = "no" ; then
AC_CHECK_PROGS(CXX, KCC g++ cxx CC)
else
AC_CHECK_PROGS(CXX, mpiCC)
fi
CASC_SET_CXXDEBUG(-g)
fi
if test -z "$F77" ; then
if test "$casc_using_mpi" = "no" ; then
AC_CHECK_PROGS(F77, kf77 g77 f77)
else
AC_CHECK_PROGS(F77, mpif77)
fi
if test "$F77" = "kf77" ;then
CASC_SET_FOPT(-o5)
else
CASC_SET_FOPT(-O)
fi
CASC_SET_FDEBUG(-g)
fi
dnl ********************************************************************
dnl * a check to find out how to use the preprocessors. This must
dnl * be done AFTER compilers are set.
dnl * ******************************************************************
AC_PROG_RANLIB
#AC_PROG_CC
#AC_PROG_CXX
#AC_PROG_F77
AC_PROG_CPP
AC_PROG_CXXCPP
CASC_PROG_FPP
if test "$casc_user_chose_compilers" = "yes" &&
test "$casc_using_mpi" = "yes" &&
test "$casc_user_chose_mpi" = "no"
then
CASC_FIND_MPI
fi
HYPRE_BABELLIBDIR=""
BABEL_RUNTIME_DIR=""
if test "$casc_using_babel" = "yes"
then
BABEL_INSTALL_DIR=$HYPRE_TOP_SRC_DIR/babel-runtime
BABEL_HYPRE_INCLUDES="\
-I$HYPRE_TOP_SRC_DIR/hypre/include\
-I$BABEL_INSTALL_DIR/sidl\
-I$HYPRE_TOP_SRC_DIR/babel/bHYPRE"
BABEL_LIB_DIR="$HYPRE_TOP_SRC_DIR/hypre/lib"
BABELLIBFLAGS="\
-L${HYPRE_TOP_SRC_DIR}/babel/bHYPREClient-C -lbHYPREClient-C\
-L${HYPRE_TOP_SRC_DIR}/babel/bHYPREClient-F -lbHYPREClient-F\
-L${HYPRE_TOP_SRC_DIR}/babel/bHYPRE -lbHYPRE\
-L${BABEL_LIB_DIR} -lsidl"
babeldir="${BABEL_INSTALL_DIR}"
AC_SUBST(babeldir)
HYPRE_BABELLIBDIR="$HYPRE_TOP_SRC_DIR/babel"
BABEL_RUNTIME_DIR="$HYPRE_TOP_SRC_DIR/babel-runtime"
dnl CASC_FIND_BABEL
AM_INIT_AUTOMAKE(hypre,1.7,FALSE)
fi
if test "$casc_using_mli" = "yes"
then
dnl CASC_FIND_MLI etc. would simply set the following:
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
dnl *********************************************************************
dnl * This macro uses the values assigned to CASC_SET_COPT and
dnl * CASC_SET_CDEBUG (and C++ and Fortan counterparts) to set either
dnl * the debug or opt compiler flag depending on what the user enters
dnl * on the command line. If neither is selected then all selected
dnl * flags remain on.
dnl *********************************************************************
CASC_OPT_DEBUG_CHOICES
CFLAGS="$CFLAGS $COPT $CDEBUG"
CXXFLAGS="$CXXFLAGS $CXXOPT $CXXDEBUG"
F77FLAGS="$F77FLAGS $FOPT $FDEBUG"
dnl * set generic default for blas usage
if test -z "$casc_using_blas"
then
casc_using_blas=no
fi
if test "$casc_using_blas" = "yes"
then
if test "$ARCH" = "rs6000"
then
BLASLIBFLAGS=-lessl
AC_DEFINE(HYPRE_USING_ESSL)
elif test "$ARCH" = "alpha"
then
BLASLIBFLAGS=-ldxml
AC_DEFINE(HYPRE_USING_DXML)
elif test "$ARCH" = "hpux"
then
BLASLIBFLAGS="-lblas -lcl"
else
casc_using_blas=no
fi
elif test "$casc_using_blas" = "no"
then
BLASLIBFLAGS=-lHYPRE_blas
AC_DEFINE(HYPRE_USING_HYPRE_BLAS)
else
BLASLIBFLAGS=$casc_using_blas
fi
dnl *********************************************************************
dnl * Add flags to LIBS and LIBDIRS
dnl * Note: CASC_ADD_LIB calls should be placed in the order you want the
dnl * libraries to appear on the linking line.
dnl *********************************************************************
CASC_ADD_LIB(m, main, /usr/lib /usr/ccs/lib)
dnl *********************************************************************
dnl * AC_SUBST performs the variable substitutions
dnl * Some macros call AC_SUBST for some variables, but it does no damage
dnl * to call it again.
dnl *********************************************************************
dnl ********************************************************************
dnl * The following macros are exported and may be used in Makefile.in's
dnl ********************************************************************
CC="$PREPEND $CC"
CXX="$PREPEND $CXX"
dnl * General purpose header files and libraries and directories for
dnl * those libraries.
AC_SUBST(INCLUDES)
AC_SUBST(LIBS)
AC_SUBST(LIBDIRS)
dnl * MPI-related header files and libraries and directories for
dnl * those libraries
AC_SUBST(MPIINCLUDE)
AC_SUBST(MPILIBS)
AC_SUBST(MPILIBDIRS)
AC_SUBST(MPIFLAGS)
dnl * macro definitions that should be included on compile line
AC_SUBST(TIMERDEFS)
dnl *Libraries and their directories that must be used at compile time
AC_SUBST(LDLIBS)
AC_SUBST(LDLIBDIRS)
AC_SUBST(RANLIB)
dnl * contains compiler flags such as optimization or debugging flags
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(F77FLAGS)
AC_SUBST(LDFLAGS)
dnl *needed when compiling with another command prior to the compiler command
dnl * for example: purify cc ....
AC_SUBST(PREPEND)
dnl *BABEL-related header files, libraries and directories for those
dnl * libraries
AC_SUBST(BABEL_HYPRE_INCLUDES)
AC_SUBST(BABELLIBFLAGS)
AC_SUBST(HYPRE_BABELLIBDIR)
AC_SUBST(BABEL_RUNTIME_DIR)
dnl *MLI-related header files, libraries and directories for those
dnl * libraries
AC_SUBST(MLI_DIR)
AC_SUBST(MLILIBS)
AC_SUBST(MLILIBDIRS)
AC_SUBST(MLIINCLUDE)
dnl *FEI-helper variables for installing libraries, and includes, and
dnl * build options
AC_SUBST(FEI_BASE_DIR)
AC_SUBST(FEI_LIB_DIR)
AC_SUBST(FEI_INC_DIR)
AC_SUBST(HYPRE_TOP_SRC_DIR)
AC_SUBST(CSUPERLUFLAGS)
AC_SUBST(BLASLIBFLAGS)
dnl Configure Babel runtime if needed...
if test "$casc_using_babel" = "yes"
then
# JNI_INCLUDES has a path needed for Java support on Frost by Babel runtime:
# JNI_INCLUDES has a path needed for Java support on known systems on by Babel runtime:
JNI_INCLUDES="-I /usr/java130/include $JNI_INCLUDES" # Frost, AIX
JNI_INCLUDES="-I /usr/java/include -I /usr/java/include/solaris $JNI_INCLUDES" # pylus, Solaris
export JNI_INCLUDES
# Default C and Fortran compilers differ for this configure file and the Babel
# runtime configure file on LLNL MP AIX machines:
if test -z "$F77" ; then
AC_MSG_WARN([Fortran compiler not found-- try setting --with-F77])
fi
if test -z "$CC" ; then
AC_MSG_WARN([C compiler not found-- try setting --with-CC])
fi
export F77
export CC
# Other language environment variables should also be set here.
dnl We want to configure babel-runtime iff we get here. It doesn't work to simply
dnl put AC_CONFIG_SUBDIRS(babel-runtime) inside this if block, because the macro
dnl expands to something tacked onto the end of the configure script. So instead
dnl use a trick suggested by Alexandre Oliva in a GNU mailing list, April 1999:
config_babel_runtime=babel-runtime
else
config_babel_runtime=
fi
dnl Babel runtime library, per Gary Kumfert Sept02:
AC_CONFIG_SUBDIRS($config_babel_runtime)
dnl *********************************************************************
dnl * Use CASC_CONFIG_OUTPUT_LIST with AC_OUTPUT if you want to handle the
dnl * possibility that certain parts of the package are not present.
dnl *********************************************************************
CASC_CONFIG_OUTPUT_LIST(\
.\
amge\
babel\
babel/bHYPRE\
babel/bHYPREClient-C\
babel/bHYPREClient-F\
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/femli\
FEI_mv/femli/amgs\
FEI_mv/femli/base\
FEI_mv/femli/matrix\
FEI_mv/femli/solver\
FEI_mv/femli/vector\
FEI_mv/femli/cintface\
FEI_mv/femli/util\
FEI_mv/femli/fedata\
FEI_mv/femli/mapper\
FEI_mv/femli/lib\
IJ_mv\
krylov\
matrix_matrix\
parcsr_ls\
parcsr_es/LOBPCG\
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)
AC_OUTPUT($Makefile_list)