<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>The deal.II Readme on interfacing to PETSc and Trilinos</title>
  <link href="screen.css" rel="StyleSheet">
  <meta name="author" content="the deal.II authors <authors @ <EMAIL>>">
  <meta name="copyright" content="Copyright (C) 2008, 2009, 2010, 2011 by the deal.II authors">
  <meta name="date" content="$Date: 2008-10-14 05:36:48 -0500 (Tue, 14 Oct 2008) $">
  <meta name="svn_id" content="$Id: readme.html 17202 2008-10-14 10:36:48Z heister $">
  <meta name="keywords" content="deal.II">
</head>

<body>


    <h1>Interfacing <acronym>deal.II</acronym> to PETSc and Trilinos</h1>

    <h3>About PETSc, Trilinos, and the <acronym>deal.II</acronym>
    interfaces</h3>

    <p>
      <acronym>deal.II</acronym> can interface to the <a
      href="http://www.mcs.anl.gov/petsc/" target="_top">PETSc</a> and
      <a href="http://trilinos.sandia.gov" target="_top">Trilinos</a> software
      libraries. Both of these libraries provide lots of functions for linear
      algebra, among other things, for example implementations of a variety of
      linear solvers, as well as various different sparse and dense matrix and
      vector formats. Trilinos also has many subpackages that deal with
      problems that go far beyond linear algebra, for example nonlinear
      solvers, automatic differentiation packages, uncertainty propagation
      engines, etc. Of particular interest to deal.II is their ability to
      provide this functionality both on sequential and parallel (using MPI)
      computers. PETSc is written in C; Trilinos is written in C++ and can be
      considered to be a more modern version of PETSc though both packages are
      under continuing development at their respective national laboratories.
      </p>

      <p>
      <acronym>deal.II</acronym> has wrapper classes to the linear algebra
      parts of both packages that provide almost the
      same interfaces as the built-in <acronym>deal.II</acronym> linear
      algebra classes. We use these interfaces for parallel computations based
      on MPI since the native deal.II linear algebra classes lack this ability.
      </p>

      <h3>Configuring the interfaces to PETSc and Trilinos</h3>

      <p>
      The use of PETSc and Trilinos is optional. To use the wrapper classes,
      you first have to install these packages and
      point <acronym>deal.II</acronym>'s <code>./configure</code> to the
      installation directories. This happens in similar ways for the two
      packages:
      </p>

      <h5>PETSc</h5>

      <p>
      PETSc usually requires you to set the
      environment variables <code>PETSC_DIR</code> and <code>PETSC_ARCH</code>
      to a path to PETSc and denoting the architecture for which PETSc is
      compiled. If these environment variables are set, then
      <acronym>deal.II</acronym> will pick them up during
      configuration, and store them. It will then also recognize that
      PETSc shall be used, and enable the wrapper classes.
      </p>

      <p>
      Alternatively, the <code>--with-petsc=DIR</code> and
      <code>--with-petsc-arch=ARCH</code> switches to
      <code>./configure</code> can be used to override the values
      of <code>PETSC_DIR</code> and <code>PETSC_ARCH</code> or if
      these environment variables are not set at all. If you do have a
      PETSc installation and have set the <code>PETSC_DIR</code> and
      <code>PETSC_ARCH</code> environment variables but do not wish
      <acronym>deal.II</acronym> to be configured for PETSc use, you
      should specify <code>--with-petsc=no</code> as a flag during
      configuration.
      </p>

      <p>
      Note that in order to use PETSc with <acronym>deal.II</acronym>
      with the current release version of <acronym>deal.II</acronym>
      you will need to have at least PETSc version 2.3.0 installed,
      earlier releases are no longer supported. There is no
      correlation between <acronym>deal.II</acronym> version numbers
      and PETSc version numbers. <acronym>deal.II</acronym> version
      7.0 has been tested up to PETSc release 3.1.0-p8.
      </p>

      <p>
      There is an additional caveat: PETSc appears not to co-operate
      well when using threads and some programs crash when deal.II is
      compiled in its usual mode supporting multithreading. If you see
      this sort of behavior, we recommend to try disabling
      multithreading upon configuration of <acronym>deal.II</acronym>
      using the
      <code>--disable-threads</code> switch to <code>./configure</code>.
      </p>

      <p>
      Installing both PETSc and deal.II together can be a bit of a
      challenge. A good summary of the relevant steps can be found on
      the <a href="http://dealii.sourceforge.net/index.php?title=Deal.II_Questions_and_Answers"
      target="_top">Frequently Asked Questions</a> page.
      </p>

      <h5>Trilinos</h5>

      <p>
      As above, set the <code>TRILINOS_DIR</code>
      environment variable to the path to an existing Trilinos installation,
      or use the <code>--with-trilinos=/path/to/trilinos</code> switch of
      the deal.II <code>./configure</code> script. It should point to the path
      of which the include and lib directories are subdirs. The Trilinos
      installation needs to provide the same kind of libraries that
      <acronym>deal.II</acronym> is configured for, i.e. if you want deal.II
      to use shared libraries, then Trilinos needs to use shared libraries as
      well.
      </p>

      <p>
      <acronym>deal.II</acronym> and its tutorial programs use several of the
      Trilinos sub-packages.
      </p>

      <h6>Trilinos starting with version 10.0</h6>

      <p style="color: red">
      Note: Trilinos versions 10.6.0 to 10.6.2 are not compatible with
      deal.II. There are subtle bugs related to parallel matrices and vectors.
      </p>

      <p>
      Due to the entirely different build system, deal.II does no longer
      support Trilinos versions prior to 10.0.
      Starting with this version, Trilinos uses cmake to configure and
      build. This is a bit cumbersome because you first have to install a
      version of cmake that is at least a cmake 2.8 prerelease, and then enter
      the following slightly longish set of commands:
      <code>
      <pre>
cd trilinos-10.0.2
mkdir build
cd build

cmake -D Trilinos_ENABLE_OPTIONAL_PACKAGES:BOOL=ON \
      -D Trilinos_ENABLE_Sacado:BOOL=ON \
      -D Trilinos_ENABLE_Stratimikos:BOOL=ON \
      -D CMAKE_BUILD_TYPE:STRING=RELEASE \
      -D CMAKE_CXX_FLAGS:STRING="-g -O3" \
      -D CMAKE_C_FLAGS:STRING="-g -O3" \
      -D CMAKE_FORTRAN_FLAGS:STRING="-g -O5" \
      -D Trilinos_EXTRA_LINK_FLAGS:STRING="-lgfortran" \
      -D CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE \
      -D Trilinos_VERBOSE_CONFIGURE:BOOL=FALSE \
      -D TPL_ENABLE_MPI:BOOL=OFF \
      -D CMAKE_INSTALL_PREFIX:PATH=/w/bangerth/share/x86_64/trilinos-10.4.0 \<commit_msg>improve documentation about Trilinos versions.<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>The deal.II Readme on interfacing to PETSc and Trilinos</title>
  <link href="screen.css" rel="StyleSheet">
  <meta name="author" content="the deal.II authors <authors @ <EMAIL>>">
  <meta name="copyright" content="Copyright (C) 2008, 2009, 2010, 2011 by the deal.II authors">
  <meta name="date" content="$Date: 2008-10-14 05:36:48 -0500 (Tue, 14 Oct 2008) $">
  <meta name="svn_id" content="$Id: readme.html 17202 2008-10-14 10:36:48Z heister $">
  <meta name="keywords" content="deal.II">
</head>

<body>


    <h1>Interfacing <acronym>deal.II</acronym> to PETSc and Trilinos</h1>

    <h3>About PETSc, Trilinos, and the <acronym>deal.II</acronym>
    interfaces</h3>

    <p>
      <acronym>deal.II</acronym> can interface to the <a
      href="http://www.mcs.anl.gov/petsc/" target="_top">PETSc</a> and
      <a href="http://trilinos.sandia.gov" target="_top">Trilinos</a> software
      libraries. Both of these libraries provide lots of functions for linear
      algebra, among other things, for example implementations of a variety of
      linear solvers, as well as various different sparse and dense matrix and
      vector formats. Trilinos also has many subpackages that deal with
      problems that go far beyond linear algebra, for example nonlinear
      solvers, automatic differentiation packages, uncertainty propagation
      engines, etc. Of particular interest to deal.II is their ability to
      provide this functionality both on sequential and parallel (using MPI)
      computers. PETSc is written in C; Trilinos is written in C++ and can be
      considered to be a more modern version of PETSc though both packages are
      under continuing development at their respective national laboratories.
      </p>

      <p>
      <acronym>deal.II</acronym> has wrapper classes to the linear algebra
      parts of both packages that provide almost the
      same interfaces as the built-in <acronym>deal.II</acronym> linear
      algebra classes. We use these interfaces for parallel computations based
      on MPI since the native deal.II linear algebra classes lack this ability.
      </p>

      <h3>Configuring the interfaces to PETSc and Trilinos</h3>

      <p>
      The use of PETSc and Trilinos is optional. To use the wrapper classes,
      you first have to install these packages and
      point <acronym>deal.II</acronym>'s <code>./configure</code> to the
      installation directories. This happens in similar ways for the two
      packages:
      </p>

      <h5>PETSc</h5>

      <p>
      PETSc usually requires you to set the
      environment variables <code>PETSC_DIR</code> and <code>PETSC_ARCH</code>
      to a path to PETSc and denoting the architecture for which PETSc is
      compiled. If these environment variables are set, then
      <acronym>deal.II</acronym> will pick them up during
      configuration, and store them. It will then also recognize that
      PETSc shall be used, and enable the wrapper classes.
      </p>

      <p>
      Alternatively, the <code>--with-petsc=DIR</code> and
      <code>--with-petsc-arch=ARCH</code> switches to
      <code>./configure</code> can be used to override the values
      of <code>PETSC_DIR</code> and <code>PETSC_ARCH</code> or if
      these environment variables are not set at all. If you do have a
      PETSc installation and have set the <code>PETSC_DIR</code> and
      <code>PETSC_ARCH</code> environment variables but do not wish
      <acronym>deal.II</acronym> to be configured for PETSc use, you
      should specify <code>--with-petsc=no</code> as a flag during
      configuration.
      </p>

      <p>
      Note that in order to use PETSc with <acronym>deal.II</acronym>
      with the current release version of <acronym>deal.II</acronym>
      you will need to have at least PETSc version 2.3.0 installed,
      earlier releases are no longer supported. There is no
      correlation between <acronym>deal.II</acronym> version numbers
      and PETSc version numbers. <acronym>deal.II</acronym> version
      7.0 has been tested up to PETSc release 3.1.0-p8.
      </p>

      <p>
      There is an additional caveat: PETSc appears not to co-operate
      well when using threads and some programs crash when deal.II is
      compiled in its usual mode supporting multithreading. If you see
      this sort of behavior, we recommend to try disabling
      multithreading upon configuration of <acronym>deal.II</acronym>
      using the
      <code>--disable-threads</code> switch to <code>./configure</code>.
      </p>

      <p>
      Installing both PETSc and deal.II together can be a bit of a
      challenge. A good summary of the relevant steps can be found on
      the <a href="http://dealii.sourceforge.net/index.php?title=Deal.II_Questions_and_Answers"
      target="_top">Frequently Asked Questions</a> page.
      </p>

      <h5>Trilinos</h5>

      <p>
      As above, set the <code>TRILINOS_DIR</code>
      environment variable to the path to an existing Trilinos installation,
      or use the <code>--with-trilinos=/path/to/trilinos</code> switch of
      the deal.II <code>./configure</code> script. It should point to the path
      of which the include and lib directories are subdirs. The Trilinos
      installation needs to provide the same kind of libraries that
      <acronym>deal.II</acronym> is configured for, i.e. if you want deal.II
      to use shared libraries, then Trilinos needs to use shared libraries as
      well.
      </p>

      <p>
      <acronym>deal.II</acronym> and its tutorial programs use several of the
      Trilinos sub-packages.
      </p>

      <h6>Trilinos starting with version 10.0</h6>

      <p style="color: red">
      Note: Trilinos versions 10.6.x are not compatible with
      deal.II. There are subtle bugs related to parallel matrices and vectors.
      </p>

      <p>
      Due to the entirely different build system, deal.II does no longer
      support Trilinos versions prior to 10.0.
      Starting with this version, Trilinos uses cmake to configure and
      build. This is a bit cumbersome because you first have to install a
      version of cmake that is at least a cmake 2.8 prerelease, and then enter
      the following slightly longish set of commands:
      <code>
      <pre>
cd trilinos-10.4.2
mkdir build
cd build

cmake -D Trilinos_ENABLE_OPTIONAL_PACKAGES:BOOL=ON \
      -D Trilinos_ENABLE_Sacado:BOOL=ON \
      -D Trilinos_ENABLE_Stratimikos:BOOL=ON \
      -D CMAKE_BUILD_TYPE:STRING=RELEASE \
      -D CMAKE_CXX_FLAGS:STRING="-g -O3" \
      -D CMAKE_C_FLAGS:STRING="-g -O3" \
      -D CMAKE_FORTRAN_FLAGS:STRING="-g -O5" \
      -D Trilinos_EXTRA_LINK_FLAGS:STRING="-lgfortran" \
      -D CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE \
      -D Trilinos_VERBOSE_CONFIGURE:BOOL=FALSE \
      -D TPL_ENABLE_MPI:BOOL=OFF \
      -D CMAKE_INSTALL_PREFIX:PATH=/w/bangerth/share/x86_64/trilinos-10.4.2 \
{'fraction_non_alphanumeric': 0.08985834096835577, 'fraction_numerical': 0.01613926280921841, 'mean_word_length': 2.935108153078203, 'pattern_counts': {'":': 0, '<': 243, '<?xml version=': 0, '>': 243, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4635276', 'n_tokens_mistral': 4613, 'n_tokens_neox': 4263, 'n_words': 1584}