Trilinos
From charlesreid1
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.
Contents
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 \
Scientific Computing Topics in scientific computing.
Numerical Software: Lapack · Sundials · Matlab · Octave · FFTW Petsc · Example Petsc Makefile · Trilinos · Hypre · Ginac · Gnuplot
Python: Numpy · Scipy · Pandas · Matplotlib · Python Sundials · Py4Sci Scikit-learn: Sklearn · Skimage
|
Linear Algebra Topics in linear algebra.
Matlab · Octave · Sundials · Trilinos
|