From charlesreid1

No edit summary
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 9: Line 9:
If you're installing Trilinos 10.x, you'll need to install [[CMake]], a build system with some similarities to, and many differences from, GNU autotools.  See the [[Presentations]] page - the "Software" Scientific Computing Summer Workshop covers CMake, as well as differences in the build process between CMake and GNU autotools.  (GNU autotools require the usual "configure, make, make install" sequence.)
If you're installing Trilinos 10.x, you'll need to install [[CMake]], a build system with some similarities to, and many differences from, GNU autotools.  See the [[Presentations]] page - the "Software" Scientific Computing Summer Workshop covers CMake, as well as differences in the build process between CMake and GNU autotools.  (GNU autotools require the usual "configure, make, make install" sequence.)


Also, if you're compiling certain packages (read: if you're installing all the packages by default instead of hand-picking packages), Trilinos will check for MPI, BLAS, and LAPACK - so make sure you've got some version of those before you jump in.


For details on all the third-party packages you can use with Trilinos, see http://trilinos.sandia.gov/third-party_libraries.html .


== Configuration ==
== Configuration ==


=== Trilinos 10.x (CMake) ===
=== Trilinos 10.x (CMake) ===


To build with CMake, you should create a build directory, and put a run_cmake.sh script in your build directory.  This script will contain the CMake directives.   
To build with CMake, you should create a build directory, and put a <code>run_cmake.sh</code> script in your build directory.  This script will contain the CMake directives.  Alternatively, you can use <code>ccmake</code>, which is a sort-of command-line GUI interface to CMake.
 
My recommendation for directory creation/setup is the following:


<syntaxhighlight lang="bash">
<pre>
/path/to/trilinos-build/ --> this is where you run CMake from
/path/to/trilinos-build/src --> this is where you put your Trilinos source code
</pre>
 
You can use a <code>run_cmake.sh</code> script that looks like this (to install all packages and run all tests):
 
<pre>
#!/bin/sh
#!/bin/sh
#
# ./run_cmake.sh
# make
# make install
cmake \
-D CMAKE_BUILD_TYPE:STRING=DEBUG \
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=ON \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
/path/to/trilinos-10.x/src
</pre>
See http://trilinos.sandia.gov/Trilinos10CMakeQuickstart.txt for a lot more information on CMake options and how to do this or that with CMake.
'''NOTE THAT THIS WILL TAKE 2-3 HOURS'''.  Building all packages, and running all tests, takes 2-3 hours.  If you're just looking to use one or two packages, and you don't want to sit there and wait for hours for it to compile, then you can just use:


</syntaxhighlight>
<pre>
-D Trilinos_ENABLE_<PACKAGE>:BOOL=ON
</pre>


to enable a few packages, instead of enabling all the packages.
If you don't want to run into compiler hassles, you'll want to use a version of <code>gcc</code>, <code>g++</code>, and <code>gfortran</code> that are all the same.  On a Mac, this is a little tricky.  I used [[Fink]] to install the GNU compiler collection, so the versions all match, and then add these flags to the <code>run_cmake.sh</code> script:
<pre>
CC=/sw/bin/gcc-4 \
CXX=/sw/bin/g++-4 \
F77=/sw/bin/gfortran \
</pre>


=== Trilinos 9.x (Autotools) ===
=== Trilinos 9.x (Autotools) ===


Configuring Trilinos is a pain if you haven't done it before, because you have to have a version of <code>gcc</code>, <code>g++</code>, and <code>gfortran</code> with matching version numbers - but it won't tell you that.
Configuring Trilinos is a pain if you haven't done it before, because you have to have a version of <code>gcc</code>, <code>g++</code>, and <code>gfortran</code> with precisely-matched version numbers - but it won't tell you that.


On a Mac, there's no stock <code>gfortran</code>, and if you can find one, it usually doesn't match the GNU C/C++ compiler versions.  So, I use [[Fink]] to install the entire GNU compiler collection, so that everything is the same version.  I can point Trilinos' configure to the compilers to use with the following configure line:
On a Mac, there's no stock <code>gfortran</code>, and if you can find one, it usually doesn't match the GNU C/C++ compiler versions.  So, I use [[Fink]] to install the entire GNU compiler collection, so that everything is the same version.  I can point Trilinos' configure to the compilers to use with the following configure line:


<syntaxhighlight lang="bash">
<pre>
#!/bin/sh
#!/bin/sh
#
#
Line 42: Line 82:
   --prefix=/path/to/trilinos \
   --prefix=/path/to/trilinos \
   --disable-default-packages \
   --disable-default-packages \
  --enable-aztecoo \
</pre>
  MACOSX_DEPLOYMENT_TARGET=10.5 \
 
</syntaxhighlight>
There are a plethora of packages to install using <code>--enable-packagename</code> (see http://trilinos.sandia.gov/packages/ for the full list).  Also, if you're building on Mac OS X 10.5 (Leopard), you may need to add this environmental variable to your configure line:
 
<pre>
MACOSX_DEPLOYMENT_TARGET=10.5 \
</pre>


This will only install the package <code>aztecoo</code>, but there are a plethora of others to install (see http://trilinos.sandia.gov/packages/ for the full list).
{{ScientificComputingFlag}}
{{LinearAlgebraFlag}}

Latest revision as of 23:03, 16 November 2019

Trilinos is a suite of object-oriented C++ libraries designed to help facilitate multiphysics simulations. It consists of a whole bunch of different packages, each with its own problem-focus and its own capabilities.

http://trilinos.sandia.gov/

Installation

Dependencies

If you're installing Trilinos 10.x, you'll need to install CMake, a build system with some similarities to, and many differences from, GNU autotools. See the Presentations page - the "Software" Scientific Computing Summer Workshop covers CMake, as well as differences in the build process between CMake and GNU autotools. (GNU autotools require the usual "configure, make, make install" sequence.)

Also, if you're compiling certain packages (read: if you're installing all the packages by default instead of hand-picking packages), Trilinos will check for MPI, BLAS, and LAPACK - so make sure you've got some version of those before you jump in.

For details on all the third-party packages you can use with Trilinos, see http://trilinos.sandia.gov/third-party_libraries.html .

Configuration

Trilinos 10.x (CMake)

To build with CMake, you should create a build directory, and put a run_cmake.sh script in your build directory. This script will contain the CMake directives. Alternatively, you can use ccmake, which is a sort-of command-line GUI interface to CMake.

My recommendation for directory creation/setup is the following:

/path/to/trilinos-build/ --> this is where you run CMake from
/path/to/trilinos-build/src --> this is where you put your Trilinos source code

You can use a run_cmake.sh script that looks like this (to install all packages and run all tests):

#!/bin/sh
# 
# ./run_cmake.sh
# make
# make install

cmake \
 -D CMAKE_BUILD_TYPE:STRING=DEBUG \
 -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=ON \
 -D Trilinos_ENABLE_TESTS:BOOL=ON \
 /path/to/trilinos-10.x/src

See http://trilinos.sandia.gov/Trilinos10CMakeQuickstart.txt for a lot more information on CMake options and how to do this or that with CMake.

NOTE THAT THIS WILL TAKE 2-3 HOURS. Building all packages, and running all tests, takes 2-3 hours. If you're just looking to use one or two packages, and you don't want to sit there and wait for hours for it to compile, then you can just use:

-D Trilinos_ENABLE_<PACKAGE>:BOOL=ON

to enable a few packages, instead of enabling all the packages.

If you don't want to run into compiler hassles, you'll want to use a version of gcc, g++, and gfortran that are all the same. On a Mac, this is a little tricky. I used Fink to install the GNU compiler collection, so the versions all match, and then add these flags to the run_cmake.sh script:

 CC=/sw/bin/gcc-4 \
 CXX=/sw/bin/g++-4 \
 F77=/sw/bin/gfortran \

Trilinos 9.x (Autotools)

Configuring Trilinos is a pain if you haven't done it before, because you have to have a version of gcc, g++, and gfortran with precisely-matched version numbers - but it won't tell you that.

On a Mac, there's no stock gfortran, and if you can find one, it usually doesn't match the GNU C/C++ compiler versions. So, I use Fink to install the entire GNU compiler collection, so that everything is the same version. I can point Trilinos' configure to the compilers to use with the following configure line:

#!/bin/sh
#
# run configure
# make 
# make install

./configure \
  CC=/sw/bin/gcc-4     \
  CXX=/sw/bin/g++-4    \
  F77=/sw/bin/gfortran \
  --prefix=/path/to/trilinos \
  --disable-default-packages \

There are a plethora of packages to install using --enable-packagename (see http://trilinos.sandia.gov/packages/ for the full list). Also, if you're building on Mac OS X 10.5 (Leopard), you may need to add this environmental variable to your configure line:

MACOSX_DEPLOYMENT_TARGET=10.5 \