968 lines
27 KiB
Plaintext
968 lines
27 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)
|
|
AM_CONFIG_HEADER(./HYPRE_config.h)
|
|
|
|
|
|
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 *
|
|
|
|
unset CC
|
|
unset CXX
|
|
unset F77
|
|
|
|
casc_user_chose_compilers=no
|
|
casc_user_chose_mpi=no
|
|
casc_using_pthreads=no
|
|
casc_using_babel=no
|
|
casc_using_petsc=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],
|
|
CC=$withval
|
|
casc_user_chose_compilers=yes
|
|
)
|
|
|
|
AC_ARG_WITH(CXX, [\
|
|
--with-CXX=ARG User can manually set C++ compiler to ARG],
|
|
CXX=$withval
|
|
casc_user_chose_compilers=yes
|
|
)
|
|
|
|
AC_ARG_WITH(F77, [\
|
|
--with-f77=ARG User can manually set f77 compiler to ARG],
|
|
F77=$withval
|
|
casc_user_chose_compilers=yes
|
|
)
|
|
|
|
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],
|
|
CFLAGS=$withval
|
|
)
|
|
|
|
AC_ARG_WITH(CXXFLAGS, [\
|
|
--with-CXXFLAGS=ARG User can manually set c++ compiler flags.],
|
|
CXXFLAGS=$withval
|
|
)
|
|
|
|
AC_ARG_WITH(F77FLAGS, [\
|
|
--with-F77FLAGS=ARG User can manually set f77 compiler flags],
|
|
F77FLAGS=$withval
|
|
)
|
|
|
|
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
|
|
)
|
|
|
|
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.],
|
|
MPIFLAGS=$withval
|
|
)
|
|
|
|
AC_ARG_WITH(purify, [\
|
|
--with-purify=FLAGS FLAGS are optional to pass to purify, e.g.
|
|
\"-log-file=struct_linear_solvers.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
|
|
if test "$withval" = "no"
|
|
then
|
|
PREPEND=""
|
|
elif test "$withval" = "yes"
|
|
then
|
|
PREPEND="purify"
|
|
else
|
|
PREPEND="purify $withval"
|
|
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
|
|
if test "$withval" = "no"
|
|
then
|
|
PREPEND=""
|
|
elif test "$withval" = "yes"
|
|
then
|
|
PREPEND="purify -log-file=purify.log -append-logfile=yes -best-effort"
|
|
else
|
|
PREPEND="purify $withval"
|
|
fi
|
|
)
|
|
|
|
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++
|
|
casc_users_chose_compilers=yes
|
|
CFLAGS="$CFLAGS -g"
|
|
CXXFLAGS="$CXXFLAGS -g"
|
|
CASC_CHECK_HEADER(cegdb.h, /home/casc/include,
|
|
CASC_ADD_LIB(cegdb, cegdb, /home/casc/lib, LD)
|
|
)
|
|
)
|
|
|
|
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++
|
|
casc_users_chose_compilers=yes
|
|
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)
|
|
)
|
|
)
|
|
|
|
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 236,826,1018,1021,1022,1023,1024,1030"
|
|
CXXFLAGS="$CXXFLAGS --strict --lint --display_error_number"]
|
|
casc_users_chose_compilers=yes
|
|
casc_using_mpi=no
|
|
AC_DEFINE(HYPRE_SEQUENTIAL)
|
|
)
|
|
|
|
dnl *********************************************************************
|
|
dnl * If the user has specified any other command line options (without-MPI,
|
|
dnl * with-pthreads, 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],
|
|
casc_using_mpi=$withval,
|
|
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.],
|
|
CFLAGS="$CFLAGS -DHYPRE_COMM_SIMPLE"
|
|
)
|
|
|
|
AC_ARG_WITH(dmalloc, [\
|
|
--with-dmalloc use dmalloc package--no checking is done to ensure
|
|
the package is on the machine],
|
|
CASC_ADD_LIB(dmalloc, malloc, /home/casc/lib /usr/local/lib,
|
|
LD, AC_DEFINE(HYPRE_MEMORY_DMALLOC) )
|
|
)
|
|
|
|
AC_ARG_WITH(timing, [\
|
|
--with-timing use HYPRE timing routines],
|
|
AC_DEFINE(HYPRE_TIMING)
|
|
)
|
|
|
|
AC_ARG_WITH(pthreads, [\
|
|
--with-pthreads use pthreads-- this may affect which compiler
|
|
is chosen. Tests are done to check for the
|
|
pthread library. Supported on IBM only.],
|
|
casc_using_pthreads=yes
|
|
CASC_CHECK_LIB(pthread, pthread_create, ,
|
|
[CASC_CHECK_LIB(pthreads, pthread_create)])
|
|
|
|
if test "$ac_cv_lib_pthread_pthread_create" = "yes" ||
|
|
test "$ac_cv_lib_pthreads_pthread_create" = "yes"
|
|
then
|
|
AC_DEFINE(HYPRE_USE_PTHREADS)
|
|
fi
|
|
)
|
|
|
|
AC_ARG_WITH(openmp, [\
|
|
--with-openmp use openMP--this may affect which compiler is
|
|
chosen. Supported on IBM and DECS only.],
|
|
casc_using_openmp=yes
|
|
AC_DEFINE(HYPRE_USING_OPENMP)
|
|
)
|
|
|
|
AC_ARG_WITH(IBM_smp, [\
|
|
--with-IBM_smp use IBM SMP--not yet supported],
|
|
casc_using_ibm_smp=yes
|
|
AC_DEFINE(HYPRE_USING_IBM_SMP)
|
|
)
|
|
|
|
AC_ARG_WITH(SGI_smp, [\
|
|
--with-SGI_smp use SGI SMP--not yet supported],
|
|
casc_using_sgi_smp=yes
|
|
AC_DEFINE(HYPRE_USING_SGI_SMP)
|
|
)
|
|
|
|
AC_ARG_WITH(pgcc_smp, [\
|
|
--with-pgcc_smp use pgcc SMP (Red)--not yet supported],
|
|
casc_using_pgcc_smp=yes
|
|
AC_DEFINE(HYPRE_USING_PGCC_SMP)
|
|
)
|
|
|
|
AC_ARG_WITH(blas, [\
|
|
--with-blas search for and use the BLAS],
|
|
casc_using_blas=$withval,
|
|
casc_using_blas=
|
|
)
|
|
|
|
dnl top level source directory
|
|
HYPRE_TOP_SRC_DIR=`pwd`
|
|
|
|
AC_ARG_WITH(babel, [\
|
|
--with-babel use babel],
|
|
casc_using_babel=yes
|
|
)
|
|
|
|
AC_ARG_WITH(petsc, [\
|
|
--with-petsc use petsc],
|
|
casc_using_petsc=yes
|
|
HYPRE_PETSCDEFS="$HYPRE_PETSCDEFS -DPETSC_AVAILABLE"
|
|
HYPRE_PETSCLIBDIRS="$HYPRE_TOP_SRC_DIR/PETScMat_linear_solvers/pilut \
|
|
$HYPRE_TOP_SRC_DIR/PETSc_linear_solvers/ParILUT "
|
|
HYPRE_PETSCLIBS=" -l_HYPRE_PETScSolverParILUT \
|
|
-l_HYPRE_PETScMatPilutSolver "
|
|
)
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
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 * pthreads or no pthreads, 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 *********************************************************************
|
|
|
|
if test -z "$CC"
|
|
then
|
|
|
|
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"
|
|
then
|
|
if test "$casc_using_mpi" = "yes"
|
|
then
|
|
CASC_CHECK_HEADER(mpi.h, /opt/intel/tflop/TF99_2.6.1/tflops/cougar/include)
|
|
MPIINCLUDE="$MPIINCLUDE $INCLUDES"
|
|
CASC_ADD_LIB(mpi, main, /opt/intel/tflop/TF99_2.6.1/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
|
|
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"
|
|
then
|
|
if 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
|
|
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"
|
|
then
|
|
if 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
|
|
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
|
|
|
|
;;
|
|
|
|
esac
|
|
fi
|
|
|
|
if test -z "$CC"
|
|
then
|
|
|
|
case $ARCH in
|
|
sun4 | solaris )
|
|
|
|
if test "$casc_user_chose_compilers" = "no"
|
|
then
|
|
if test "$casc_using_mpi" = "no"
|
|
then
|
|
AC_CHECK_PROGS(CC, cc gcc kcc)
|
|
AC_CHECK_PROGS(CXX, CC g++)
|
|
AC_CHECK_PROGS(F77, f77 g77)
|
|
else
|
|
AC_CHECK_PROGS(CC, mpicc)
|
|
AC_CHECK_PROGS(CXX, mpiCC)
|
|
AC_CHECK_PROGS(F77, mpif77)
|
|
fi
|
|
fi
|
|
|
|
CASC_SET_COPT(-O)
|
|
CASC_SET_CDEBUG(-g)
|
|
CASC_SET_CXXOPT(-O)
|
|
CASC_SET_CXXDEBUG(-g)
|
|
CASC_SET_FOPT(-O -silent)
|
|
CASC_SET_FDEBUG(-g -silent)
|
|
|
|
AC_DEFINE(HYPRE_SOLARIS)
|
|
|
|
;;
|
|
|
|
alpha)
|
|
|
|
if test "$casc_user_chose_compilers" = "no"
|
|
then
|
|
if test "$casc_using_mpi" = "no" &&
|
|
test "$casc_using_openmp" = "no"
|
|
then
|
|
AC_CHECK_PROGS(CC,cc kcc gcc c89)
|
|
AC_CHECK_PROGS(CXX,cxx KCC g++)
|
|
AC_CHECK_PROGS(F77,f77 kf77 g77)
|
|
else
|
|
if test "$casc_using_openmp" = "no"
|
|
then
|
|
AC_CHECK_PROGS(CC,mpicc cc kcc)
|
|
AC_CHECK_PROGS(CXX,mpiCC cxx KCC)
|
|
AC_CHECK_PROGS(F77,mpif77 f77 kf77)
|
|
else
|
|
AC_CHECK_PROGS(CC,guidec)
|
|
AC_CHECK_PROGS(CXX,guidec++)
|
|
AC_CHECK_PROGS(F77,guidef77)
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if test "$CC" = "cc" ||
|
|
test "$CC" = "kcc" ||
|
|
test "$CC" = "guidec" &&
|
|
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(rt, main, /usr/lib)
|
|
dnl * there seem to be a problem here
|
|
dnl * HYPRE_ADD_LIB(mpi, main, /usr/opt/MPI170/lib, MPI, ,
|
|
dnl * CASC_ADD_LIB(mpi, main, /usr/lib, MPI) )
|
|
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 "$CC" = "kcc"
|
|
then
|
|
CASC_SET_COPT(-o5)
|
|
CASC_SET_CDEBUG()
|
|
else
|
|
CASC_SET_COPT(-O)
|
|
CASC_SET_CDEBUG(-g)
|
|
fi
|
|
|
|
if test "$F77" = "kf77"
|
|
then
|
|
CASC_SET_FOPT(-o5)
|
|
CASC_SET_FDEBUG()
|
|
else
|
|
CASC_SET_FOPT(-O)
|
|
CASC_SET_FDEBUG()
|
|
fi
|
|
|
|
CASC_SET_CXXOPT(-O)
|
|
CASC_SET_CXXDEBUG(-g)
|
|
if test -z "$casc_using_blas"
|
|
then
|
|
casc_using_blas=yes
|
|
fi
|
|
|
|
AC_DEFINE(HYPRE_ALPHA)
|
|
|
|
;;
|
|
|
|
rs6000)
|
|
|
|
if test "$casc_user_chose_compilers" = "no"
|
|
then
|
|
if test "$casc_using_mpi" = "no"
|
|
then
|
|
if test "$casc_using_pthreads" = "no" &&
|
|
test "$casc_using_openmp" = "no"
|
|
then
|
|
AC_CHECK_PROGS(CC,xlc gcc cc c89)
|
|
AC_CHECK_PROGS(CXX,xlC KCC g++)
|
|
AC_CHECK_PROGS(F77,xlf g77)
|
|
else
|
|
if test "$casc_using_pthreads" = "yes"
|
|
then
|
|
AC_CHECK_PROGS(CC,xlc_r gcc)
|
|
AC_CHECK_PROGS(CXX,xlC_r g++)
|
|
AC_CHECK_PROGS(F77,xlf_r g77)
|
|
fi
|
|
if test "$casc_using_openmp" = "yes"
|
|
then
|
|
AC_CHECK_PROGS(CC,guidec)
|
|
AC_CHECK_PROGS(CXX,guidec++)
|
|
AC_CHECK_PROGS(F77,guidef77)
|
|
fi
|
|
fi
|
|
else
|
|
if test "$casc_using_pthreads" = "no" &&
|
|
test "$casc_using_openmp" = "no"
|
|
then
|
|
AC_CHECK_PROGS(CC,mpcc mpicc)
|
|
AC_CHECK_PROGS(CXX,mpCC mpiCC)
|
|
AC_CHECK_PROGS(F77,mpxlf mpif77)
|
|
AC_PROG_CPP
|
|
else
|
|
if test "$casc_using_pthreads" = "yes"
|
|
then
|
|
AC_CHECK_PROGS(CC,mpxlc_r mpcc_r mpicc)
|
|
AC_CHECK_PROGS(CXX,mpxlC_r mpCC_r mpiCC)
|
|
AC_CHECK_PROGS(F77,mpxlf_r mpif77)
|
|
fi
|
|
if test "$casc_using_openmp" = "yes"
|
|
then
|
|
AC_CHECK_PROGS(CC,mpguidec)
|
|
AC_CHECK_PROGS(CXX,mpguidec++)
|
|
AC_CHECK_PROGS(F77,mpguidef77)
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
CASC_SET_COPT(-O3 -qstrict)
|
|
CASC_SET_CDEBUG(-g)
|
|
CASC_SET_FOPT(-O3 -qstrict)
|
|
CASC_SET_FDEBUG(-g)
|
|
CASC_SET_CXXOPT(-O3 -qstrict)
|
|
CASC_SET_CXXDEBUG(-g)
|
|
CFLAGS="$CFLAGS -qmaxmem=8192 -DHYPRE_COMM_SIMPLE"
|
|
if test -z "$casc_using_blas"
|
|
then
|
|
casc_using_blas=yes
|
|
fi
|
|
|
|
AC_DEFINE(HYPRE_RS6000)
|
|
|
|
;;
|
|
|
|
IRIX64)
|
|
|
|
if test "$casc_user_chose_compilers" = "no"
|
|
then
|
|
if test "$casc_using_mpi" = "no"
|
|
then
|
|
AC_CHECK_PROGS(CC, cc gcc c89)
|
|
AC_CHECK_PROGS(CXX, cxx CC g++)
|
|
AC_CHECK_PROGS(F77, f77 g77)
|
|
else
|
|
AC_CHECK_PROGS(CC, mpicc mpcc tmcc hcc)
|
|
AC_CHECK_PROGS(CXX, mpiCC)
|
|
AC_CHECK_PROGS(F77, mpif77)
|
|
if test -z "$CC"
|
|
then
|
|
AC_CHECK_PROGS(CC, cc gcc)
|
|
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
|
|
fi
|
|
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/local/mpi/include)
|
|
MPIINCLUDE="$MPIINCLUDE -I$INCLUDES"
|
|
CASC_ADD_LIB(mpi, main, /usr/local/mpi/lib, MPI)
|
|
if test -z "$MPILIBS"
|
|
then
|
|
AC_MSG_WARN([MPI not found--in IRIX64 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)
|
|
|
|
AC_DEFINE(HYPRE_IRIX64)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$CC"
|
|
then
|
|
if test "$casc_user_chose_compilers" = "no"
|
|
then
|
|
if test "$casc_using_mpi" = "no"
|
|
then
|
|
AC_CHECK_PROGS(CC, cc kcc gcc c89)
|
|
AC_CHECK_PROGS(CXX, cxx CC KCC g++)
|
|
AC_CHECK_PROGS(F77, f77 kf77 g77)
|
|
else
|
|
AC_CHECK_PROGS(CC, mpicc mpcc tmcc hcc)
|
|
AC_CHECK_PROGS(CXX, mpiCC)
|
|
AC_CHECK_PROGS(F77, mpif77)
|
|
if test -z "$CC"
|
|
then
|
|
AC_CHECK_PROGS(CC, cc kcc gcc)
|
|
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
|
|
fi
|
|
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/local/mpi/include)
|
|
MPIINCLUDE="$MPIINCLUDE -I$INCLUDES"
|
|
CASC_ADD_LIB(mpi, main, /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)
|
|
CASC_SET_CDEBUG()
|
|
else
|
|
CASC_SET_COPT(-O)
|
|
CASC_SET_CDEBUG(-g)
|
|
fi
|
|
if test "$F77" = "kf77"
|
|
then
|
|
CASC_SET_FOPT(-o5)
|
|
CASC_SET_FDEBUG()
|
|
else
|
|
CASC_SET_FOPT(-O)
|
|
CASC_SET_FDEBUG()
|
|
fi
|
|
|
|
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_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
|
|
HYPRE_FIND_MPI
|
|
fi
|
|
|
|
if test "$casc_using_babel" = "yes"
|
|
then
|
|
dnl jfp: temporary, until Babel has been installed somewhere:
|
|
# 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_stubs_c\
|
|
-I${BABEL_DIR}\
|
|
-I${BABEL_DIR}/babel"
|
|
BABELLIBFLAGS="-L../babel/Hypre -lhypre_class -L${BABEL_DIR}/babel -lbabel"
|
|
|
|
dnl babeldir="$HOME"
|
|
dnl AC_SUBST(babeldir)
|
|
dnl CASC_FIND_BABEL
|
|
|
|
AM_INIT_AUTOMAKE()
|
|
fi
|
|
|
|
if test "$casc_using_petsc" = "yes"
|
|
then
|
|
CASC_FIND_PETSC
|
|
dnl *** this is a hack; should go in above macro ***
|
|
PETSCLIBDIRS="$PETSCLIBDIRS -L/usr/openwin/lib"
|
|
PETSCLIBS="$PETSCLIBS -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 *********************************************************************
|
|
|
|
if test "$casc_user_chose_compilers" = "no"
|
|
then
|
|
CASC_OPT_DEBUG_CHOICES
|
|
fi
|
|
|
|
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
|
|
CASC_FIND_BLAS
|
|
if test "$BLASLIBFLAGS" = "-lessl"
|
|
then
|
|
AC_DEFINE(HYPRE_USING_ESSL)
|
|
elif test "$BLASLIBFLAGS" = "-ldxml"
|
|
then
|
|
AC_DEFINE(HYPRE_USING_DXML)
|
|
elif test "$BLASLIBFLAGS" = ""
|
|
then
|
|
casc_using_blas=no
|
|
fi
|
|
fi
|
|
|
|
if test "$casc_using_blas" = "no"
|
|
then
|
|
BLASLIBFLAGS=-lHYPRE_blas
|
|
AC_DEFINE(HYPRE_USING_HYPRE_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)
|
|
|
|
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_DIR)
|
|
AC_SUBST(BABEL_HYPRE_INCLUDES)
|
|
AC_SUBST(BABELLIBFLAGS)
|
|
|
|
dnl *PETSC-related header files, libraries and directories for those
|
|
dnl * libraries
|
|
AC_SUBST(PETSCLIBS)
|
|
AC_SUBST(PETSCLIBDIRS)
|
|
AC_SUBST(PETSCINCLUDE)
|
|
AC_SUBST(HYPRE_PETSCDEFS)
|
|
AC_SUBST(HYPRE_PETSCLIBS)
|
|
AC_SUBST(HYPRE_PETSCLIBDIRS)
|
|
|
|
|
|
AC_SUBST(HYPRE_TOP_SRC_DIR)
|
|
|
|
AC_SUBST(BLASLIBFLAGS)
|
|
|
|
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(\
|
|
.\
|
|
babel/Hypre\
|
|
blas\
|
|
utilities\
|
|
struct_matrix_vector\
|
|
struct_linear_solvers\
|
|
sstruct_matrix_vector\
|
|
sstruct_linear_solvers\
|
|
seq_matrix_vector\
|
|
parcsr_matrix_vector\
|
|
distributed_matrix\
|
|
matrix_matrix\
|
|
IJ_matrix_vector\
|
|
distributed_linear_solvers/pilut\
|
|
parcsr_linear_solvers\
|
|
seq_linear_solvers/pamg\
|
|
seq_linear_solvers/amge\
|
|
CI_struct_linear_solvers\
|
|
CI_struct_matrix_vector\
|
|
structIJ_matrix_vector\
|
|
FEI_matrix_vector/fei-hypre\
|
|
FEI_matrix_vector/fei-isis/src\
|
|
FEI_matrix_vector/isis-mv\
|
|
PETScMat_linear_solvers/pilut\
|
|
PETSc_linear_solvers/ParILUT\
|
|
distributed_linear_solvers/ParaSails\
|
|
test\
|
|
tools\
|
|
docs)
|
|
|
|
AC_OUTPUT($Makefile_list)
|
|
|
|
|
|
|