]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Auto-detect the Trilinos sub-libs we need to link with and their order.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 29 Jun 2011 17:04:32 +0000 (17:04 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 29 Jun 2011 17:04:32 +0000 (17:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@23877 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/common/Make.global_options.in
deal.II/configure
deal.II/doc/news/changes.h

index 2836f4efe6e6744f5e385e6ccbde79371a942113..a83764eec325a4ab5b23d0b1113038ac203b2444 100644 (file)
@@ -6214,6 +6214,7 @@ AC_DEFUN(DEAL_II_CONFIGURE_TRILINOS, dnl
     DEAL_II_CONFIGURE_TRILINOS_VERSION
     DEAL_II_CHECK_TRILINOS_MPI_CONSISTENCY
     DEAL_II_CHECK_TRILINOS_SHARED_STATIC
+    DEAL_II_CHECK_TRILINOS_LIBS
     DEAL_II_CHECK_TRILINOS_WARNINGS
     DEAL_II_CHECK_TRILINOS_HEADER_FILES
 
@@ -6263,6 +6264,15 @@ AC_DEFUN(DEAL_II_CONFIGURE_TRILINOS_VERSION, dnl
                                | perl -pi -e 's/.*VERSION\s+\d?\d\d\d(\d\d)/\1/g;' \
                               | perl -pi -e 's/0(\d)/\1/g;'`
   AC_MSG_RESULT([$DEAL_II_TRILINOS_VERSION_MAJOR.$DEAL_II_TRILINOS_VERSION_MINOR.$DEAL_II_TRILINOS_VERSION_SUBMINOR])
+
+  dnl Verify that we have at least Trilinos 10. This is the
+  dnl version where Trilinos started using cmake, which allow
+  dnl us to figure out which libraries Trilinos has built
+  dnl and in which order they need to be linked
+  if test "$DEAL_II_TRILINOS_VERSION_MAJOR" -lt 10 ; then
+    AC_MSG_ERROR([Trilinos versions prior to 10.0 are no longer supported with deal.II.])
+  fi
+
   AC_SUBST(DEAL_II_TRILINOS_VERSION_MAJOR)
   AC_SUBST(DEAL_II_TRILINOS_VERSION_MINOR)
   AC_SUBST(DEAL_II_TRILINOS_VERSION_SUBMINOR)
@@ -6423,6 +6433,28 @@ AC_DEFUN(DEAL_II_CHECK_TRILINOS_SHARED_STATIC, dnl
 
 
 
+dnl ------------------------------------------------------------
+dnl Figure out which libraries Trilinos has built and that we
+dnl need to link against. Also make sure we know their order
+dnl
+dnl Usage: DEAL_II_CHECK_TRILINOS_LIBS
+dnl
+dnl ------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_TRILINOS_LIBS, dnl
+[
+  AC_MSG_CHECKING(for the set of Trilinos libraries)
+
+  dnl Trilinos' cmake invokation stores the set of libraries
+  dnl in a special file for consumption of cmake at a later
+  dnl time. We'll simply grep through it
+  DEAL_II_TRILINOS_LIBS="`grep Trilinos_LIBRARIES $DEAL_II_TRILINOS_INCDIR/TrilinosConfig.cmake \
+    | perl -pi -e 's/.*\"(.*)\".*/\1/g; s/;/ /g;'`"
+  AC_MSG_RESULT([$DEAL_II_TRILINOS_LIBS])
+  AC_SUBST(DEAL_II_TRILINOS_LIBS)
+])
+
+
+
 dnl ------------------------------------------------------------
 dnl Trilinos has headers that produce tons of warnings when
 dnl used with -W -Wall (which includes -Wunused). Regrettable
index 1cb22d2309e04e8dc07dcb2c6144f2c49e442e75..285d816de093704d23084baa33aba6626e9d7c73 100644 (file)
@@ -202,31 +202,10 @@ ifeq ($(USE_CONTRIB_METIS),yes)
 endif
 
 # List all trilinos libraries that we want to link with. These must be sorted
-# in dependency order to allow for static linking where the order on the
-# command line matters. Note that we check the availability of all these
-# libraries in aclocal.m4; the two lists should therefore be kept in
-# sync.
+# in dependency order for linking. Fortunately, we can get the set of
+# libraries from Trilinos's cmake files.
 ifeq ($(USE_CONTRIB_TRILINOS),yes)
-  DEAL_II_TRILINOS_LIBS = \
-               $(DEAL_II_TRILINOS_LIBPREFIX)stratimikosamesos \
-               $(DEAL_II_TRILINOS_LIBPREFIX)stratimikosaztecoo \
-               $(DEAL_II_TRILINOS_LIBPREFIX)stratimikosifpack \
-               $(DEAL_II_TRILINOS_LIBPREFIX)stratimikosml \
-               $(DEAL_II_TRILINOS_LIBPREFIX)stratimikos \
-               $(DEAL_II_TRILINOS_LIBPREFIX)ml \
-               $(DEAL_II_TRILINOS_LIBPREFIX)amesos \
-               $(DEAL_II_TRILINOS_LIBPREFIX)belos \
-               $(DEAL_II_TRILINOS_LIBPREFIX)ifpack \
-                $(DEAL_II_TRILINOS_LIBPREFIX)aztecoo \
-               $(DEAL_II_TRILINOS_LIBPREFIX)rtop \
-               $(DEAL_II_TRILINOS_LIBPREFIX)sacado \
-               $(DEAL_II_TRILINOS_LIBPREFIX)thyra \
-               $(DEAL_II_TRILINOS_LIBPREFIX)thyraepetra \
-               $(DEAL_II_TRILINOS_LIBPREFIX)thyraepetraext \
-               $(DEAL_II_TRILINOS_LIBPREFIX)epetraext \
-               $(DEAL_II_TRILINOS_LIBPREFIX)epetra \
-               $(DEAL_II_TRILINOS_LIBPREFIX)teuchos \
-               $(DEAL_II_TRILINOS_LIBPREFIX)triutils
+  DEAL_II_TRILINOS_LIBS = $(addprefix $(DEAL_II_TRILINOS_LIBPREFIX), @DEAL_II_TRILINOS_LIBS@)
 
   ifeq ($(enable-shared),yes)
     lib-contrib-trilinos = \
index 54512b42ca810b1326c4e58a0b3288d738d2d367..910c711d9e354438df2e7d30973f085c674dbfaa 100755 (executable)
@@ -650,6 +650,7 @@ DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR
 DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR
 DEAL_II_EXPAND_TRILINOS_MPI_VECTOR
 DEAL_II_EXPAND_TRILINOS_VECTOR
+DEAL_II_TRILINOS_LIBS
 DEAL_II_TRILINOS_LIBPREFIX
 DEAL_II_TRILINOS_VERSION_SUBMINOR
 DEAL_II_TRILINOS_VERSION_MINOR
@@ -10628,6 +10629,11 @@ $as_echo_n "checking for Trilinos version... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEAL_II_TRILINOS_VERSION_MAJOR.$DEAL_II_TRILINOS_VERSION_MINOR.$DEAL_II_TRILINOS_VERSION_SUBMINOR" >&5
 $as_echo "$DEAL_II_TRILINOS_VERSION_MAJOR.$DEAL_II_TRILINOS_VERSION_MINOR.$DEAL_II_TRILINOS_VERSION_SUBMINOR" >&6; }
 
+          if test "$DEAL_II_TRILINOS_VERSION_MAJOR" -lt 10 ; then
+    as_fn_error $? "Trilinos versions prior to 10.0 are no longer supported with deal.II." "$LINENO" 5
+  fi
+
+
 
 
 
@@ -10783,6 +10789,16 @@ $as_echo "no" >&6; }
   fi
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the set of Trilinos libraries" >&5
+$as_echo_n "checking for the set of Trilinos libraries... " >&6; }
+
+        DEAL_II_TRILINOS_LIBS="`grep Trilinos_LIBRARIES $DEAL_II_TRILINOS_INCDIR/TrilinosConfig.cmake \
+    | perl -pi -e 's/.*\"(.*)\".*/\1/g; s/;/ /g;'`"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEAL_II_TRILINOS_LIBS" >&5
+$as_echo "$DEAL_II_TRILINOS_LIBS" >&6; }
+
+
+
   OLD_CXXFLAGS="$CXXFLAGS"
 
   if test "$GXX" = yes ; then
index 576ab4d75ece00f9b9ab781e008ce04274c26418..0cb92dc3c7ae065cfe03f6049edde8cc1c93fb71 100644 (file)
@@ -21,6 +21,10 @@ inconvenience this causes.
 </p>
 
 <ol>
+<li> Removed: deal.II no longer supports Trilinos versions prior to 10.0.
+<br>
+(Wolfgang Bangerth, 2011/06/29)
+
 <li> Changed: deal.II has a namespace std_cxx1x that was used to
 import classes from BOOST that are part of the upcoming C++ 1x standard. On
 the other hand, if your compiler supported a sufficiently large subset
@@ -61,6 +65,14 @@ changed to use std_cxx1x::_1, std_cxx1x::_2, etc from now on.
 <h3>General</h3>
 
 <ol>
+<li> Fixed: deal.II can link with Trilinos but previously it required a
+very specific set of Trilinos sub-libraries; if Trilinos had been compiled
+with a larger set of sub-libraries, linking would sometimes fail. This
+has now been made more generic and deal.II obtains the proper set of
+libraries from Trilinos.
+<br>
+(Wolfgang Bangerth, 2011/06/29)
+
 <li> Fixed: On Mac OS X, linking with some external libraries such as Trilinos
 sometimes failed due to a misconfiguration of linker flags. This should now be
 fixed.

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.