You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
amg4psblas/configure.ac

254 lines
8.8 KiB
Plaintext

dnl $Id$
dnl
dnl Michele Martone's proposal for a transition towards the GNU build system for the PSBLAS library
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl usage : aclocal -I config/ && autoconf && ./configure && make
dnl then : VAR=VAL ./configure
dnl In some configurations (AIX) the next line is needed:
dnl MPIFC=mpxlf95 ./configure
dnl then : ./configure VAR=VAL
dnl then : ./configure --help=short
dnl then : ./configure --help
dnl the PSBLAS modules get this task difficult to accomplish!
dnl SEE : --module-path --include-path
dnl NOTE : There is no cross compilation support.
dnl NOTE : missing ifort and kl* library handling..
dnl NOTE : odd configurations like ifc + gcc still await in the mist of the unknown
###############################################################################
###############################################################################
#
# This script is used by the PSBLAS to determine the compilers, linkers, and
# libraries to build its libraries executable code.
# Its behaviour is driven on the compiler it finds or it is dictated to work
# with.
#
###############################################################################
###############################################################################
# NOTE: the literal for version (the second argument to AC_INIT should be a literal!)
mld2p4: configure.ac configure docs/html docs/html/WARNINGS docs/html/images.aux docs/html/images.log docs/html/images.out docs/html/images.pl docs/html/images.tex docs/html/img1.png docs/html/img10.png docs/html/img100.png docs/html/img11.png docs/html/img12.png docs/html/img13.png docs/html/img14.png docs/html/img15.png docs/html/img16.png docs/html/img17.png docs/html/img18.png docs/html/img19.png docs/html/img2.png docs/html/img20.png docs/html/img21.png docs/html/img22.png docs/html/img23.png docs/html/img24.png docs/html/img25.png docs/html/img26.png docs/html/img27.png docs/html/img28.png docs/html/img29.png docs/html/img3.png docs/html/img30.png docs/html/img31.png docs/html/img32.png docs/html/img33.png docs/html/img34.png docs/html/img35.png docs/html/img36.png docs/html/img37.png docs/html/img38.png docs/html/img39.png docs/html/img4.png docs/html/img40.png docs/html/img41.png docs/html/img42.png docs/html/img43.png docs/html/img44.png docs/html/img45.png docs/html/img46.png docs/html/img47.png docs/html/img48.png docs/html/img49.png docs/html/img5.png docs/html/img50.png docs/html/img51.png docs/html/img52.png docs/html/img53.png docs/html/img54.png docs/html/img55.png docs/html/img56.png docs/html/img57.png docs/html/img58.png docs/html/img59.png docs/html/img6.png docs/html/img60.png docs/html/img61.png docs/html/img62.png docs/html/img63.png docs/html/img64.png docs/html/img65.png docs/html/img66.png docs/html/img67.png docs/html/img68.png docs/html/img69.png docs/html/img7.png docs/html/img70.png docs/html/img71.png docs/html/img72.png docs/html/img73.png docs/html/img74.png docs/html/img75.png docs/html/img76.png docs/html/img77.png docs/html/img78.png docs/html/img79.png docs/html/img8.png docs/html/img80.png docs/html/img81.png docs/html/img82.png docs/html/img83.png docs/html/img84.png docs/html/img85.png docs/html/img86.png docs/html/img87.png docs/html/img88.png docs/html/img89.png docs/html/img9.png docs/html/img90.png docs/html/img91.png docs/html/img92.png docs/html/img93.png docs/html/img94.png docs/html/img95.png docs/html/img96.png docs/html/img97.png docs/html/img98.png docs/html/img99.png docs/html/index.html docs/html/internals.pl docs/html/labels.pl docs/html/node1.html docs/html/node10.html docs/html/node11.html docs/html/node12.html docs/html/node13.html docs/html/node14.html docs/html/node15.html docs/html/node16.html docs/html/node17.html docs/html/node18.html docs/html/node19.html docs/html/node2.html docs/html/node20.html docs/html/node21.html docs/html/node22.html docs/html/node23.html docs/html/node24.html docs/html/node25.html docs/html/node26.html docs/html/node27.html docs/html/node28.html docs/html/node29.html docs/html/node3.html docs/html/node30.html docs/html/node31.html docs/html/node4.html docs/html/node5.html docs/html/node6.html docs/html/node7.html docs/html/node8.html docs/html/node9.html docs/html/userhtml.css docs/html/userhtml.html docs/pdf/building.tex docs/userguide.pdf examples/fileread/mld_cexample_1lev.f90 examples/fileread/mld_cexample_ml.f90 examples/fileread/mld_dexample_1lev.f90 examples/fileread/mld_dexample_ml.f90 examples/fileread/mld_sexample_1lev.f90 examples/fileread/mld_sexample_ml.f90 examples/fileread/mld_zexample_1lev.f90 examples/fileread/mld_zexample_ml.f90 mlprec/mld_cprecset.f90 mlprec/mld_dprecset.f90 mlprec/mld_sprecset.f90 mlprec/mld_zprecset.f90 test/fileread/cf_sample.f90 test/fileread/df_sample.f90 test/fileread/runs/cfs.inp test/fileread/runs/dfs.inp test/fileread/runs/sfs.inp test/fileread/runs/zfs.inp test/fileread/sf_sample.f90 test/fileread/zf_sample.f90 Fixed I/O for fileread samples. Fixed precset typo. Updated documentation for building. Included HTML pages.
17 years ago
AC_INIT([MLD2P4],1.0, bugreport@mld2p4.it)
# VERSION is the file containing the PSBLAS version code
# FIXME
mld2p4_cv_version="`cat VERSION`"
# A sample source file
AC_CONFIG_SRCDIR([mlprec/mld_prec_type.f90])
# Our custom M4 macros are in the 'config' directory
AC_CONFIG_MACRO_DIR([config])
AC_MSG_NOTICE([
--------------------------------------------------------------------------------
Welcome to the $PACKAGE_NAME $mld2p4_cv_version configure Script.
This creates Make.inc, but if you read carefully the
documentation, you can make your own by hand for your needs.
./configure --with-psblas=/path/to/psblas
See ./configure --help=short fore more info.
--------------------------------------------------------------------------------
])
###############################################################################
# FLAGS and LIBS user customization
###############################################################################
dnl NOTE : no spaces before the comma, and no brackets before the second argument!
PAC_ARG_WITH_PSBLAS
PSBLAS_DIR="$pac_cv_psblas_dir";
AC_MSG_CHECKING([for PSBLAS build dir])
case $PSBLAS_DIR in
/*) ;;
*) AC_MSG_ERROR([The PSBLAS build dir must be an absolute pathname
which must be specified --with-psblas=/path/to/psblas])
esac
if test ! -d "$PSBLAS_DIR" ; then
AC_MSG_ERROR([Could not find PSBLAS build dir $PSBLAS_DIR!])
fi
AC_MSG_RESULT([$PSBLAS_DIR])
pac_cv_status_file="$PSBLAS_DIR/config.status"
if test ! -f "$pac_cv_status_file" ; then
AC_MSG_ERROR([Could not find configure output in $PSBLAS_DIR.
You must first run the configure script in $PSBLAS_DIR $pac_cv_status_file.])
fi
dnl. $pac_cv_status_file
dnl AC_MSG_NOTICE([Loaded $pac_cv_status_file $FC $MPIFC $BLACS_LIBS])
dnl AM_INIT_AUTOMAKE
dnl Specify required version of autoconf.
AC_PREREQ(2.59)
#
# Installation.
#
#
AC_PROG_INSTALL
AC_MSG_CHECKING([where to install])
case $prefix in
\/* ) eval "INSTALL_DIR=$prefix";;
* ) eval "INSTALL_DIR=/usr/local/psblas";;
esac
case $libdir in
\/* ) eval "INSTALL_LIBDIR=$libdir";;
* ) eval "INSTALL_LIBDIR=$INSTALL_DIR/lib";;
esac
case $includedir in
\/* ) eval "INSTALL_INCLUDEDIR=$includedir";;
* ) eval "INSTALL_INCLUDEDIR=$INSTALL_DIR/include";;
esac
case $docsdir in
\/* ) eval "INSTALL_DOCSDIR=$docsdir";;
* ) eval "INSTALL_DOCSDIR=$INSTALL_DIR/docs";;
esac
AC_MSG_RESULT([$INSTALL_DIR $INSTALL_INCLUDEDIR $INSTALL_LIBDIR $INSTALL_DOCSDIR])
###############################################################################
# Compilers detection: FC,F77,CC should be set, if found.
###############################################################################
AC_PROG_FC([xlf95 xlf90 xlf pgf95 pgf90 ifort ifc gfortran])
AC_PROG_CC([xlc pgcc icc gcc ])
dnl AC_PROG_CXX
if test "X$CC" == "X" ; then
AC_MSG_ERROR([Problem : No C compiler specified nor found!])
fi
if eval "$FC -qversion 2>&1 | grep XL 2>/dev/null" ; then
# Some configurations of the XLF want "-WF," prepended to -D.. flags.
# TODO : discover the exact conditions when the usage of -WF is needed.
mld_cv_define_prepend="-WF,"
# Note : there coule be problems with old xlf compiler versions ( <10.1 )
# since (as far as it is known to us) -WF, is not used in earlier versions.
# More problems could be undocumented yet.
fi
PAC_ARG_WITH_LIBS
PAC_ARG_WITH_FLAGS(clibs,CLIBS)
PAC_ARG_WITH_FLAGS(flibs,FLIBS)
PAC_ARG_WITH_FLAGS(library-path,LIBRARYPATH)
PAC_ARG_WITH_FLAGS(include-path,INCLUDEPATH)
PAC_ARG_WITH_FLAGS(module-path,MODULE_PATH)
###############################################################################
# BLAS library presence checks
###############################################################################
# Note : The libmkl.a (Intel Math Kernel Library) library could be used, too.
# It is sufficient to specify it as -lmkl in the CLIBS or FLIBS or LIBS
# and specify its path adjusting -L/path in CFLAGS.
# Right now it is a matter of user's taste when linking custom applications.
# But PSBLAS examples could take advantage of these libraries, too.
###############################################################################
# BLACS library presence checks
###############################################################################
###############################################################################
# METIS, SuperLU, SuperLU_Dist UMFPack libraries presence checks
###############################################################################
# Note : also SuperLUStat,superlu_gridexit,..
# Note : SuperLU_Dist produces superlu.a by default..
# Note : THESE WERE NOT TESTED
dnl AC_MSG_CHECKING([SuperLU_Dist])
dnl AC_CHECK_LIB(superlu,[superlu_malloc_dist],mld2p4_cv_have_superludist=yes,mld2p4_cv_have_superludist=no)
dnl AC_MSG_RESULT([$mld2p4_cv_have_superludist])
dnl AC_MSG_CHECKING([SuperLU])
dnl AC_CHECK_LIB(superlu,[superlu_malloc],mld2p4_cv_have_superlu=yes,mld2p4_cv_have_superlu=no)
dnl AC_MSG_RESULT([$mld2p4_cv_have_superlu])
PAC_CHECK_UMFPACK
if test "x$mld2p4_cv_have_umfpack" == "xyes" ; then
UMF_FLAGS="-DHave_UMF_ $UMF_INCLUDES"
FDEFINES="$mld_cv_define_prepend-DHAVE_UMF_ $FDEFINES"
else
UMF_FLAGS=""
fi
AC_LANG([C])
if test "X$MPICC" = "X" ; then
# This is our MPICC compiler preference: it will override ACX_MPI's first try.
AC_CHECK_PROGS([MPICC],[mpxlc mpcc pgcc mpicc])
fi
ACX_MPI([], [AC_MSG_ERROR([[Cannot find any suitable MPI implementation for C]])])
PAC_CHECK_SUPERLU
if test "x$mld2p4_cv_have_superlu" == "xyes" ; then
SLU_FLAGS="-DHave_SLU_ $SLU_INCLUDES"
FDEFINES="$mld_cv_define_prepend-DHAVE_SLU_ $FDEFINES"
else
SLU_FLAGS=""
fi
PAC_CHECK_SUPERLUDIST
if test "x$mld2p4_cv_have_superludist" == "xyes" ; then
SLUDIST_FLAGS="-DHave_SLUDist_ $SLUDIST_INCLUDES"
else
SLUDIST_FLAGS=""
fi
# Note : We would like to detect PSBLAS, but this is complicated by the
# module symbols mangling rules, which are compiler specific !
#
# Moreover, the PSBLAS doesn't have an installer, currently.
###############################################################################
# Variable substitutions : the Make.inc.in will have these @VARIABLES@
# substituted.
AC_SUBST(PSBLAS_DIR)
AC_SUBST(INSTALL)
AC_SUBST(INSTALL_DATA)
AC_SUBST(INSTALL_DIR)
AC_SUBST(INSTALL_LIBDIR)
AC_SUBST(INSTALL_INCLUDEDIR)
AC_SUBST(INSTALL_DOCSDIR)
AC_SUBST(SLU_FLAGS)
AC_SUBST(SLU_LIBS)
AC_SUBST(UMF_FLAGS)
AC_SUBST(UMF_LIBS)
AC_SUBST(SLUDIST_FLAGS)
AC_SUBST(SLUDIST_LIBS)
AC_SUBST(FDEFINES)
###############################################################################
# the following files will be created by Automake
AC_CONFIG_FILES([Make.inc])
AC_OUTPUT()
#AC_OUTPUT(Make.inc Makefile)
###############################################################################
dnl Please note that brackets around variable identifiers are absolutely needed for compatibility..
AC_MSG_NOTICE([
${PACKAGE_NAME} ${mld2p4_cv_version} has been configured as follows:
PSBLAS library : ${PSBLAS_DIR}
SuperLU detected : ${mld2p4_cv_have_superlu}
SuperLU_Dist detected : ${mld2p4_cv_have_superludist}
UMFPack detected : ${mld2p4_cv_have_umfpack}
If you are satisfied, run 'make' to build ${PACKAGE_NAME} and its documentation; otherwise
type ./configure --help=short for a complete list of configure options specific to ${PACKAGE_NAME}.
dnl To install the program and its documentation, run 'make install' if you are root,
dnl or run 'su -c "make install"' if you are not root.
])
###############################################################################