2005-10-20 22:01:39 +08:00
|
|
|
AC_INIT(ESPRESSO, 3.0, , espresso)
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-03-23 23:43:32 +08:00
|
|
|
# -----------------------------
|
|
|
|
# application-specific settings
|
|
|
|
|
|
|
|
# default choices
|
|
|
|
# set each variable to 0 (false) or 1 (true)
|
|
|
|
use_parallel=1
|
|
|
|
use_shared=1
|
|
|
|
|
|
|
|
# -----------------------------
|
|
|
|
|
2003-11-13 21:35:10 +08:00
|
|
|
# store variables from the environment (may be set or not)
|
|
|
|
topdir=$TOPDIR
|
2004-09-15 23:11:27 +08:00
|
|
|
arch=$ARCH
|
2005-10-06 02:11:25 +08:00
|
|
|
env_cc=$CC
|
|
|
|
mpicc=$MPICC
|
2003-11-13 21:35:10 +08:00
|
|
|
cpp=$CPP
|
|
|
|
cflags=$CFLAGS
|
|
|
|
cppflags=$CPPFLAGS
|
|
|
|
dflags=$DFLAGS
|
|
|
|
f77=$F77
|
|
|
|
f90=$F90
|
2005-10-06 02:11:25 +08:00
|
|
|
mpif77=$MPIF77
|
|
|
|
mpif90=$MPIF90
|
2003-11-13 21:35:10 +08:00
|
|
|
fflags=$FFLAGS
|
|
|
|
f90flags=$F90FLAGS
|
|
|
|
ld=$LD
|
|
|
|
ldflags=$LDFLAGS
|
2005-05-31 22:23:38 +08:00
|
|
|
blas_libs=$BLAS_LIBS
|
|
|
|
lapack_libs=$LAPACK_LIBS
|
|
|
|
fft_libs=$FFT_LIBS
|
|
|
|
mpi_libs=$MPI_LIBS
|
|
|
|
mass_libs=$MASS_LIBS
|
2004-02-11 18:50:03 +08:00
|
|
|
libdirs=$LIBDIRS
|
2003-11-13 21:35:10 +08:00
|
|
|
ar=$AR
|
|
|
|
arflags=$ARFLAGS
|
2004-02-11 18:50:03 +08:00
|
|
|
mylib=$MYLIB
|
2004-02-17 01:30:59 +08:00
|
|
|
includefftw=$INCLUDEFFTW
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2004-02-25 21:59:47 +08:00
|
|
|
# command-line arguments
|
|
|
|
for arg in $*
|
|
|
|
do
|
2005-03-23 23:43:32 +08:00
|
|
|
if test "$arg" = "--enable-parallel" ; then use_parallel=1
|
|
|
|
elif test "$arg" = "--disable-parallel" ; then use_parallel=0
|
|
|
|
elif test "$arg" = "--enable-shared" ; then use_shared=1
|
|
|
|
elif test "$arg" = "--disable-shared" ; then use_shared=0
|
2004-02-25 21:59:47 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2003-11-13 21:35:10 +08:00
|
|
|
# configure for current directory by default
|
|
|
|
if test "$topdir" = "" ; then topdir="`pwd`" ; fi
|
|
|
|
|
|
|
|
# check system type (no cross-compilation for now)
|
|
|
|
AC_CANONICAL_BUILD
|
|
|
|
|
2005-01-26 22:34:55 +08:00
|
|
|
# many HPC systems are configured so that running parallel programs
|
|
|
|
# interactively is disabled: on those systems, AC_PROG_F77 and AC_PROG_CC
|
|
|
|
# would fail because they can't run the compiled executables
|
2004-11-25 19:33:35 +08:00
|
|
|
# to work around that, let's pretend we are cross-compiling even if we aren't
|
2005-01-26 22:34:55 +08:00
|
|
|
# !!! this relies on undocumented Autoconf behavior !!!
|
|
|
|
if test "$host" = "" ; then host=$build ; fi
|
|
|
|
cross_compiling=yes
|
2004-11-25 19:33:35 +08:00
|
|
|
|
2005-03-23 23:43:32 +08:00
|
|
|
# identify architecture
|
2004-09-15 23:11:27 +08:00
|
|
|
if test "$arch" = ""
|
|
|
|
then
|
2004-11-25 19:33:35 +08:00
|
|
|
case $host in
|
2005-11-30 02:15:04 +08:00
|
|
|
ia64-*-linux-gnu ) arch=ia64 ;;
|
|
|
|
x86_64-*-linux-gnu ) arch=amd64 ;;
|
|
|
|
*-pc-linux-gnu ) arch=ia32 ;;
|
|
|
|
*-ibm-aix* ) arch=aix ;;
|
|
|
|
mips-sgi-* ) arch=mips ;;
|
|
|
|
alphaev*-dec-osf* ) arch=alpha ;;
|
|
|
|
alphaev*-*-linux* ) arch=alinux ;;
|
|
|
|
sparc-sun-* ) arch=sparc ;;
|
|
|
|
*cray-unicosmp* ) arch=crayx1 ;;
|
|
|
|
powerpc-apple-darwin* ) arch=mac ;;
|
|
|
|
*-pc-cygwin ) arch=cygwin ;;
|
2004-09-15 23:11:27 +08:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
echo checking architecture... $arch
|
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
# candidate compilers, archiver and flags based on architecture
|
2004-09-15 23:11:27 +08:00
|
|
|
case $arch in
|
2005-11-30 02:15:04 +08:00
|
|
|
ia64 | amd64 )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_mpif90="mpif90"
|
2004-09-15 23:11:27 +08:00
|
|
|
try_f90="ifort ifc efc pgf90 g95 f90"
|
2004-06-21 21:05:28 +08:00
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
|
|
|
try_dflags="-D__LINUX64"
|
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32 )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_mpif90="mpif90"
|
2004-09-07 17:11:57 +08:00
|
|
|
try_f90="ifort ifc pgf90 g95 f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
|
|
|
try_dflags="-D__LINUX"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
aix )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_mpif90="mpxlf90_r mpxlf90"
|
2004-09-07 17:11:57 +08:00
|
|
|
try_f90="xlf90_r xlf90 f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="-X64 ruv"
|
2006-03-17 02:32:40 +08:00
|
|
|
try_dflags="-D__AIX"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mips )
|
2004-09-07 17:11:57 +08:00
|
|
|
try_f90="f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
2006-01-27 00:42:14 +08:00
|
|
|
try_dflags="-D__COMPLIB -D__SGI64 -D__ORIGIN"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
alpha )
|
2004-09-07 17:11:57 +08:00
|
|
|
try_f90="f90"
|
2004-02-20 00:06:36 +08:00
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
2004-09-28 18:51:50 +08:00
|
|
|
try_dflags="-D__ALPHA"
|
2004-02-20 00:06:36 +08:00
|
|
|
;;
|
2004-09-27 16:22:18 +08:00
|
|
|
alinux )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_mpif90="mpif90"
|
2004-09-27 16:22:18 +08:00
|
|
|
try_f90="fort g95 f90"
|
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
2004-09-28 18:51:50 +08:00
|
|
|
try_dflags="-D__ALPHA -D__LINUX64"
|
2004-09-27 16:22:18 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
sparc )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_mpif90="mpf90"
|
2004-09-07 17:11:57 +08:00
|
|
|
try_f90="f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
2004-09-29 16:32:12 +08:00
|
|
|
try_dflags="-D__SUN"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
crayx1 )
|
2004-07-14 18:21:04 +08:00
|
|
|
try_f90="ftn"
|
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
|
|
|
try_dflags="-D__X1"
|
2004-08-10 00:35:51 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mac )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_mpif90="mpxlf90 mpf90"
|
2004-09-07 17:11:57 +08:00
|
|
|
try_f90="xlf90 f90"
|
2004-08-10 00:35:51 +08:00
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
2006-03-17 02:32:40 +08:00
|
|
|
try_dflags="-D__MAC"
|
2004-08-10 00:35:51 +08:00
|
|
|
ranlib="ranlib"
|
2004-07-14 18:21:04 +08:00
|
|
|
;;
|
2005-10-14 21:14:46 +08:00
|
|
|
cygwin )
|
|
|
|
try_mpif90="mpif90"
|
|
|
|
try_f90="g95 f90"
|
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
|
|
|
try_dflags="-D__LINUX"
|
|
|
|
;;
|
2003-11-13 21:35:10 +08:00
|
|
|
* )
|
|
|
|
AC_MSG_WARN(unsupported architecture)
|
|
|
|
try_f90="f90"
|
|
|
|
try_ar="ar"
|
|
|
|
try_arflags="ruv"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
if test "$use_parallel" -ne 0
|
|
|
|
then
|
|
|
|
# clear cached values
|
|
|
|
unset F77 ac_cv_prog_ac_ct_F77 ac_cv_f77_compiler_gnu ac_cv_prog_f77_g
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
# check parallel Fortran 90 compiler
|
2005-10-06 18:08:41 +08:00
|
|
|
if test "$mpif90" = "" -a "$f90" != "" ; then mpif90=$f90; fi
|
2005-10-06 02:11:25 +08:00
|
|
|
if test "$mpif90" = "" ; then mpif90="$try_mpif90 $try_f90" ; fi
|
|
|
|
AC_PROG_F77($mpif90)
|
|
|
|
mpif90=$F77
|
|
|
|
|
|
|
|
case "$arch" in
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32 | ia64 | amd64 )
|
2005-10-06 02:11:25 +08:00
|
|
|
# check which compiler does mpif90 wrap
|
|
|
|
echo $ECHO_N "checking version of $mpif90... $ECHO_C"
|
|
|
|
ifort_version=`$mpif90 -V 2>&1 | grep "Intel(R)"`
|
|
|
|
pgf_version=`$mpif90 -V 2>&1 | grep "^pgf"`
|
|
|
|
g95_version=`$mpif90 -v 2>&1 | grep "g95"`
|
|
|
|
if test "$ifort_version" != ""
|
2004-05-12 22:21:25 +08:00
|
|
|
then
|
2005-10-06 02:11:25 +08:00
|
|
|
version=`$mpif90 -V 2>&1 | grep Version |
|
|
|
|
sed 's/.*Version//' | awk '{print $1}'`
|
|
|
|
if test `echo $version | sed 's/\..*//'` -lt 8
|
|
|
|
then
|
|
|
|
try_f90="ifc efc"
|
|
|
|
echo "${ECHO_T}ifc $version"
|
|
|
|
else
|
|
|
|
try_f90="ifort efc"
|
|
|
|
echo "${ECHO_T}ifort $version"
|
|
|
|
fi
|
|
|
|
elif test "$pgf_version" != ""
|
|
|
|
then
|
|
|
|
version=`echo $pgf_version | awk '{print $2}'`
|
|
|
|
try_f90="pgf90"
|
|
|
|
echo "${ECHO_T}pgf90 $version"
|
|
|
|
elif test "$g95_version" != ""
|
|
|
|
then
|
|
|
|
version=`echo $g95_version | awk '{print $3}'`
|
|
|
|
try_f90="g95"
|
|
|
|
echo "${ECHO_T}g95 $version"
|
2004-05-12 22:21:25 +08:00
|
|
|
else
|
2005-10-06 02:11:25 +08:00
|
|
|
echo "${ECHO_T}unknown"
|
2004-05-12 22:21:25 +08:00
|
|
|
fi
|
2005-10-06 02:11:25 +08:00
|
|
|
;;
|
|
|
|
esac
|
2004-05-04 19:05:45 +08:00
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$arch:$mpif90" in
|
|
|
|
*:mpif90 )
|
|
|
|
try_mpicc="mpicc"
|
|
|
|
try_mpif77="mpif77"
|
|
|
|
;;
|
|
|
|
*:mpf90 )
|
|
|
|
try_mpicc="mpcc"
|
|
|
|
try_mpif77="mpf77"
|
|
|
|
;;
|
|
|
|
aix:mpxlf*_r )
|
|
|
|
try_mpicc="mpcc_r"
|
|
|
|
try_mpif77="mpxlf_r"
|
|
|
|
;;
|
|
|
|
aix:mpxlf* )
|
|
|
|
try_mpicc="mpcc"
|
|
|
|
try_mpif77="mpxlf"
|
|
|
|
;;
|
|
|
|
mac:mpxlf* )
|
|
|
|
try_mpicc="mpcc"
|
|
|
|
try_mpif77="mpxlf mpf77"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2003-11-20 01:10:26 +08:00
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
# clear cached values
|
|
|
|
unset F77 ac_cv_prog_ac_ct_F77 ac_cv_f77_compiler_gnu ac_cv_prog_f77_g
|
2004-05-12 22:21:25 +08:00
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
# check serial Fortran 90 compiler
|
|
|
|
if test "$f90" = "" ; then f90="$try_f90" ; fi
|
|
|
|
AC_PROG_F77($f90)
|
|
|
|
f90=$F77
|
|
|
|
if test "$use_parallel" -eq 0 ; then mpif90=$f90 ; fi
|
|
|
|
|
|
|
|
echo setting F90... $f90
|
|
|
|
echo setting MPIF90... $mpif90
|
|
|
|
|
|
|
|
case "$arch:$f90" in
|
2005-11-30 02:15:04 +08:00
|
|
|
*:ifort* )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_cc="icc ecc gcc cc"
|
2005-10-06 18:08:41 +08:00
|
|
|
try_f77="$f90"
|
2005-10-06 02:11:25 +08:00
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
*:ifc* )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_cc="icc ecc gcc cc"
|
2005-10-06 18:08:41 +08:00
|
|
|
try_f77="$f90"
|
2005-10-06 02:11:25 +08:00
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
*:pgf90 )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_cc="pgcc gcc cc"
|
|
|
|
try_f77="pgf77 $f90"
|
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
*:g95 )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_cc="gcc cc"
|
2005-10-06 18:08:41 +08:00
|
|
|
try_f77="$f90"
|
2005-10-06 02:11:25 +08:00
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32:* | ia64:* | amd64:* )
|
2005-10-06 02:11:25 +08:00
|
|
|
try_cc="gcc cc"
|
|
|
|
try_f77="f77 $f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
aix:*xlf*_r )
|
2004-05-12 22:21:25 +08:00
|
|
|
try_cc="xlc_r cc gcc"
|
|
|
|
try_f77="xlf_r f77 $f90"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
aix:*xlf* )
|
2004-05-05 00:18:42 +08:00
|
|
|
try_cc="xlc cc gcc"
|
|
|
|
try_f77="xlf f77 $f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mips:* )
|
2003-11-20 01:10:26 +08:00
|
|
|
try_cc="cc gcc"
|
|
|
|
try_f77="f77 $f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
alpha:* )
|
2004-02-20 00:06:36 +08:00
|
|
|
try_cc="cc gcc"
|
|
|
|
try_f77="f77 $f90"
|
|
|
|
;;
|
2004-09-27 16:22:18 +08:00
|
|
|
alinux:* )
|
|
|
|
try_cc="ccc gcc"
|
|
|
|
try_f77="fort g77 f77 $f90"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
sparc:* )
|
2004-05-05 00:18:42 +08:00
|
|
|
try_cc="cc gcc"
|
|
|
|
try_f77="f77 $f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
crayx1:ftn )
|
2004-07-14 18:21:04 +08:00
|
|
|
try_cc="cc"
|
|
|
|
try_f77="$f90"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mac:xlf90 )
|
2004-09-01 18:32:08 +08:00
|
|
|
try_cc="gcc"
|
|
|
|
try_f77="xlf f77 $f90"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mac:* )
|
2004-08-10 00:35:51 +08:00
|
|
|
try_cc="gcc"
|
|
|
|
try_f77="f77 $f90"
|
|
|
|
;;
|
2005-10-14 21:14:46 +08:00
|
|
|
cygwin*:g95 )
|
|
|
|
try_cc="gcc cc"
|
2005-10-29 06:18:36 +08:00
|
|
|
try_f77="g95 $f90"
|
2005-10-14 21:14:46 +08:00
|
|
|
;;
|
2003-11-13 21:35:10 +08:00
|
|
|
* )
|
2004-05-12 22:21:25 +08:00
|
|
|
# unknown, try these
|
2003-11-20 01:10:26 +08:00
|
|
|
try_cc="cc gcc"
|
|
|
|
try_f77="f77 $f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
|
|
|
esac
|
2004-05-12 22:21:25 +08:00
|
|
|
|
2005-03-23 23:43:32 +08:00
|
|
|
if test "$use_parallel" -ne 0
|
2004-05-05 00:18:42 +08:00
|
|
|
then
|
2005-10-06 02:11:25 +08:00
|
|
|
# clear cached values
|
|
|
|
unset CC ac_cv_prog_ac_ct_CC ac_cv_c_compiler_gnu ac_cv_prog_cc_g
|
|
|
|
|
|
|
|
# check parallel C compiler
|
|
|
|
if test "$mpicc" = "" ; then mpicc="$try_mpicc $try_cc" ; fi
|
|
|
|
AC_PROG_CC($mpicc)
|
|
|
|
mpicc=$CC
|
|
|
|
|
|
|
|
# clear cached values
|
|
|
|
unset F77 ac_cv_prog_ac_ct_F77 ac_cv_f77_compiler_gnu ac_cv_prog_f77_g
|
|
|
|
|
|
|
|
# check parallel Fortran 77 compiler
|
|
|
|
if test "$mpif77" = "" ; then mpif77="$try_mpif77 $try_f77" ; fi
|
|
|
|
AC_PROG_F77($mpif77)
|
|
|
|
mpif77=$F77
|
2004-05-05 00:18:42 +08:00
|
|
|
fi
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
# clear cached values
|
|
|
|
unset CC ac_cv_prog_ac_ct_CC ac_cv_c_compiler_gnu ac_cv_prog_cc_g
|
|
|
|
|
|
|
|
# check serial C compiler
|
|
|
|
if test "$env_cc" = "" ; then cc="$try_cc" ; else cc="$env_cc"; fi
|
|
|
|
AC_PROG_CC($cc)
|
|
|
|
cc=$CC
|
|
|
|
if test "$use_parallel" -eq 0 ; then mpicc=$cc ; fi
|
|
|
|
|
|
|
|
echo setting CC... $cc
|
|
|
|
echo setting MPICC... $mpicc
|
|
|
|
|
2003-11-20 01:10:26 +08:00
|
|
|
# clear cached values
|
|
|
|
unset F77 ac_cv_prog_ac_ct_F77 ac_cv_f77_compiler_gnu ac_cv_prog_f77_g
|
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
# check serial Fortran 77 compiler
|
2003-11-13 21:35:10 +08:00
|
|
|
if test "$f77" = "" ; then f77="$try_f77" ; fi
|
|
|
|
AC_PROG_F77($f77)
|
|
|
|
f77=$F77
|
2005-10-06 02:11:25 +08:00
|
|
|
if test "$use_parallel" -eq 0 ; then mpif77=$f77 ; fi
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
echo setting F77... $f77
|
|
|
|
echo setting MPIF77... $mpif77
|
2003-11-13 21:35:10 +08:00
|
|
|
|
|
|
|
# check whether the C and Fortran compilers are compatible
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$arch:$cc:$f90" in
|
2003-11-13 21:35:10 +08:00
|
|
|
# list supported combinations here
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32:icc:ifort* | ia32:icc:ifc* ) ;;
|
|
|
|
ia32:gcc:ifort* | ia32:gcc:ifc* ) ;;
|
|
|
|
ia32:pgcc:pgf90 ) ;;
|
|
|
|
ia32:gcc:g95 ) ;;
|
|
|
|
ia64:icc:ifort* | ia64:icc:ifc* ) ;;
|
|
|
|
ia64:gcc:ifort* | ia64:gcc:ifc* ) ;;
|
|
|
|
ia64:pgcc:pgf90 ) ;;
|
|
|
|
ia64:gcc:g95 ) ;;
|
|
|
|
amd64:icc:ifort* | amd64:icc:ifc* ) ;;
|
|
|
|
amd64:gcc:ifort* | amd64:gcc:ifc* ) ;;
|
|
|
|
amd64:pgcc:pgf90 ) ;;
|
|
|
|
amd64:gcc:g95 ) ;;
|
|
|
|
aix:mpcc*:mpxlf* ) ;;
|
|
|
|
aix:xlc*:*xlf* | aix:cc:*xlf* ) ;;
|
|
|
|
mips:cc:f90 ) ;;
|
|
|
|
alinux:ccc:fort | alinux:gcc:fort ) ;;
|
|
|
|
alpha:cc:f90 ) ;;
|
|
|
|
mac:mpcc:mpf90 ) ;;
|
|
|
|
mac:gcc:xlf90 ) ;;
|
|
|
|
crayx1:cc:ftn ) ;;
|
|
|
|
sparc:cc:f90 ) ;;
|
|
|
|
cygwin:gcc:g95 ) ;;
|
2004-02-11 18:50:03 +08:00
|
|
|
|
2003-11-13 21:35:10 +08:00
|
|
|
* )
|
|
|
|
AC_MSG_WARN(unsupported C/Fortran compilers combination)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2004-05-12 22:21:25 +08:00
|
|
|
# check Fortran compiler flags
|
2005-03-23 23:43:32 +08:00
|
|
|
have_cpp=0
|
|
|
|
xlf_flags=0
|
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$arch:$f90" in
|
2005-11-30 02:15:04 +08:00
|
|
|
ia64:ifort* | amd64:ifort* )
|
2004-10-06 20:23:52 +08:00
|
|
|
try_fflags="-O2 -assume byterecl"
|
2004-05-12 22:21:25 +08:00
|
|
|
try_f90flags="\$(FFLAGS) -nomodule"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_fflags_noopt="-O0 -assume byterecl"
|
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -nomodule"
|
2004-10-06 20:23:52 +08:00
|
|
|
try_ldflags=""
|
2004-03-19 23:01:49 +08:00
|
|
|
try_ldflags_static="-static"
|
|
|
|
try_dflags="$try_dflags -D__INTEL"
|
2004-08-20 21:15:35 +08:00
|
|
|
pre_fdflags="-fpp "
|
2004-03-19 23:01:49 +08:00
|
|
|
have_cpp=1
|
|
|
|
;;
|
2005-11-30 19:02:30 +08:00
|
|
|
ia64:ifc* )
|
2004-09-22 22:20:06 +08:00
|
|
|
try_fflags="-Vaxlib -O2"
|
|
|
|
try_f90flags="\$(FFLAGS) -nomodule"
|
|
|
|
try_fflags_noopt="-O0"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -nomodule"
|
2004-09-22 22:20:06 +08:00
|
|
|
try_ldflags="-Vaxlib"
|
|
|
|
try_ldflags_static="-static"
|
|
|
|
try_dflags="$try_dflags -D__INTEL"
|
|
|
|
pre_fdflags="-fpp "
|
|
|
|
have_cpp=1
|
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
ia64:pgf* | amd64:pgf* )
|
2004-06-21 21:05:28 +08:00
|
|
|
try_fflags="-fast -r8"
|
|
|
|
try_f90flags="\$(FFLAGS)"
|
|
|
|
try_fflags_noopt="-O0"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT)"
|
2004-06-21 21:05:28 +08:00
|
|
|
try_ldflags=""
|
|
|
|
try_ldflags_static="-Bstatic"
|
|
|
|
try_dflags="$try_dflags -D__PGI"
|
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32:ifort* )
|
2004-10-06 20:23:52 +08:00
|
|
|
try_fflags="-O2 -tpp6 -assume byterecl"
|
2004-05-12 22:21:25 +08:00
|
|
|
try_f90flags="\$(FFLAGS) -nomodule"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_fflags_noopt="-O0 -assume byterecl"
|
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -nomodule"
|
2004-10-06 20:23:52 +08:00
|
|
|
try_ldflags=""
|
2004-05-12 22:21:25 +08:00
|
|
|
try_ldflags_static="-static"
|
|
|
|
try_dflags="$try_dflags -D__INTEL"
|
2004-08-20 21:15:35 +08:00
|
|
|
pre_fdflags="-fpp "
|
2004-05-12 22:21:25 +08:00
|
|
|
have_cpp=1
|
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32:ifc* )
|
2004-05-12 22:21:25 +08:00
|
|
|
try_fflags="-Vaxlib -O2 -tpp6"
|
|
|
|
try_f90flags="\$(FFLAGS) -nomodule"
|
|
|
|
try_fflags_noopt="-O0"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -nomodule"
|
2004-05-12 22:21:25 +08:00
|
|
|
try_ldflags="-Vaxlib"
|
|
|
|
try_ldflags_static="-static"
|
|
|
|
try_dflags="$try_dflags -D__INTEL"
|
2004-08-20 21:15:35 +08:00
|
|
|
pre_fdflags="-fpp "
|
2004-05-12 22:21:25 +08:00
|
|
|
have_cpp=1
|
2003-11-20 01:10:26 +08:00
|
|
|
|
2004-05-12 22:21:25 +08:00
|
|
|
if test `echo $version | sed 's/\..*//'` -lt 7
|
2004-05-04 19:05:45 +08:00
|
|
|
then
|
2004-05-12 22:21:25 +08:00
|
|
|
# old versions of ifc require this stuff
|
|
|
|
echo $ECHO_N "setting up ifc environment... $ECHO_C"
|
|
|
|
try_f90flags="\$(FFLAGS) -cl,./intel.pcl"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -cl,./intel.pcl"
|
2005-02-02 21:41:10 +08:00
|
|
|
pcl_ph="D3 Raman"
|
2005-01-06 01:23:07 +08:00
|
|
|
pcl_pw="PH PP Gamma PWCOND pwtools $pcl_ph"
|
2005-02-02 21:41:10 +08:00
|
|
|
pcl_modules="PW CPV flib upftools atomic $pcl_pw"
|
2004-05-12 22:21:25 +08:00
|
|
|
pcl_dot=". Modules $pcl_modules"
|
|
|
|
for dir in $pcl_dot
|
|
|
|
do
|
|
|
|
echo work.pc > $topdir/$dir/intel.pcl
|
|
|
|
done
|
|
|
|
for dir in $pcl_modules
|
|
|
|
do
|
|
|
|
echo ../Modules/work.pc >> $topdir/$dir/intel.pcl
|
|
|
|
done
|
|
|
|
for dir in $pcl_pw
|
|
|
|
do
|
|
|
|
echo ../PW/work.pc >> $topdir/$dir/intel.pcl
|
|
|
|
done
|
|
|
|
for dir in $pcl_ph
|
|
|
|
do
|
|
|
|
echo ../PH/work.pc >> $topdir/$dir/intel.pcl
|
|
|
|
done
|
|
|
|
echo "${ECHO_T}done"
|
2003-11-20 01:10:26 +08:00
|
|
|
fi
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32:pgf* )
|
2004-05-12 22:21:25 +08:00
|
|
|
try_fflags="-fast -r8"
|
|
|
|
try_f90flags="\$(FFLAGS)"
|
|
|
|
try_fflags_noopt="-O0"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT)"
|
2004-05-12 22:21:25 +08:00
|
|
|
try_ldflags=""
|
|
|
|
try_ldflags_static="-Bstatic"
|
|
|
|
try_dflags="$try_dflags -D__PGI"
|
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
*:g95 )
|
2005-10-07 00:38:53 +08:00
|
|
|
try_fflags="-O3 -cpp"
|
2004-05-12 22:21:25 +08:00
|
|
|
try_f90flags="\$(FFLAGS)"
|
2005-10-07 00:38:53 +08:00
|
|
|
try_fflags_noopt="-O0 -cpp"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT)"
|
2004-05-12 22:21:25 +08:00
|
|
|
try_ldflags=""
|
|
|
|
#try_ldflags_static="-static"
|
|
|
|
try_dflags="$try_dflags -D__G95"
|
2005-10-07 00:38:53 +08:00
|
|
|
have_cpp=1
|
2004-05-12 22:21:25 +08:00
|
|
|
;;
|
2005-10-14 21:14:46 +08:00
|
|
|
cygwin:g95 )
|
|
|
|
try_fflags="-O3 -cpp"
|
|
|
|
try_f90flags="\$(FFLAGS)"
|
|
|
|
try_fflags_noopt="-O0 -cpp"
|
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT)"
|
|
|
|
try_ldflags=""
|
|
|
|
#try_ldflags_static="-static"
|
|
|
|
try_dflags="$try_dflags -D__G95"
|
|
|
|
have_cpp=1
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
aix:*xlf* )
|
2003-11-13 21:35:10 +08:00
|
|
|
try_fflags="-q64 -qalias=noaryovrlp -O3 -qstrict \
|
2005-03-16 20:20:24 +08:00
|
|
|
-qarch=auto -qtune=auto -qdpc -Q -qalias=nointptr"
|
|
|
|
try_f90flags="\$(FFLAGS) -qsuffix=cpp=f90 -qfree=f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_fflags_noopt="-q64 -O0"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -qsuffix=cpp=f90 -qfree=f90"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_ldflags="-q64"
|
2004-02-25 21:59:47 +08:00
|
|
|
# try_ldflags_static="-bstatic"
|
2004-08-20 21:15:35 +08:00
|
|
|
pre_fdflags="-WF,"
|
|
|
|
xlf_flags=1
|
2003-11-13 21:35:10 +08:00
|
|
|
have_cpp=1
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mips:f90 )
|
2003-11-13 21:35:10 +08:00
|
|
|
try_fflags="-mips4 -64 -O2 -r10000 -r8"
|
|
|
|
try_f90flags="\$(FFLAGS)"
|
|
|
|
try_fflags_noopt="-mips4 -64 -O0"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT)"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_ldflags="-mips4 -64"
|
2006-02-17 00:46:41 +08:00
|
|
|
pre_fdflags="-ftpp -macro_expand "
|
2003-11-13 21:35:10 +08:00
|
|
|
have_cpp=1
|
|
|
|
;;
|
2004-09-27 16:22:18 +08:00
|
|
|
alinux:fort )
|
|
|
|
have_cpp=1
|
|
|
|
pre_fdflags="-cpp "
|
|
|
|
try_fflags="-O -r8 -align dcommons -align records"
|
|
|
|
try_f90flags="\$(FFLAGS) -free"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_fflags_noopt="-O0 -r8 -align dcommons -align records"
|
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -free"
|
2004-09-27 16:22:18 +08:00
|
|
|
try_ldflags_static="-non_shared"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
alpha:f90 )
|
2004-02-20 00:06:36 +08:00
|
|
|
have_cpp=1
|
2004-08-20 21:15:35 +08:00
|
|
|
pre_fdflags="-cpp "
|
2006-03-08 18:07:42 +08:00
|
|
|
try_fflags="-O -real_size 64 -align dcommons -align records -assume buffered_io -fpe1"
|
2004-02-20 00:06:36 +08:00
|
|
|
try_f90flags="\$(FFLAGS) -free"
|
2006-02-09 15:30:15 +08:00
|
|
|
try_fflags_noopt="-O0 -real_size 64 -align dcommons -align records -assume buffered_io"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -free"
|
2004-02-20 00:06:36 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
sparc:mpf90 | sparc:f90 )
|
2004-12-21 23:47:43 +08:00
|
|
|
try_fflags="-fast -O1 -nodepend -xvector=no -xchip=ultra3 \
|
|
|
|
-xarch=v8plusb -xlic_lib=sunperf"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_f90flags="\$(FFLAGS)"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_fflags_noopt="-O0 -xlic_lib=sunperf"
|
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT)"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_ldflags=""
|
2005-03-09 00:51:41 +08:00
|
|
|
imod="-M"
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
crayx1:ftn )
|
2004-09-28 18:51:50 +08:00
|
|
|
try_fflags="-s default64 -dp -rma -e0 \
|
|
|
|
-O scalar3,stream3,vector3,nointerchange -Z -O inline5"
|
2004-07-14 18:21:04 +08:00
|
|
|
try_f90flags="\$(FFLAGS)"
|
2004-11-25 01:34:47 +08:00
|
|
|
try_fflags_noopt="-s default64 -dp -rma -e0 -O0 -Z"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT)"
|
2004-07-14 18:21:04 +08:00
|
|
|
try_ldflags="-s default64 -f nan64"
|
|
|
|
try_dflags="$try_dflags -D__X1_COA"
|
2004-08-20 21:15:35 +08:00
|
|
|
pre_fdflags="-e Z -F"
|
2004-07-14 18:21:04 +08:00
|
|
|
have_cpp=1
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mac:* )
|
2004-09-28 18:51:50 +08:00
|
|
|
try_fflags="-O4 -qarch=auto -qtune=auto -qsuffix=cpp=f90 \
|
|
|
|
-qdpc -qalias=nointptr"
|
2004-08-10 00:35:51 +08:00
|
|
|
try_f90flags="\$(FFLAGS) -qfree=f90"
|
|
|
|
try_fflags_noopt="-O0"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="\$(FFLAGS_NOOPT) -qfree=f90"
|
2004-08-10 00:35:51 +08:00
|
|
|
try_ldflags=""
|
2004-08-20 21:15:35 +08:00
|
|
|
pre_fdflags="-WF,"
|
|
|
|
xlf_flags=1
|
2004-08-10 00:35:51 +08:00
|
|
|
have_cpp=1
|
2003-11-13 21:35:10 +08:00
|
|
|
;;
|
|
|
|
* )
|
2004-05-12 22:21:25 +08:00
|
|
|
# unknown, try these
|
2003-11-13 21:35:10 +08:00
|
|
|
try_fflags="-O"
|
|
|
|
try_f90flags="\$(FFLAGS)"
|
|
|
|
try_fflags_noopt="-O0"
|
2005-03-16 20:20:24 +08:00
|
|
|
try_f90flags_noopt="$\(FFLAGS_NOOPT)"
|
2003-11-13 21:35:10 +08:00
|
|
|
try_ldflags=""
|
|
|
|
;;
|
|
|
|
esac
|
2005-03-23 23:43:32 +08:00
|
|
|
if test "$use_shared" -eq 0 ; then
|
|
|
|
try_ldflags="$try_ldflags $try_ldflags_static" ; fi
|
2004-02-25 21:59:47 +08:00
|
|
|
|
2004-11-25 01:34:47 +08:00
|
|
|
if test "$fflags" = "" ; then fflags=$try_fflags ; fi
|
|
|
|
if test "$f90flags" = "" ; then f90flags=$try_f90flags ; fi
|
|
|
|
if test "$fflags_noopt" = "" ; then fflags_noopt=$try_fflags_noopt ; fi
|
|
|
|
if test "$f90flags_noopt" = "" ; then f90flags_noopt=$try_f90flags_noopt ; fi
|
2003-11-20 01:10:26 +08:00
|
|
|
echo setting FFLAGS... $fflags
|
2003-11-13 21:35:10 +08:00
|
|
|
echo setting F90FLAGS... $f90flags
|
2004-11-25 01:34:47 +08:00
|
|
|
echo setting FFLAGS_NOOPT... $fflags_noopt
|
|
|
|
echo setting F90FLAGS_NOOPT... $f90flags_noopt
|
2005-03-09 00:51:41 +08:00
|
|
|
if test "$imod" = "" ; then imod="-I" ; fi
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$arch:$cc" in
|
2005-11-30 02:15:04 +08:00
|
|
|
*:icc )
|
2004-03-19 23:01:49 +08:00
|
|
|
try_cflags="-O3"
|
2004-10-06 20:23:52 +08:00
|
|
|
c_ldflags=""
|
2004-03-19 23:01:49 +08:00
|
|
|
;;
|
2005-11-30 02:15:04 +08:00
|
|
|
*:pgcc )
|
2004-06-21 21:05:28 +08:00
|
|
|
try_cflags="-fast"
|
|
|
|
c_ldflags=""
|
|
|
|
try_cpp="cpp"
|
|
|
|
;;
|
2005-10-14 21:14:46 +08:00
|
|
|
cygwin:gcc )
|
|
|
|
try_cflags="-O3 -fomit-frame-pointer"
|
|
|
|
c_ldflags=""
|
|
|
|
try_cpp="cpp"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
aix:mpcc* | aix:xlc* | aix:cc )
|
2003-11-20 01:10:26 +08:00
|
|
|
try_cflags="-q64 -O2"
|
|
|
|
c_ldflags="-q64"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mips:cc )
|
2003-11-20 01:10:26 +08:00
|
|
|
try_cflags="-mips4 -64 -O2 -r10000"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
alpha:cc )
|
2004-02-20 00:06:36 +08:00
|
|
|
try_cflags="-O"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
sparc:mpcc | sparc:cc )
|
2003-11-20 01:10:26 +08:00
|
|
|
try_cflags="-fast -dalign -xchip=ultra3 -xarch=v8plusb \
|
|
|
|
-xlic_lib=sunperf"
|
2004-05-12 22:21:25 +08:00
|
|
|
try_cpp="fpp"
|
2003-11-20 01:10:26 +08:00
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
crayx1:cc )
|
2004-07-14 18:21:04 +08:00
|
|
|
try_cflags=""
|
|
|
|
c_ldflags=""
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mac:gcc )
|
2004-08-10 00:35:51 +08:00
|
|
|
try_cflags="-O3 -fomit-frame-pointer -I/usr/include/malloc"
|
2004-09-15 16:02:26 +08:00
|
|
|
try_cpp="cpp"
|
|
|
|
;;
|
2004-09-15 23:11:27 +08:00
|
|
|
mac:* )
|
2004-09-15 16:02:26 +08:00
|
|
|
try_cflags="-O4"
|
2004-08-10 00:35:51 +08:00
|
|
|
;;
|
2003-11-20 01:10:26 +08:00
|
|
|
*:gcc )
|
|
|
|
try_cflags="-O3 -fomit-frame-pointer"
|
2005-11-30 02:15:04 +08:00
|
|
|
c_ldflags=""
|
2004-06-23 22:45:08 +08:00
|
|
|
try_cpp="cpp"
|
2003-11-20 01:10:26 +08:00
|
|
|
;;
|
|
|
|
* )
|
|
|
|
try_cflags="-O"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test "$cflags" = "" ; then cflags=$try_cflags ; fi
|
|
|
|
echo setting CFLAGS... $cflags
|
|
|
|
|
2003-11-13 21:35:10 +08:00
|
|
|
# preprocessor
|
|
|
|
AC_PROG_CPP
|
|
|
|
if test "$cpp" = "" ; then cpp=$try_cpp; fi
|
|
|
|
if test "$cpp" = "" ; then cpp=$CPP; fi
|
2004-05-12 22:21:25 +08:00
|
|
|
echo setting CPP... $cpp
|
2003-11-13 21:35:10 +08:00
|
|
|
|
|
|
|
echo $ECHO_N "setting CPPFLAGS... $ECHO_C"
|
|
|
|
case $cpp in
|
|
|
|
cpp) try_cppflags="-P -traditional" ;;
|
|
|
|
fpp) try_cppflags="-P" ;;
|
|
|
|
*) try_cppflags="" ;;
|
|
|
|
esac
|
|
|
|
if test "$cppflags" = "" ; then cppflags=$try_cppflags ; fi
|
|
|
|
echo "${ECHO_T}$cppflags"
|
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
# linker and archiver
|
|
|
|
if test "$ld" = "" ; then ld="$mpif90" ; fi
|
2003-11-13 21:35:10 +08:00
|
|
|
if test "$ldflags" = "" ; then ldflags="$try_ldflags" ; fi
|
|
|
|
if test "$ar" = "" ; then ar="$try_ar" ; fi
|
|
|
|
if test "$arflags" = "" ; then arflags="$try_arflags" ; fi
|
|
|
|
echo setting LD... $ld
|
|
|
|
echo setting LDFLAGS... $ldflags
|
|
|
|
echo setting AR... $ar
|
|
|
|
echo setting ARFLAGS... $arflags
|
|
|
|
|
|
|
|
# compilation rules
|
2004-11-04 23:32:37 +08:00
|
|
|
AC_PROG_MAKE_SET
|
2003-11-13 21:35:10 +08:00
|
|
|
echo $ECHO_N "checking whether Fortran files must be preprocessed... $ECHO_C"
|
2005-03-23 23:43:32 +08:00
|
|
|
if test "$have_cpp" -ne 0
|
2003-11-13 21:35:10 +08:00
|
|
|
then
|
2005-10-06 17:44:04 +08:00
|
|
|
f90rule="\$(MPIF90) \$(F90FLAGS) -c \$<"
|
2003-11-13 21:35:10 +08:00
|
|
|
echo "${ECHO_T}no"
|
|
|
|
else
|
2004-09-27 23:05:32 +08:00
|
|
|
f90rule="\$(CPP) \$(CPPFLAGS) \$< -o \$*.F90 \\
|
2005-10-06 17:44:04 +08:00
|
|
|
\$(MPIF90) \$(F90FLAGS) -c \$*.F90 -o \$*.o"
|
2003-11-13 21:35:10 +08:00
|
|
|
echo "${ECHO_T}yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# compilation flags for all subsequent tests
|
|
|
|
# remove all $(...) because at least one compiler doesn't like them
|
|
|
|
# but if f90flags contains $(FFLAGS), substitute it
|
|
|
|
test_cflags="`echo $cflags | sed 's/\$([[^)]]*)//g'`"
|
|
|
|
test_cppflags="$test_cflags"
|
|
|
|
if test "`echo $f90flags | grep '$(FFLAGS)'`" != ""
|
|
|
|
then
|
|
|
|
test_fflags="`echo $fflags $f90flags | sed 's/\$([[^)]]*)//g'`"
|
|
|
|
else
|
|
|
|
test_fflags="`echo $f90flags | sed 's/\$([[^)]]*)//g'`"
|
|
|
|
fi
|
|
|
|
test_ldflags="`echo $ldflags | sed 's/\$([[^)]]*)//g'`"
|
|
|
|
|
2003-11-20 01:10:26 +08:00
|
|
|
AC_LANG_PUSH(Fortran 77)
|
2004-02-20 00:06:36 +08:00
|
|
|
F77=$f90 # use Fortran 90 actually (autoconf only knows Fortran 77!)
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
# search for libraries
|
2005-03-23 23:43:32 +08:00
|
|
|
have_blas=0
|
2005-10-06 17:44:04 +08:00
|
|
|
have_mkl=0
|
2005-03-23 23:43:32 +08:00
|
|
|
have_lapack=0
|
|
|
|
have_essl=0
|
|
|
|
have_fft=0
|
|
|
|
have_fftw=0
|
|
|
|
have_fftw_h=0
|
|
|
|
have_mpi=0
|
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
# check for blas
|
|
|
|
# supported vendor replacements:
|
|
|
|
# mkl on linux
|
|
|
|
# essl on aix
|
|
|
|
# complib.sgimath on mips
|
|
|
|
# cxml on alpha
|
|
|
|
# SUNperf on sparc
|
|
|
|
# atlas is used over blas if available
|
|
|
|
# internal version is used if none is found
|
|
|
|
if test "$blas_libs" = ""
|
2003-11-13 21:35:10 +08:00
|
|
|
then
|
2005-05-11 00:55:02 +08:00
|
|
|
# check directories in LD_LIBRARY_PATH too
|
|
|
|
# (maybe they are already searched by default, but I'm not sure)
|
|
|
|
ld_library_path=`echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
|
|
|
|
|
2004-02-11 18:50:03 +08:00
|
|
|
# build list of directories to search
|
2004-09-15 23:11:27 +08:00
|
|
|
case "$arch" in
|
2005-05-11 00:55:02 +08:00
|
|
|
mac ) try_libdirs="/usr/local/lib /sw/lib" ;;
|
|
|
|
*) try_libdirs="/usr/local/lib" ;;
|
2004-09-15 23:11:27 +08:00
|
|
|
esac
|
2004-02-11 18:50:03 +08:00
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
# search
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$arch:$f90" in
|
2005-05-11 00:55:02 +08:00
|
|
|
|
2005-11-30 02:15:04 +08:00
|
|
|
amd64:pgf* )
|
|
|
|
# check for acml
|
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
|
|
|
LIBS=""
|
|
|
|
AC_SEARCH_LIBS(dgemm, acml, have_blas=1 blas_libs="$LIBS")
|
|
|
|
;;
|
|
|
|
|
|
|
|
*:pgf* )
|
2005-10-06 17:44:04 +08:00
|
|
|
# check for PGI blas
|
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
|
|
|
LIBS=""
|
|
|
|
AC_SEARCH_LIBS(dgemm, blas, have_blas=1 blas_libs="$LIBS")
|
|
|
|
;;
|
|
|
|
|
2005-11-30 02:15:04 +08:00
|
|
|
ia64:* )
|
2005-05-11 00:55:02 +08:00
|
|
|
# check for mkl (in several directories)
|
2005-09-27 18:29:39 +08:00
|
|
|
try_libdirs="/opt/intel/mkl/8.0/lib/64
|
2005-10-14 21:14:46 +08:00
|
|
|
/opt/intel/mkl721/lib/64
|
2005-09-27 18:29:39 +08:00
|
|
|
/opt/intel/mkl72/lib/64
|
2005-05-11 00:55:02 +08:00
|
|
|
/opt/intel/mkl701/lib/64
|
|
|
|
/opt/intel/mkl70/lib/64
|
|
|
|
/opt/intel/mkl/mkl61/lib/64
|
|
|
|
/opt/intel/mkl/lib/64
|
|
|
|
/opt/intel/mkl61/lib/64"
|
2005-11-30 02:15:04 +08:00
|
|
|
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
2005-10-14 21:14:46 +08:00
|
|
|
|
2005-11-30 02:15:04 +08:00
|
|
|
for dir in none $try_libdirs
|
|
|
|
do
|
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_loption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_loption="-L$dir"
|
|
|
|
fi
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags $try_loption"
|
|
|
|
LIBS="-lguide -lpthread"
|
|
|
|
AC_SEARCH_LIBS(dgemm, mkl_ipf, have_blas=1 have_mkl=1
|
|
|
|
blas_libs="$try_loption $LIBS")
|
|
|
|
if test "$ac_cv_search_dgemm" != "no"
|
|
|
|
then break ; fi
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
|
|
|
amd64:* )
|
|
|
|
try_libdirs="/opt/intel/mkl/8.0/lib/em64t
|
|
|
|
/opt/intel/mkl721/lib/em64t"
|
2005-05-11 00:55:02 +08:00
|
|
|
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
|
|
|
|
|
|
|
for dir in none $try_libdirs
|
|
|
|
do
|
2005-05-31 22:23:38 +08:00
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_loption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_loption="-L$dir"
|
|
|
|
fi
|
2003-11-13 21:35:10 +08:00
|
|
|
FFLAGS="$test_fflags"
|
2005-05-11 00:55:02 +08:00
|
|
|
LDFLAGS="$test_ldflags $try_loption"
|
2005-10-14 21:14:46 +08:00
|
|
|
LIBS="-lguide -lpthread"
|
2005-11-30 02:15:04 +08:00
|
|
|
AC_SEARCH_LIBS(dgemm, mkl_em64t, have_blas=1 have_mkl=1
|
2005-05-31 22:23:38 +08:00
|
|
|
blas_libs="$try_loption $LIBS")
|
|
|
|
if test "$ac_cv_search_dgemm" != "no"
|
2005-05-11 00:55:02 +08:00
|
|
|
then break ; fi
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32:* )
|
2005-05-11 00:55:02 +08:00
|
|
|
# check for mkl (in several directories)
|
2005-09-27 18:29:39 +08:00
|
|
|
try_libdirs="/opt/intel/mkl/8.0/lib/32
|
2005-10-14 21:14:46 +08:00
|
|
|
/opt/intel/mkl721/lib/32
|
2005-09-27 18:29:39 +08:00
|
|
|
/opt/intel/mkl72/lib/32
|
2005-05-11 00:55:02 +08:00
|
|
|
/opt/intel/mkl701/lib/32
|
|
|
|
/opt/intel/mkl70/lib/32
|
|
|
|
/opt/intel/mkl/mkl61/lib/32
|
|
|
|
/opt/intel/mkl/lib/32
|
|
|
|
/opt/intel/mkl61/lib/32
|
|
|
|
/cineca/prod/intel/lib"
|
|
|
|
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
|
|
|
|
|
|
|
for dir in none $try_libdirs
|
|
|
|
do
|
2005-05-31 22:23:38 +08:00
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_loption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_loption="-L$dir"
|
|
|
|
fi
|
2005-03-23 23:43:32 +08:00
|
|
|
FFLAGS="$test_fflags"
|
2005-05-11 00:55:02 +08:00
|
|
|
LDFLAGS="$test_ldflags $try_loption"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="-lguide -lpthread"
|
2005-09-27 19:07:33 +08:00
|
|
|
AC_SEARCH_LIBS(dgemm, mkl_ia32, have_blas=1 have_mkl=1
|
2005-05-31 22:23:38 +08:00
|
|
|
blas_libs="$try_loption $LIBS")
|
|
|
|
if test "$ac_cv_search_dgemm" != "no"
|
2005-05-11 00:55:02 +08:00
|
|
|
then break ; fi
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
|
|
|
aix:* )
|
|
|
|
# check for essl
|
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS=""
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_SEARCH_LIBS(dgemm, essl, have_essl=1 have_blas=1
|
2006-03-17 02:32:40 +08:00
|
|
|
blas_libs="$LIBS"
|
|
|
|
try_dflags="$try_dflags -D__ESSL")
|
2005-05-11 00:55:02 +08:00
|
|
|
;;
|
|
|
|
|
|
|
|
mips:* )
|
|
|
|
# check for complib.sgimath
|
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS=""
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_SEARCH_LIBS(dgemm, complib.sgimath, have_blas=1
|
2005-05-31 22:23:38 +08:00
|
|
|
blas_libs="$LIBS")
|
2005-05-11 00:55:02 +08:00
|
|
|
;;
|
|
|
|
|
|
|
|
alpha:* | alinux:* )
|
|
|
|
# check for cxml
|
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS=""
|
2005-12-21 03:54:32 +08:00
|
|
|
AC_SEARCH_LIBS(dgemm, cxml, have_blas=1 have_lapack=1
|
|
|
|
blas_libs="$LIBS")
|
|
|
|
;;
|
2005-05-11 00:55:02 +08:00
|
|
|
|
|
|
|
sparc:* )
|
|
|
|
# check for SUNperf library
|
|
|
|
unset ac_cv_search_zggev # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS=""
|
|
|
|
AC_SEARCH_LIBS(dgemm, sunperf, have_blas=1
|
|
|
|
blas_libs="-xlic_lib=sunperf $LIBS")
|
2005-05-11 00:55:02 +08:00
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test "$have_blas" -eq 0
|
|
|
|
then
|
|
|
|
# check for atlas (in several directories)
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$f90" in
|
2005-10-06 18:08:41 +08:00
|
|
|
ifort* | ifc* )
|
2005-05-11 00:55:02 +08:00
|
|
|
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
|
|
|
|
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
|
|
|
|
g95 ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
|
|
|
|
* ) try_libdirs="/usr/local/lib" ;;
|
|
|
|
esac
|
|
|
|
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
|
|
|
|
|
|
|
for dir in none $try_libdirs
|
|
|
|
do
|
2005-03-23 23:43:32 +08:00
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_loption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_loption="-L$dir"
|
|
|
|
fi
|
2005-03-23 23:43:32 +08:00
|
|
|
FFLAGS="$test_fflags"
|
2005-05-11 00:55:02 +08:00
|
|
|
LDFLAGS="$test_ldflags $try_loption"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="-latlas -lg2c"
|
|
|
|
AC_SEARCH_LIBS(dgemm, f77blas, have_blas=1
|
|
|
|
blas_libs="$try_loption $LIBS")
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$ac_cv_search_dgemm" != "no"
|
|
|
|
then break ; fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$have_blas" -eq 0
|
|
|
|
then
|
|
|
|
# check for blas (in several directories)
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$f90" in
|
2005-10-06 18:08:41 +08:00
|
|
|
ifort* | ifc* )
|
2005-05-11 00:55:02 +08:00
|
|
|
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
|
|
|
|
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
|
|
|
|
g95 ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
|
|
|
|
* ) try_libdirs="/usr/local/lib" ;;
|
|
|
|
esac
|
|
|
|
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
|
|
|
|
|
|
|
for dir in none $try_libdirs
|
|
|
|
do
|
2005-03-23 23:43:32 +08:00
|
|
|
unset ac_cv_search_dgemm # clear cached value
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_loption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_loption="-L$dir"
|
|
|
|
fi
|
2005-03-23 23:43:32 +08:00
|
|
|
FFLAGS="$test_fflags"
|
2005-05-11 00:55:02 +08:00
|
|
|
LDFLAGS="$test_ldflags $try_loption"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS=""
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_SEARCH_LIBS(dgemm, blas, have_blas=1
|
2005-05-31 22:23:38 +08:00
|
|
|
blas_libs="$try_loption $LIBS")
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$ac_cv_search_dgemm" != "no"
|
|
|
|
then break ; fi
|
|
|
|
done
|
|
|
|
fi
|
2005-05-31 22:23:38 +08:00
|
|
|
fi
|
|
|
|
echo setting BLAS_LIBS... $blas_libs
|
|
|
|
|
|
|
|
# check for lapack
|
|
|
|
# supported vendor replacements:
|
|
|
|
# mkl on linux
|
|
|
|
# SUNperf on sparc
|
|
|
|
# internal version is used if none is found
|
|
|
|
if test "$lapack_libs" = ""
|
|
|
|
then
|
|
|
|
# check directories in LD_LIBRARY_PATH too
|
|
|
|
# (maybe they are already searched by default, but I'm not sure)
|
|
|
|
ld_library_path=`echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
|
|
|
|
|
|
|
|
# build list of directories to search
|
|
|
|
case "$arch" in
|
|
|
|
mac ) try_libdirs="/usr/local/lib /sw/lib" ;;
|
|
|
|
*) try_libdirs="/usr/local/lib" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# search
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$arch:$f90" in
|
2005-05-31 22:23:38 +08:00
|
|
|
|
2005-11-30 02:15:04 +08:00
|
|
|
ia32:* | ia64:* | amd64:* )
|
2005-09-27 19:07:33 +08:00
|
|
|
# check for mkl_lapack
|
|
|
|
if test "$have_mkl" -ne 0
|
|
|
|
then
|
2005-05-31 22:23:38 +08:00
|
|
|
unset ac_cv_search_zggev # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
2005-09-27 19:07:33 +08:00
|
|
|
LDFLAGS="$test_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$blas_libs"
|
|
|
|
AC_SEARCH_LIBS(zggev, mkl_lapack, have_lapack=1
|
2005-09-27 19:07:33 +08:00
|
|
|
lapack_libs="-lmkl_lapack")
|
|
|
|
fi
|
2005-05-31 22:23:38 +08:00
|
|
|
;;
|
|
|
|
|
|
|
|
sparc:* )
|
|
|
|
# check for SUNperf library
|
|
|
|
unset ac_cv_search_zggev # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
|
|
|
LIBS="$blas_libs"
|
|
|
|
AC_SEARCH_LIBS(zggev, sunperf, have_lapack=1
|
|
|
|
lapack_libs="-xlic_lib=sunperf $LIBS")
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
2005-05-11 00:55:02 +08:00
|
|
|
|
|
|
|
if test "$have_lapack" -eq 0
|
|
|
|
then
|
|
|
|
# check for lapack (in several directories)
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$f90" in
|
2005-10-06 18:08:41 +08:00
|
|
|
ifort* | ifc* )
|
2005-05-11 00:55:02 +08:00
|
|
|
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
|
|
|
|
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
|
|
|
|
g95 ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
|
|
|
|
*xlf* ) try_libdirs="/usr/local/lib /cineca/lib" ;;
|
|
|
|
* ) try_libdirs="/usr/local/lib" ;;
|
|
|
|
esac
|
|
|
|
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
|
|
|
|
|
|
|
for dir in none $try_libdirs
|
|
|
|
do
|
2004-02-17 22:28:38 +08:00
|
|
|
unset ac_cv_search_zggev # clear cached value
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_loption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_loption="-L$dir"
|
|
|
|
fi
|
2003-11-13 21:35:10 +08:00
|
|
|
FFLAGS="$test_fflags"
|
2005-05-11 00:55:02 +08:00
|
|
|
LDFLAGS="$test_ldflags $try_loption"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$blas_libs"
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_SEARCH_LIBS(zggev, lapack, have_lapack=1
|
2005-05-31 22:23:38 +08:00
|
|
|
lapack_libs="$try_loption -llapack")
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$ac_cv_search_zggev" != "no"
|
|
|
|
then break ; fi
|
|
|
|
done
|
2005-03-23 23:43:32 +08:00
|
|
|
fi
|
2005-05-11 00:55:02 +08:00
|
|
|
# essl must precede lapack (if present)
|
|
|
|
if test "$have_essl" -ne 0 && test "$have_lapack" -ne 0
|
2005-05-31 22:23:38 +08:00
|
|
|
then lapack_libs="-lessl $lapack_libs" ; fi
|
|
|
|
fi
|
|
|
|
echo setting LAPACK_LIBS... $lapack_libs
|
|
|
|
|
|
|
|
# check for fftw
|
|
|
|
# supported vendor replacements:
|
|
|
|
# essl on aix
|
|
|
|
# SUNperf on sparc
|
|
|
|
# internal version is used if none is found
|
|
|
|
if test "$fft_libs" = ""
|
|
|
|
then
|
|
|
|
# check directories in LD_LIBRARY_PATH too
|
|
|
|
# (maybe they are already searched by default, but I'm not sure)
|
|
|
|
ld_library_path=`echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
|
2005-03-23 23:43:32 +08:00
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
# build list of directories to search
|
|
|
|
case "$arch" in
|
|
|
|
mac ) try_libdirs="/usr/local/lib /sw/lib" ;;
|
|
|
|
*) try_libdirs="/usr/local/lib" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# search
|
2005-05-11 00:55:02 +08:00
|
|
|
case "$arch" in
|
|
|
|
aix )
|
|
|
|
# check for essl
|
|
|
|
unset ac_cv_search_dcft # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$fft_libs"
|
|
|
|
AC_SEARCH_LIBS(dcft, essl, have_fft=1 fft_libs="$LIBS")
|
2005-05-11 00:55:02 +08:00
|
|
|
;;
|
|
|
|
sparc )
|
|
|
|
# check for SUNperf library
|
|
|
|
unset ac_cv_search_zfft3i # clear cached value
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
|
|
|
LIBS="$libs"
|
|
|
|
AC_SEARCH_LIBS(zfft3i, sunperf, have_fft=1
|
2005-05-31 22:23:38 +08:00
|
|
|
fft_libs="-xlic_lib=sunperf $LIBS")
|
2005-05-11 00:55:02 +08:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test "$have_fft" -eq 0
|
2005-03-23 23:43:32 +08:00
|
|
|
then
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_LANG_PUSH(C)
|
2004-03-19 23:01:49 +08:00
|
|
|
|
2005-05-11 00:55:02 +08:00
|
|
|
# check for fftw (in several directories)
|
2005-10-06 02:11:25 +08:00
|
|
|
case "$f90" in
|
2005-10-06 18:08:41 +08:00
|
|
|
ifort* | ifc* )
|
2005-05-11 00:55:02 +08:00
|
|
|
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
|
|
|
|
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
|
|
|
|
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
|
|
|
|
esac
|
|
|
|
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
2005-03-23 23:43:32 +08:00
|
|
|
|
2005-05-11 00:55:02 +08:00
|
|
|
for dir in none $try_libdirs
|
|
|
|
do
|
|
|
|
unset ac_cv_search_fftwnd # clear cached value
|
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_loption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_loption="-L$dir"
|
|
|
|
fi
|
|
|
|
CFLAGS="$test_cflags"
|
|
|
|
CPPFLAGS="$test_cppflags"
|
|
|
|
LDFLAGS="$c_ldflags $try_loption"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$fft_libs"
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_SEARCH_LIBS(fftwnd, fftw, have_fftw=1
|
2005-05-31 22:23:38 +08:00
|
|
|
fft_libs="$try_loption $LIBS", , -lm)
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$ac_cv_search_fftwnd" != "no"
|
|
|
|
then break ; fi
|
|
|
|
done
|
2005-03-23 23:43:32 +08:00
|
|
|
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_LANG_POP(C)
|
2005-03-23 23:43:32 +08:00
|
|
|
fi
|
2005-05-31 22:23:38 +08:00
|
|
|
fi
|
|
|
|
echo setting FFT_LIBS... $fft_libs
|
|
|
|
|
2005-10-06 02:11:25 +08:00
|
|
|
# check for mass on aix
|
|
|
|
if test "$mass_libs" = ""
|
|
|
|
then
|
|
|
|
# check directories in LD_LIBRARY_PATH too
|
|
|
|
# (maybe they are already searched by default, but I'm not sure)
|
|
|
|
ld_library_path=`echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
|
|
|
|
|
|
|
|
# build list of directories to search
|
|
|
|
case "$arch" in
|
|
|
|
mac ) try_libdirs="/usr/local/lib /sw/lib" ;;
|
|
|
|
*) try_libdirs="/usr/local/lib" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# search
|
|
|
|
case "$arch" in
|
|
|
|
aix )
|
|
|
|
# check for mass (in several directories)
|
|
|
|
try_libdirs="/usr/local/lib /cineca/lib /cineca/lib/mass"
|
|
|
|
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
|
|
|
|
|
|
|
for dir in none $try_libdirs
|
|
|
|
do
|
|
|
|
unset ac_cv_search_vexp # clear cached value
|
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_loption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_loption="-L$dir"
|
|
|
|
fi
|
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags $try_loption"
|
|
|
|
LIBS=""
|
|
|
|
AC_SEARCH_LIBS(vexp, massvp4 massv, , , -lmass)
|
|
|
|
if test "$ac_cv_search_vexp" = "-lmassvp4" \
|
|
|
|
-or "$ac_cv_search_vexp" = "-lmassv"
|
|
|
|
then mass_libs="$try_loption $ac_cv_search_vexp -lmass"
|
|
|
|
fi
|
|
|
|
if test "$ac_cv_search_vexp" != "no" ; then break ; fi
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
echo setting MASS_LIBS... $mass_libs
|
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
# check for mpi
|
|
|
|
# some architectures require to link mpi libraries explicitly
|
2005-10-06 02:11:25 +08:00
|
|
|
F77=$mpif90 # use parallel compiler
|
2005-05-31 22:23:38 +08:00
|
|
|
if test "$mpi_libs" = ""
|
|
|
|
then
|
|
|
|
# check directories in LD_LIBRARY_PATH too
|
|
|
|
# (maybe they are already searched by default, but I'm not sure)
|
|
|
|
ld_library_path=`echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
|
|
|
|
|
|
|
|
# build list of directories to search
|
|
|
|
case "$arch" in
|
|
|
|
mac ) try_libdirs="/usr/local/lib /sw/lib" ;;
|
|
|
|
*) try_libdirs="/usr/local/lib" ;;
|
|
|
|
esac
|
2005-03-23 23:43:32 +08:00
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
# search
|
2005-03-23 23:43:32 +08:00
|
|
|
if test "$use_parallel" -ne 0
|
|
|
|
then
|
|
|
|
case "$arch" in
|
|
|
|
alpha )
|
|
|
|
AC_LANG_PUSH(C)
|
2004-02-20 00:06:36 +08:00
|
|
|
CFLAGS="$test_cflags"
|
|
|
|
CPPFLAGS="$test_cppflags"
|
|
|
|
LDFLAGS="$c_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS=""
|
|
|
|
AC_SEARCH_LIBS(elan_baseInit, elan, mpi_libs="$LIBS")
|
|
|
|
LIBS="-lmpi $mpi_libs"
|
|
|
|
AC_SEARCH_LIBS(mpi_waitany_, fmpi, have_mpi=1
|
|
|
|
mpi_libs="$LIBS")
|
2004-02-20 00:06:36 +08:00
|
|
|
AC_LANG_POP(C)
|
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$mpi_libs"
|
|
|
|
AC_SEARCH_LIBS(pmpi_init, pmpi, mpi_libs="$LIBS")
|
2005-03-23 23:43:32 +08:00
|
|
|
;;
|
|
|
|
esac
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-03-23 23:43:32 +08:00
|
|
|
if test "$have_mpi" -eq 0
|
|
|
|
then
|
|
|
|
# check for mpi
|
|
|
|
unset ac_cv_search_mpi_init # clear cached value
|
|
|
|
LDFLAGS="$test_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$mpi_libs"
|
|
|
|
AC_SEARCH_LIBS(mpi_init, mpi,
|
|
|
|
have_mpi=1 mpi_libs="$LIBS")
|
2005-03-23 23:43:32 +08:00
|
|
|
fi
|
2003-11-13 21:35:10 +08:00
|
|
|
fi
|
2005-05-31 22:23:38 +08:00
|
|
|
fi
|
|
|
|
echo setting MPI_LIBS... $mpi_libs
|
|
|
|
|
2003-11-13 21:35:10 +08:00
|
|
|
# final checks on available libraries
|
2005-10-06 02:11:25 +08:00
|
|
|
F77=$f90
|
2003-11-13 21:35:10 +08:00
|
|
|
FFLAGS="$test_fflags"
|
|
|
|
LDFLAGS="$test_ldflags"
|
2005-03-23 23:43:32 +08:00
|
|
|
parallel=0
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
if test "`echo $lapack_libs | grep mkl`" != ""
|
2004-02-20 00:06:36 +08:00
|
|
|
then
|
2005-05-11 00:55:02 +08:00
|
|
|
mylib="lapack_mkl"
|
|
|
|
else
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$lapack_libs $blas_libs"
|
|
|
|
AC_SEARCH_LIBS(zggev, "", , mylib="lapack")
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_SEARCH_LIBS(dgemm, "", , mylib="blas_and_lapack")
|
2004-02-20 00:06:36 +08:00
|
|
|
fi
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$mass_libs"
|
2005-05-11 00:55:02 +08:00
|
|
|
AC_SEARCH_LIBS(vexp, "", try_dflags="$try_dflags -D__MASS")
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$arch" = "aix"
|
2003-11-13 21:35:10 +08:00
|
|
|
then
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$fft_libs"
|
2005-03-23 23:43:32 +08:00
|
|
|
AC_SEARCH_LIBS(dcft, "", have_fft=1)
|
2003-11-13 21:35:10 +08:00
|
|
|
fi
|
|
|
|
|
2005-05-11 00:55:02 +08:00
|
|
|
if test "$have_fft" -eq 0
|
2003-11-13 21:35:10 +08:00
|
|
|
then
|
2005-03-23 23:43:32 +08:00
|
|
|
AC_LANG_PUSH(C)
|
|
|
|
|
|
|
|
if test "$have_fft" -eq 0
|
2004-02-17 01:30:59 +08:00
|
|
|
then
|
2005-03-23 23:43:32 +08:00
|
|
|
try_dflags="$try_dflags -D__FFTW"
|
|
|
|
|
|
|
|
CFLAGS="$test_cflags"
|
|
|
|
LDFLAGS="$c_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$fft_libs"
|
2005-03-23 23:43:32 +08:00
|
|
|
AC_SEARCH_LIBS(fftwnd, "", have_fft=1 have_fftw=1)
|
2004-02-17 01:30:59 +08:00
|
|
|
fi
|
2005-03-23 23:43:32 +08:00
|
|
|
|
|
|
|
# find location of fftw.h (if needed)
|
|
|
|
if test "$have_fftw" -ne 0
|
|
|
|
then
|
|
|
|
if test "$includefftw" = ""
|
2003-11-13 21:35:10 +08:00
|
|
|
then
|
2005-03-23 23:43:32 +08:00
|
|
|
# if libfftw is in /some/path/lib, then fftw.h is
|
|
|
|
# probably in /some/path/include
|
2005-05-31 22:23:38 +08:00
|
|
|
includefftw=`echo $fft_libs |
|
2005-03-23 23:43:32 +08:00
|
|
|
sed 's/.*-L\([[^ ]]*\) *-lfftw.*/\1/
|
|
|
|
s/lib/include/'`
|
2003-11-13 21:35:10 +08:00
|
|
|
fi
|
2005-03-23 23:43:32 +08:00
|
|
|
try_includedirs="$includefftw /usr/local/include \
|
|
|
|
/cineca/lib/fftw-2.1.3/fftw"
|
|
|
|
for dir in none $try_includedirs
|
|
|
|
do
|
|
|
|
unset ac_cv_header_fftw_h # clear cached value
|
|
|
|
if test "$dir" = "none"
|
|
|
|
then
|
|
|
|
try_ioption=
|
|
|
|
else
|
|
|
|
echo $ECHO_N "in $dir: " $ECHO_C
|
|
|
|
try_ioption="-I$dir"
|
|
|
|
fi
|
|
|
|
CFLAGS="$test_cflags $try_ioption"
|
|
|
|
CPPFLAGS="$test_cppflags $try_ioption"
|
|
|
|
LDFLAGS="$c_ldflags"
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$fft_libs"
|
2005-03-23 23:43:32 +08:00
|
|
|
AC_CHECK_HEADER(fftw.h, have_fftw_h=1
|
|
|
|
ifftw="$try_ioption")
|
|
|
|
if test "$ac_cv_header_fftw_h" != "no"
|
|
|
|
then break ; fi
|
|
|
|
done
|
|
|
|
fi
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-03-23 23:43:32 +08:00
|
|
|
# if no valid FFT library was found, use our implementation
|
|
|
|
if test "$have_fft" -eq 0
|
|
|
|
then
|
|
|
|
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$have_fftw" -ne 0 && test "$have_fftw_h" -eq 0
|
|
|
|
then
|
|
|
|
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
|
|
|
|
AC_MSG_WARN([fftw library detected, but fftw.h not found])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_LANG_POP(C)
|
2004-02-17 03:00:41 +08:00
|
|
|
fi
|
|
|
|
|
2005-03-23 23:43:32 +08:00
|
|
|
if test "$use_parallel" -ne 0
|
2003-11-13 21:35:10 +08:00
|
|
|
then
|
2005-10-06 02:11:25 +08:00
|
|
|
F77=$mpif90
|
2005-05-31 22:23:38 +08:00
|
|
|
LIBS="$mpi_libs"
|
2005-03-23 23:43:32 +08:00
|
|
|
AC_SEARCH_LIBS(mpi_init, "", parallel=1
|
|
|
|
try_dflags="$try_dflags -D__MPI -D__PARA")
|
2003-11-13 21:35:10 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_LANG_POP(Fortran 77)
|
|
|
|
|
2004-08-20 21:15:35 +08:00
|
|
|
if test "$dflags" = "" ; then dflags="$try_dflags" ; fi
|
2003-11-13 21:35:10 +08:00
|
|
|
echo setting DFLAGS... $dflags
|
2004-08-20 21:15:35 +08:00
|
|
|
|
|
|
|
# xlf compilers (AIX and powerpc) want comma-separated -D directives
|
2005-03-23 23:43:32 +08:00
|
|
|
if test "$xlf_flags" -ne 0
|
2004-08-20 21:15:35 +08:00
|
|
|
then
|
|
|
|
fdflags="`echo $dflags | sed 's/ */,/g'`"
|
|
|
|
else
|
|
|
|
fdflags="\$(DFLAGS)"
|
|
|
|
fi
|
2004-08-10 00:35:51 +08:00
|
|
|
echo setting FDFLAGS... $fdflags
|
2004-08-20 21:15:35 +08:00
|
|
|
|
|
|
|
if test "$ranlib" = "" ; then ranlib=echo ; fi
|
2004-08-10 00:35:51 +08:00
|
|
|
echo setting RANLIB... $ranlib
|
2004-08-20 21:15:35 +08:00
|
|
|
echo setting MYLIB... $mylib
|
2003-11-13 21:35:10 +08:00
|
|
|
|
|
|
|
# generate dependencies
|
|
|
|
if test -x $topdir/makedeps.sh
|
|
|
|
then
|
2005-03-18 19:30:21 +08:00
|
|
|
echo checking dependencies...
|
2003-11-20 01:10:26 +08:00
|
|
|
( cd $topdir ; ./makedeps.sh )
|
2003-11-13 21:35:10 +08:00
|
|
|
fi
|
|
|
|
|
2005-09-29 01:10:14 +08:00
|
|
|
# configure output messages
|
|
|
|
blas_line="BLAS_LIBS=$blas_libs"
|
|
|
|
lapack_line="LAPACK_LIBS=$lapack_libs"
|
|
|
|
fft_line="FFT_LIBS=$fft_libs"
|
|
|
|
if test "$have_fft" -ne 0 && test "$have_fftw" -ne 0 &&
|
|
|
|
test "$have_fftw_h" -eq 0
|
|
|
|
then
|
|
|
|
fft_line="$fft_line FFT_LIBS=$fft_libs\\
|
|
|
|
WARNING: fftw library detected, but fftw.h not found"
|
|
|
|
fi
|
|
|
|
if test "$mpi_libs" != "" ; then mpi_line="MPI_LIBS=$mpi_libs"
|
|
|
|
else mpi_line="@delete@" ; fi
|
|
|
|
if test "$arch" = "aix" ; then mass_line="MASS_LIBS=$mass_libs"
|
|
|
|
else mass_line="@delete@" ; fi
|
|
|
|
|
|
|
|
if test "$use_parallel" -ne 0
|
|
|
|
then
|
|
|
|
if test "$parallel" -ne 0
|
|
|
|
then
|
|
|
|
parallel_report="Parallel environment detected successfully.\\
|
2005-09-29 01:23:50 +08:00
|
|
|
Configured for compilation of parallel executables."
|
2005-09-29 01:10:14 +08:00
|
|
|
else
|
|
|
|
parallel_report="Parallel environment not detected \
|
|
|
|
\(is this a parallel machine?\).\\
|
2005-09-29 01:23:50 +08:00
|
|
|
Configured for compilation of serial executables."
|
2005-09-29 01:10:14 +08:00
|
|
|
fi
|
|
|
|
else
|
2005-09-29 01:23:50 +08:00
|
|
|
parallel_report="Configured for compilation of serial executables."
|
2005-09-29 01:10:14 +08:00
|
|
|
fi
|
|
|
|
|
2003-11-13 21:35:10 +08:00
|
|
|
# export settings to generated files
|
|
|
|
AC_SUBST(cc)
|
2005-10-06 02:11:25 +08:00
|
|
|
AC_SUBST(mpicc)
|
2003-11-13 21:35:10 +08:00
|
|
|
AC_SUBST(cflags)
|
|
|
|
AC_SUBST(dflags)
|
2004-08-10 00:35:51 +08:00
|
|
|
AC_SUBST(fdflags)
|
2003-11-13 21:35:10 +08:00
|
|
|
AC_SUBST(cpp)
|
|
|
|
AC_SUBST(cppflags)
|
|
|
|
AC_SUBST(f90)
|
2005-10-06 02:11:25 +08:00
|
|
|
AC_SUBST(mpif90)
|
2003-11-13 21:35:10 +08:00
|
|
|
AC_SUBST(f90flags)
|
2004-11-25 01:34:47 +08:00
|
|
|
AC_SUBST(f90flags_noopt)
|
2005-10-06 02:11:25 +08:00
|
|
|
AC_SUBST(f77)
|
|
|
|
AC_SUBST(mpif77)
|
|
|
|
AC_SUBST(fflags)
|
|
|
|
AC_SUBST(fflags_noopt)
|
2004-08-20 21:15:35 +08:00
|
|
|
AC_SUBST(pre_fdflags)
|
2005-03-09 00:51:41 +08:00
|
|
|
AC_SUBST(imod)
|
2003-11-13 21:35:10 +08:00
|
|
|
AC_SUBST(ifftw)
|
|
|
|
AC_SUBST(ld)
|
|
|
|
AC_SUBST(ldflags)
|
2005-05-31 22:23:38 +08:00
|
|
|
AC_SUBST(blas_libs)
|
|
|
|
AC_SUBST(lapack_libs)
|
|
|
|
AC_SUBST(fft_libs)
|
|
|
|
AC_SUBST(mpi_libs)
|
|
|
|
AC_SUBST(mass_libs)
|
2004-02-11 18:50:03 +08:00
|
|
|
AC_SUBST(mylib)
|
2003-11-13 21:35:10 +08:00
|
|
|
AC_SUBST(ar)
|
|
|
|
AC_SUBST(arflags)
|
2004-08-10 00:35:51 +08:00
|
|
|
AC_SUBST(ranlib)
|
2004-09-28 18:51:50 +08:00
|
|
|
AC_SUBST(f90rule)
|
2005-09-29 01:10:14 +08:00
|
|
|
AC_SUBST(blas_line)
|
|
|
|
AC_SUBST(lapack_line)
|
|
|
|
AC_SUBST(fft_line)
|
|
|
|
AC_SUBST(mpi_line)
|
|
|
|
AC_SUBST(mass_line)
|
|
|
|
AC_SUBST(parallel_report)
|
2003-11-13 21:35:10 +08:00
|
|
|
|
2005-03-09 02:44:10 +08:00
|
|
|
AC_CONFIG_FILES(make.sys)
|
2005-09-29 01:10:14 +08:00
|
|
|
AC_CONFIG_FILES(configure.msg)
|
2003-11-13 21:35:10 +08:00
|
|
|
|
|
|
|
AC_OUTPUT
|
|
|
|
|
2005-09-29 01:10:14 +08:00
|
|
|
# final messages
|
|
|
|
sed '/@delete@/d' configure.msg
|
2005-09-27 19:07:33 +08:00
|
|
|
echo configure: success
|