From: bangerth Date: Wed, 16 Jan 2008 00:48:26 +0000 (+0000) Subject: Detect Trilinos. Don't do anything with it right now. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4df42f47ab9cef4e8a400b395776752feffefd6;p=dealii-svn.git Detect Trilinos. Don't do anything with it right now. git-svn-id: https://svn.dealii.org/trunk@15615 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 1bc06f9c3b..75a080ea3a 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -9,7 +9,7 @@ dnl In doc/Makefile some information on the kind of documentation dnl is stored. dnl dnl -dnl Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors +dnl Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors dnl dnl $Id$ @@ -5200,6 +5200,120 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_MPIUNI_LIB, dnl +dnl ------------------------------------------------------------ +dnl Check whether Trilinos is installed, and if so store the +dnl respective links +dnl +dnl Usage: DEAL_II_CONFIGURE_TRILINOS +dnl +dnl ------------------------------------------------------------ +AC_DEFUN(DEAL_II_CONFIGURE_TRILINOS, dnl +[ + AC_MSG_CHECKING(for Trilinos library directory) + + AC_ARG_WITH(trilinos, + [ --with-trilinos=/path/to/trilinos Specify the path to the Trilinos installation, + of which the include and lib directories + are subdirs; use this if you want to override + the TRILINOS_DIR environment variable.], + [ + dnl Special case when someone does --with-petsc=no + if test "x$withval" = "xno" ; then + AC_MSG_RESULT([explicitly disabled]) + USE_CONTRIB_TRILINOS=no + else + USE_CONTRIB_TRILINOS=yes + DEAL_II_TRILINOS_DIR=$withval + AC_MSG_RESULT($DEAL_II_TRILINOS_DIR) + + dnl Make sure that what was specified is actually correct + if test ! -d $DEAL_II_TRILINOS_DIR/include \ + -o ! -d $DEAL_II_TRILINOS_DIR/lib ; then + AC_MSG_ERROR([Path to Trilinos specified with --with-trilinos does not + point to a complete Trilinos installation]) + fi + fi + ], + [ + dnl Take something from the environment variables, if it is there + if test "x$TRILINOS_DIR" != "x" ; then + USE_CONTRIB_TRILINOS=yes + DEAL_II_TRILINOS_DIR="$TRILINOS_DIR" + AC_MSG_RESULT($DEAL_II_TRILINOS_DIR) + + dnl Make sure that what this is actually correct + if test ! -d $DEAL_II_TRILINOS_DIR/include \ + -o ! -d $DEAL_II_TRILINOS_DIR/lib ; then + AC_MSG_ERROR([The path to Trilinos specified in the TRILINOS_DIR + environment variable does not + point to a complete Trilinos installation]) + fi + else + USE_CONTRIB_TRILINOS=no + DEAL_II_TRILINOS_DIR="" + AC_MSG_RESULT(not found) + fi + ]) + + dnl If we have found PETSc, determine and set additional pieces of data + if test "$USE_CONTRIB_TRILINOS" = "yes" ; then + AC_DEFINE(DEAL_II_USE_TRILINOS, 1, + [Defined if a Trilinos installation was found and is going + to be used]) + + dnl Set an additional variable (not via AC_DEFINE, since we don't want + dnl to have it in config.h) which we can use in doc/doxygen/options.dox.in. + dnl If we have Trilinos, then the value of this variable expands to + dnl defining the string "DEAL_II_USE_TRILINOS" for the preprocessor. If + dnl we don't have no Trilinos, then it does not define this string. + DEAL_II_DEFINE_DEAL_II_USE_TRILINOS=DEAL_II_USE_TRILINOS + + DEAL_II_CHECK_TRILINOS_SHARED_STATIC + + dnl Finally set with_trilinos if this hasn't happened yet + if test "x$with_trilinos" = "x" ; then + with_trilinos="yes" + fi + fi +]) + + + +dnl ------------------------------------------------------------ +dnl Check whether the installed version of Trilinos uses shared +dnl or static libs, or both +dnl +dnl Usage: DEAL_II_CHECK_TRILINOS_SHARED_STATIC +dnl +dnl ------------------------------------------------------------ +AC_DEFUN(DEAL_II_CHECK_TRILINOS_SHARED_STATIC, dnl +[ + dnl Check using the epetra library since that should always be there + + AC_MSG_CHECKING(whether Trilinos uses shared libraries) + if test -f $DEAL_II_TRILINOS_DIR/lib/libepetra${shared_lib_suffix} ; then + AC_MSG_RESULT(yes) + DEAL_II_TRILINOS_SHARED=yes + else + AC_MSG_RESULT(no) + fi + + AC_MSG_CHECKING(whether Trilinos uses static libraries) + if test -f $DEAL_II_TRILINOS_DIR/lib/libepetra${static_lib_suffix} ; then + AC_MSG_RESULT(yes) + DEAL_II_TRILINOS_STATIC=yes + else + AC_MSG_RESULT(no) + fi + + dnl Make sure something is set at least + if test "x${DEAL_II_TRILINOS_SHARED}${DEAL_II_TRILINOS_STATIC}" = "x" ; then + AC_MSG_ERROR([Unable to determine whether Trilinos uses shared or + static libraries.]) + fi +]) + + dnl ------------------------------------------------------------ dnl Check whether Metis is installed, and if so store the dnl respective links @@ -5296,7 +5410,8 @@ AC_DEFUN(DEAL_II_WITH_LAPACK, dnl if test "x$1" != "xyes" ; then lapack="$1"; else lapack="lapack"; fi AC_CHECK_LIB($lapack, dgbsv_, [ LIBS="-l$lapack $LIBS" - AC_DEFINE(HAVE_LIBLAPACK) + AC_DEFINE([HAVE_LIBLAPACK], [1], + [Defined if deal.II was configured with LAPACK support]) ], [AC_MSG_ERROR([LAPACK library $lapack not found])] ) @@ -5398,7 +5513,8 @@ AC_DEFUN(DEAL_II_WITH_BLAS, dnl AC_CHECK_LIB($blas, daxpy_, [ LIBS="-l$blas $LIBS" - AC_DEFINE(HAVE_LIBBLAS) + AC_DEFINE([HAVE_LIBBLAS], [1], + [Defined if deal.II was configured with BLAS support]) ],,$F77LIBS) AC_SUBST(NEEDS_F77LIBS, "yes") else @@ -5408,7 +5524,8 @@ AC_DEFUN(DEAL_II_WITH_BLAS, dnl AC_CHECK_LIB($blas, daxpy_, [ LIBS="-l$blas $LIBS" - AC_DEFINE(HAVE_LIBBLAS) + AC_DEFINE([HAVE_LIBBLAS], [1], + [Defined if deal.II was configured with BLAS support]) ],,$F77LIBS) AC_SUBST(NEEDS_F77LIBS, "yes") diff --git a/deal.II/base/include/base/config.h.in b/deal.II/base/include/base/config.h.in index 0486308b91..4241589e82 100644 --- a/deal.II/base/include/base/config.h.in +++ b/deal.II/base/include/base/config.h.in @@ -209,6 +209,9 @@ /* Defined if a PETSc installation was found and is going to be used */ #undef DEAL_II_USE_PETSC +/* Defined if a Trilinos installation was found and is going to be used */ +#undef DEAL_II_USE_TRILINOS + /* This error appears in the Apple edition of the gcc 3.3, which ships with Darwin7.9.0 and probably previous version. It leads to problems during linking. For the details, look at aclocal.m4 in the top-level directory. */ @@ -257,10 +260,10 @@ /* Define to 1 if you have the `amd' library (-lamd). */ #undef HAVE_LIBAMD -/* Define to 1 if you have the `blas' library (-lblas). */ +/* Defined if deal.II was configured with BLAS support */ #undef HAVE_LIBBLAS -/* Define to 1 if you have the `lapack' library (-llapack). */ +/* Defined if deal.II was configured with LAPACK support */ #undef HAVE_LIBLAPACK /* Define to 1 if you have the `NetCDF' library (-lnetcdf). */ diff --git a/deal.II/common/Make.global_options.in b/deal.II/common/Make.global_options.in index 60ad870d0e..8a882dbb27 100644 --- a/deal.II/common/Make.global_options.in +++ b/deal.II/common/Make.global_options.in @@ -54,6 +54,11 @@ DEAL_II_PETSC_VERSION_MINOR = @DEAL_II_PETSC_VERSION_MINOR@ DEAL_II_PETSC_VERSION_SUBMINOR = @DEAL_II_PETSC_VERSION_SUBMINOR@ DEAL_II_PETSC_MPIUNI_LIB = @DEAL_II_PETSC_MPIUNI_LIB@ +USE_CONTRIB_TRILINOS = @USE_CONTRIB_TRILINOS@ +DEAL_II_TRILINOS_DIR = @DEAL_II_TRILINOS_DIR@ +DEAL_II_TRILINOS_SHARED = @DEAL_II_TRILINOS_SHARED@ +DEAL_II_TRILINOS_STATIC = @DEAL_II_TRILINOS_STATIC@ + USE_CONTRIB_METIS = @USE_CONTRIB_METIS@ DEAL_II_METIS_DIR = @DEAL_II_METIS_DIR@ @@ -166,6 +171,7 @@ endif include-path-petsc = $(DEAL_II_PETSC_DIR)/include include-path-petsc-bmake = $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH) +include-path-trilinos = $(DEAL_II_TRILINOS_DIR)/include include-path-metis = $(DEAL_II_METIS_DIR)/Lib # include paths as command line flags. while compilers allow a space between @@ -176,7 +182,7 @@ INCLUDE = -I$D/base/include -I$D/lac/include -I$D/deal.II/include \ @UMFPACK_INCLUDE_DIR@ @HSL_INCLUDE_DIR@ \ -I$D/contrib -# add PETSc and METIS include path if necessary. this rule +# add PETSc, Trilinos and METIS include path if necessary. this rule # (and the one further down below to get correct flags) should eventually # be replaced by something where we do not blindly include PETSc make files # (and thus import all of its variables), but rather set up a scheme to @@ -190,6 +196,11 @@ ifeq ($(USE_CONTRIB_PETSC),yes) INCLUDE += -I$(include-path-petsc) -I$(include-path-petsc-bmake)\ $(MPI_INCLUDE) endif + +ifeq ($(USE_CONTRIB_TRILINOS),yes) + INCLUDE += -I$(include-path-trilinos) +endif + ifeq ($(USE_CONTRIB_METIS),yes) INCLUDE += -I$(include-path-metis) endif @@ -205,7 +216,7 @@ F77FLAGS.o = @DEFS@ @F77FLAGSO@ $(INCLUDE) # compile flags for C compiler CFLAGS = @CFLAGS@ -# PETSc wants to see a whole lot of other flags being passed. ... +# PETSc wants to see a whole lot of other flags being passed... ifeq ($(USE_CONTRIB_PETSC),yes) # set PETSC_DIR and PETSC_ARCH to be used in variables file PETSC_DIR = $(DEAL_II_PETSC_DIR) diff --git a/deal.II/configure b/deal.II/configure index 82e94fd749..a26ca2e502 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -715,6 +715,10 @@ DEAL_II_PETSC_VERSION_MINOR DEAL_II_PETSC_VERSION_SUBMINOR DEAL_II_PETSC_MPIUNI_LIB DEAL_II_DEFINE_DEAL_II_USE_PETSC +USE_CONTRIB_TRILINOS +DEAL_II_TRILINOS_DIR +DEAL_II_TRILINOS_SHARED +DEAL_II_TRILINOS_STATIC NEEDS_F77LIBS HSL_INCLUDE_DIR USE_CONTRIB_HSL @@ -1345,6 +1349,10 @@ Optional Packages: --with-petsc-arch=architecture Specify the architecture for your PETSc installation; use this if you want to override the PETSC_ARCH environment variable. + --with-trilinos=/path/to/trilinos Specify the path to the Trilinos installation, + of which the include and lib directories + are subdirs; use this if you want to override + the TRILINOS_DIR environment variable. --with-blas=blaslib use the blas library blaslib. Make sure the path to the libary is searched by ld, since it is included by the argument -lblaslib. If no @@ -11311,7 +11319,6 @@ echo "${ECHO_T}---------------- configuring additional libs ----------------" >& - { echo "$as_me:$LINENO: checking for PETSc library directory" >&5 echo $ECHO_N "checking for PETSc library directory... $ECHO_C" >&6; } @@ -11507,6 +11514,113 @@ echo "${ECHO_T}$DEAL_II_PETSC_MPIUNI_LIB" >&6; } + { echo "$as_me:$LINENO: checking for Trilinos library directory" >&5 +echo $ECHO_N "checking for Trilinos library directory... $ECHO_C" >&6; } + + +# Check whether --with-trilinos was given. +if test "${with_trilinos+set}" = set; then + withval=$with_trilinos; + if test "x$withval" = "xno" ; then + { echo "$as_me:$LINENO: result: explicitly disabled" >&5 +echo "${ECHO_T}explicitly disabled" >&6; } + USE_CONTRIB_TRILINOS=no + else + USE_CONTRIB_TRILINOS=yes + DEAL_II_TRILINOS_DIR=$withval + { echo "$as_me:$LINENO: result: $DEAL_II_TRILINOS_DIR" >&5 +echo "${ECHO_T}$DEAL_II_TRILINOS_DIR" >&6; } + + if test ! -d $DEAL_II_TRILINOS_DIR/include \ + -o ! -d $DEAL_II_TRILINOS_DIR/lib ; then + { { echo "$as_me:$LINENO: error: Path to Trilinos specified with --with-trilinos does not + point to a complete Trilinos installation" >&5 +echo "$as_me: error: Path to Trilinos specified with --with-trilinos does not + point to a complete Trilinos installation" >&2;} + { (exit 1); exit 1; }; } + fi + fi + +else + + if test "x$TRILINOS_DIR" != "x" ; then + USE_CONTRIB_TRILINOS=yes + DEAL_II_TRILINOS_DIR="$TRILINOS_DIR" + { echo "$as_me:$LINENO: result: $DEAL_II_TRILINOS_DIR" >&5 +echo "${ECHO_T}$DEAL_II_TRILINOS_DIR" >&6; } + + if test ! -d $DEAL_II_TRILINOS_DIR/include \ + -o ! -d $DEAL_II_TRILINOS_DIR/lib ; then + { { echo "$as_me:$LINENO: error: The path to Trilinos specified in the TRILINOS_DIR + environment variable does not + point to a complete Trilinos installation" >&5 +echo "$as_me: error: The path to Trilinos specified in the TRILINOS_DIR + environment variable does not + point to a complete Trilinos installation" >&2;} + { (exit 1); exit 1; }; } + fi + else + USE_CONTRIB_TRILINOS=no + DEAL_II_TRILINOS_DIR="" + { echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6; } + fi + +fi + + + if test "$USE_CONTRIB_TRILINOS" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define DEAL_II_USE_TRILINOS 1 +_ACEOF + + + DEAL_II_DEFINE_DEAL_II_USE_TRILINOS=DEAL_II_USE_TRILINOS + + + + { echo "$as_me:$LINENO: checking whether Trilinos uses shared libraries" >&5 +echo $ECHO_N "checking whether Trilinos uses shared libraries... $ECHO_C" >&6; } + if test -f $DEAL_II_TRILINOS_DIR/lib/libepetra${shared_lib_suffix} ; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + DEAL_II_TRILINOS_SHARED=yes + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + + { echo "$as_me:$LINENO: checking whether Trilinos uses static libraries" >&5 +echo $ECHO_N "checking whether Trilinos uses static libraries... $ECHO_C" >&6; } + if test -f $DEAL_II_TRILINOS_DIR/lib/libepetra${static_lib_suffix} ; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + DEAL_II_TRILINOS_STATIC=yes + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + + if test "x${DEAL_II_TRILINOS_SHARED}${DEAL_II_TRILINOS_STATIC}" = "x" ; then + { { echo "$as_me:$LINENO: error: Unable to determine whether Trilinos uses shared or + static libraries." >&5 +echo "$as_me: error: Unable to determine whether Trilinos uses shared or + static libraries." >&2;} + { (exit 1); exit 1; }; } + fi + + + if test "x$with_trilinos" = "x" ; then + with_trilinos="yes" + fi + fi + + + + + + if test "x$with_umfpack" != "x" -a "x$with_umfpack" != "xno" ; then @@ -11615,7 +11729,8 @@ echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then LIBS="-l$blas $LIBS" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LIBBLAS 1 _ACEOF @@ -11814,7 +11929,8 @@ echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then LIBS="-l$blas $LIBS" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LIBBLAS 1 _ACEOF @@ -12726,7 +12842,8 @@ ac_res=`eval echo '${'$as_ac_Lib'}'` echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then LIBS="-l$lapack $LIBS" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LIBLAPACK 1 _ACEOF @@ -14130,6 +14247,10 @@ for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF DEAL_II_PETSC_MPIUNI_LIB!$DEAL_II_PETSC_MPIUNI_LIB$ac_delim DEAL_II_DEFINE_DEAL_II_USE_PETSC!$DEAL_II_DEFINE_DEAL_II_USE_PETSC$ac_delim +USE_CONTRIB_TRILINOS!$USE_CONTRIB_TRILINOS$ac_delim +DEAL_II_TRILINOS_DIR!$DEAL_II_TRILINOS_DIR$ac_delim +DEAL_II_TRILINOS_SHARED!$DEAL_II_TRILINOS_SHARED$ac_delim +DEAL_II_TRILINOS_STATIC!$DEAL_II_TRILINOS_STATIC$ac_delim NEEDS_F77LIBS!$NEEDS_F77LIBS$ac_delim HSL_INCLUDE_DIR!$HSL_INCLUDE_DIR$ac_delim USE_CONTRIB_HSL!$USE_CONTRIB_HSL$ac_delim @@ -14150,7 +14271,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/deal.II/configure.in b/deal.II/configure.in index 1471e6bf2d..9678b1e30e 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -396,8 +396,6 @@ AC_MSG_RESULT() AC_MSG_RESULT(---------------- configuring additional libs ----------------) -dnl First check for PETSc - DEAL_II_CONFIGURE_PETSC AC_SUBST(USE_CONTRIB_PETSC) AC_SUBST(DEAL_II_PETSC_DIR) @@ -408,6 +406,11 @@ AC_SUBST(DEAL_II_PETSC_VERSION_SUBMINOR) AC_SUBST(DEAL_II_PETSC_MPIUNI_LIB) AC_SUBST(DEAL_II_DEFINE_DEAL_II_USE_PETSC) +DEAL_II_CONFIGURE_TRILINOS +AC_SUBST(USE_CONTRIB_TRILINOS) +AC_SUBST(DEAL_II_TRILINOS_DIR) +AC_SUBST(DEAL_II_TRILINOS_SHARED) +AC_SUBST(DEAL_II_TRILINOS_STATIC) dnl Make sure we configure for libraries used by other libraries. For diff --git a/deal.II/doc/doxygen/deal.dox b/deal.II/doc/doxygen/deal.dox index cb5ae0c4f8..1149003a65 100644 --- a/deal.II/doc/doxygen/deal.dox +++ b/deal.II/doc/doxygen/deal.dox @@ -45,4 +45,5 @@ IMAGE_PATH = images \ ../../examples/step-26/doc \ ../../examples/step-27/doc \ ../../examples/step-28/doc \ - ../../examples/step-29/doc + ../../examples/step-29/doc \ + ../../examples/step-99/doc diff --git a/deal.II/doc/doxygen/options.136.in b/deal.II/doc/doxygen/options.136.in index 9e457775a8..539cde8d9d 100644 --- a/deal.II/doc/doxygen/options.136.in +++ b/deal.II/doc/doxygen/options.136.in @@ -919,7 +919,7 @@ INCLUDE_FILE_PATTERNS = # [WB] Set MT flags so that the corresponding documentation will always be visible, # [WB] irrespective of whether MT is actually switched on or not. # [GK] Define a variable doxygen in order to mask out inline functions -PREDEFINED = DOXYGEN=1 DEBUG=1 DEAL_II_USE_PETSC=1 \ +PREDEFINED = DOXYGEN=1 DEBUG=1 DEAL_II_USE_PETSC=1 DEAL_II_USE_TRILINOS=1 \ DEAL_II_USE_MT=1 DEAL_II_USE_MT_POSIX=1 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then diff --git a/deal.II/doc/doxygen/options.dox.in b/deal.II/doc/doxygen/options.dox.in index dfe3647d06..c1a1a01ec9 100644 --- a/deal.II/doc/doxygen/options.dox.in +++ b/deal.II/doc/doxygen/options.dox.in @@ -1013,6 +1013,7 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN=1 \ DEBUG=1 \ DEAL_II_USE_PETSC=1 \ + DEAL_II_USE_TRILINOS=1 \ DEAL_II_USE_MT=1 \ DEAL_II_USE_MT_POSIX=1