0404 Compilation Trilinos Linux

Kirill Terekhov edited this page Sep 22, 2015 · 5 revisions

Compiling INMOST with Trilinos on Linux

INMOST may be configured with optional Trilinos support. In this case INMOST will support calling linear solvers from Trilinos package, i.e. you will be able to activate Solver::Trilinos_Aztec, Solver::Trilinos_ML, Solver::Trilinos_Ifpack, Solver::Trilinos_Belos packages in Solver::Solver constructor.

INMOST is known to work with Trilinos version 11.12.1.

Compiling Trilinos

You can download Trilinos package from http://trilinos.org/download/. Please note that in order to download it you have to provide some basic information about yourself. Place the source archive in $INMOST_ROOT directory.

Trilinos needs two third party libraries: BLAS and LAPACK. Both of them usually can be easily installed system-wide by your system administrator. You may install them manually, in this case you should provide the full path to the libraries below. If you are planning to use PETSc, then PETSc installer can install both BLAS and LAPACK for you, refer to PETSc installation guide for detail information.

We will unpack Trilinos source archive and create new build directory for Trilinos compilation. We will also define two variables TRILINOS_BASE and TRILINOS_INSTALL_PATH, those will be used later.

cd "$INMOST_ROOT"
tar jxf trilinos-11.12.1-Source.tar.bz2
cd trilinos-11.12.1-Source
export TRILINOS_BASE="`pwd`"
export TRILINOS_INSTALL_PATH="$TRILINOS_BASE/installed"
mkdir -p build
cd build

At this point we recommend you to create a helper script and configuration file. We predefined the set of required Trilinos packages, enabled MPI support, and also defined INSTALL_PREFIX. For fine-tuning and troubleshooting your configuration refer to Trilinos quick reference guide.

cat > do-configure << EOF
#!/bin/bash
export SOURCE_BASE="$TRILINOS_BASE"
EXTRA_ARGS=\$@
cmake \\
  -D Trilinos_CONFIGURE_OPTIONS_FILE="`pwd`/MyConfigureOptions.cmake" \\
  \$EXTRA_ARGS \\
  \${SOURCE_BASE}
EOF
chmod +x do-configure

cat > MyConfigureOptions.cmake << EOF
SET(CMAKE_INSTALL_PREFIX "$TRILINOS_INSTALL_PATH" CACHE PATH "" FORCE)
SET(TPL_ENABLE_MPI ON CACHE BOOL "" FORCE)
SET(Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES OFF CACHE BOOL "" FORCE)
SET(Trilinos_ENABLE_Epetra ON CACHE BOOL "" FORCE)
SET(Trilinos_ENABLE_AztecOO ON CACHE BOOL "" FORCE)
SET(Trilinos_ENABLE_Ifpack ON CACHE BOOL "" FORCE)
SET(Trilinos_ENABLE_ML ON CACHE BOOL "" FORCE)
SET(Trilinos_ENABLE_Amesos ON CACHE BOOL "" FORCE)
SET(Trilinos_ENABLE_Belos ON CACHE BOOL "" FORCE)
EOF

Now you are ready to configure and build Trilinos package, these steps can take some time. Note, if you need to provide path to BLAS and LAPACK libraries, just add options TPL_BLAS_LIBRARIES and TPL_LAPACK_LIBRARIES to do-configure script (e.g., if you used PETSc installer: ./do-configure -DTPL_BLAS_LIBRARIES="$PETSC_DIR/$PETSC_ARCH/lib/libf2cblas.a" -DTPL_LAPACK_LIBRARIES="$PETSC_DIR/$PETSC_ARCH/lib/libf2clapack.a")

./do-configure
make all
make install

Compiling INMOST with Trilinos support

Make sure the environment variable TRILINOS_INSTALL_PATH is initialized correctly, see above. CMake will detect your Trilinos installation if you provide the install path.

cd "$INMOST_ROOT"
mkdir -p INMOST-build
cd INMOST-build
cmake -DUSE_SOLVER_TRILINOS=ON -DTRILINOS_PATH="$TRILINOS_INSTALL_PATH" ../INMOST-0.1
make all
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.