Skip to content

Albany: Building Trilinos from scratch

Justin Clough edited this page Dec 13, 2019 · 3 revisions

Most of the effort of building Albany is in configuring and building Trilinos. An instructional Trilinos configuration script is available at

    Albany/doc/do-cmake-trilinos-instructional

A basic graph showing the dependencies needed to build Albany is shown below:

Graph of albany build dependencies. Only directly relies on Trilinos but Trilinos relies on many things.

Building from Scratch The remainder of the instructions are known to work for Ubuntu 16.04.5 LTS and 19.04. It is not assumed or required that you have admin privileges on the machine you want to build Albany on. The correct order to build is:

  1. gcc
  2. OpenMPI
  3. CMake
  4. Zlib
  5. HDF5
  6. Parallel-NetCDF
  7. NetCDF
  8. BLAS Family: a. BLAS b. CBLAS c. LAPack d. SuperLU
  9. Boost
  10. Yaml-cpp

Frequent Issues

Build time. If you find that rebuilding Albany after making a change to a source file is taking a long time (more than 15s to 1 minute, depending on file), there are typically two basic causes: (1) building Trilinos without explicit template instantiation (ETI) and (2) configuring Trilinos to build static instead of shared libraries. ETI compiles many of Trilinos's headers so that the Albany build does not have to. Building Albany against Trilinos shared libraries means that the linker does not have to build a large static executable. The script above shows how to build with ETI and shared libraries. The runtime cost of using shared libraries is on the order of 1 second at program startup.

Changes by large transition

This is a summary of changes to the Trilinos configuration as a function of large software transitions. You don't need to read this summary if you're building Albany well after these transitions have occurred.

(Nov 2014 transition) If you can already build the Epetra-only Albany, add these lines to your Trilinos configuration file to build the Tpetra-enabled Albany:

    -D Trilinos_ENABLE_Tpetra:BOOL=ON \
    -D Trilinos_ENABLE_Kokkos:BOOL=ON \
    -D Trilinos_ENABLE_Ifpack2:BOOL=ON \
    -D Trilinos_ENABLE_Amesos2:BOOL=ON \
    -D Trilinos_ENABLE_Zoltan2:BOOL=ON \
    -D Trilinos_ENABLE_MueLu:BOOL=ON \

(Feb 2015 transition) If you then can build the Tpetra-enabled Albany, add these lines to build the basic Kokkos-enabled Albany:

    -D Trilinos_ENABLE_Kokkos:BOOL=ON \
    -D Trilinos_ENABLE_KokkosCore:BOOL=ON \
    -D Phalanx_KOKKOS_DEVICE_TYPE:STRING="SERIAL" \
    -D Phalanx_INDEX_SIZE_TYPE:STRING="INT" \
    -D Phalanx_SHOW_DEPRECATED_WARNINGS:BOOL=OFF \
    -D Kokkos_ENABLE_Serial:BOOL=ON \
    -D Kokkos_ENABLE_OpenMP:BOOL=OFF \
    -D Kokkos_ENABLE_Pthread:BOOL=OFF \

Optionally, you can enable MueLu by adding either of these:

    -D Trilinos_ENABLE_MueLu:BOOL=ON \
    -D TPL_ENABLE_SuperLU:STRING=ON \
    -D SuperLU_INCLUDE_DIRS:STRING="${SUPERLUDIR}/include" \
    -D SuperLU_LIBRARY_DIRS:STRING="${SUPERLUDIR}/lib" \

or

    -D Trilinos_ENABLE_MueLu:BOOL=ON \
    -D Amesos2_ENABLE_KLU2:BOOL=ON \

The first requires building SuperLU.

If you are developing Kokkos kernels in Albany, add the following flag to your Albany configuration:

    -D ENABLE_KOKKOS_UNDER_DEVELOPMENT \
Clone this wiki locally