Skip to main content
v2026.11,986 entries · CC-BY 4.0

Trilinos: What It Is, How to Build It and Read the Configure Output

Trilinos is a C++ framework of solver and scientific-computing packages: what it does, documented CMake recipes, and reading the configure output.

Written and maintained by CASRAI Editorial Board

Published

On this page

Trilinos is an open-source software framework for building high-performance scientific applications, supplied as a collection of C++ packages that provide linear solvers, preconditioners, discretization utilities, automatic differentiation, and partitioning and load balancing. Researchers use it as a library layer under large simulation codes, and install it by configuring it with CMake, choosing which packages to enable, then building and installing it.

This guide covers what Trilinos is used for, the documented ways to configure and build it, how to read the configuration output that decides which packages end up in your build, and the failures the project documentation warns about. It also places Trilinos next to related tools. It does not state a version number, because the project’s pages and releases listing do not present a single current release that a reader can rely on; check the repository for what you are building.

What Trilinos is used for in research

The project describes Trilinos as an advanced software framework designed to facilitate the development of high-performance scientific applications. The documentation groups its capabilities by area: performance portability, linear solvers, preconditioners, discretization utilities, automatic differentiation, and partitioning and load balancing. The linear-solver area is described as a comprehensive suite of iterative and direct solvers for linear systems.

A 2025 paper on the project describes it as a community-developed, open-source software framework for building large-scale, multiphysics simulation codes for scientific and engineering problems, and says the project has reorganised its packages into product areas and built a modernised software stack on the Kokkos ecosystem for performance portability across heterogeneous hardware. The practical reading for a researcher is that Trilinos is not an application you launch. It is a set of libraries that a simulation code links against, so the questions you face are about building it, selecting packages and linking your own code to it.

Trilinos is licensed package by package

The repository states that Trilinos is licensed on a per-package basis, that most packages are now under a BSD license, and that some are published under the (L)GPL. For research reuse this matters in two ways: the licence of each package you enable applies to your build, and a project that redistributes binaries or combines Trilinos with other code should check the licence of every enabled package rather than assuming one licence covers the whole framework. If your results depend on Trilinos, cite the framework and record which packages and build options you used, in line with the FAIR4RS principles for research software.

How to install or access Trilinos

The project’s Getting Started page points to the GitHub repository as the source and to the project’s INSTALL.rst file and a Spack package page as further routes. The documented route on the Getting Started page is a source build with CMake. The page does not give a Spack command, so if you work through Spack, follow the Spack package page and our guide to Spack as an HPC package manager.

Prerequisites

  • CMake. INSTALL.rst requires CMake 3.27.0 or newer.
  • A C compiler and a C++ compiler (the Getting Started page names GCC, Clang and Intel), plus a Fortran compiler if you enable Fortran packages.
  • MPI is optional but recommended on the Getting Started page.
  • BLAS, LAPACK and Boost, as the packages you choose require them.

INSTALL.rst adds a support boundary: compilers and MPI implementations that are not in the project’s automated pull-request testing list get no support. If you are on a cluster, use a compiler and MPI combination that the project tests, and load them through your site’s module system before configuring.

The Getting Started page gives this sequence for a basic out-of-source build:

  1. Clone the repository: git clone https://github.com/trilinos/Trilinos.git
  2. Enter the source directory: cd Trilinos
  3. Create and enter a build directory: mkdir build then cd build
  4. Configure with an install prefix: cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
  5. Build: make -j4
  6. Install: make install

INSTALL.rst then shows how to choose what is built. For an MPI build with every package enabled, its simple recipe is:

cmake -DTPL_ENABLE_MPI=ON -DMPI_BASE_DIR=MPI_PREFIX -DTrilinos_ENABLE_ALL_PACKAGES=ON -DCMAKE_INSTALL_PREFIX=PREFIX SRCmake -j N install

Without MPI, you instead pass the compilers explicitly with -DCMAKE_C_COMPILER, -DCMAKE_CXX_COMPILER and, if needed, -DCMAKE_Fortran_COMPILER. For a smaller build, INSTALL.rst shows enabling individual packages, for example -DTrilinos_ENABLE_Epetra=ON -DTrilinos_ENABLE_AztecOO=ON -DTrilinos_ENABLE_Ifpack=ON. The data table below compares these recipes and the extra options INSTALL.rst lists.

Keep the configure options in a script

INSTALL.rst recommends putting the configure options in a script (its example is named do-configure) instead of typing them each time, and the repository’s sampleScripts directory holds platform examples, described as only a starting point. A script makes the build repeatable, which is what a methods section or a reproducibility check needs. See our notes on CTest as the CMake test driver for running the project’s tests after a build.

Useful optional settings

  • -GNinja to use the Ninja generator (INSTALL.rst lists Ninja 1.10 or newer).
  • -DBUILD_SHARED_LIBS=ON for shared libraries.
  • -DTrilinos_ENABLE_FLOAT=ON and -DTrilinos_ENABLE_COMPLEX=ON to add float and complex scalar types.
  • -DTrilinos_ENABLE_Fortran=OFF to build without Fortran.
  • -DTrilinos_ENABLE_TESTS=ON to build tests.
  • -DTrilinos_ENABLE_Kokkos=ON to enable Kokkos, as shown in the Build Reference.

The repository’s simpleBuildAgainstTrilinos demo shows the downstream step. Configure and install Trilinos with -D CMAKE_INSTALL_PREFIX, -D TPL_ENABLE_MPI=ON and -D Trilinos_ENABLE_Tpetra=ON, then make -j4 install. The install produces TrilinosConfig.cmake under a subdirectory of the prefix. You then configure your own application with cmake -D CMAKE_PREFIX_PATH=TRILINOS_INSTALL_PREFIX ..., run make -j4, and test with ctest. An alternative CMake file in the demo, CMakeLists.by_package.cmake, uses find_package(Tpetra) and the Tpetra::all_libs target. For CUDA builds, the demo notes that nvcc_wrapper is used together with mpicxx and the OMPI_CXX variable.

How to read the Trilinos configure output

The most useful output of a first configuration is not a success message but the list of packages CMake decided to build. The Build Reference (section 5.3.1, determining the list of packages that can be enabled) says the CMake output contains lines headed “Final set of enabled packages” and “Final set of non-enabled packages”. You can pull them out of a configure run by searching its output (standard output and standard error together) for the pattern Final set of .*enabled packages with grep. INSTALL.rst gives the equivalent for finding what can still be enabled: search the output of a bare configure run for Final set of non-enabled SE packages.

Read the two lists against your intent before running make. A package you need that sits in the non-enabled list was either not requested or dropped because a dependency was missing. The INSTALL.rst note on third-party libraries explains the usual cause: enabling all packages triggers searches for third-party libraries (TPLs), and if CMake cannot find one, you either point CMake at it or disable the feature that needs it, as the CMake output says. Treat that output as a to-do list, not noise.

Record both lists with your build script. They are the part of the build that determines which solvers a simulation could have called, and they belong with the software description in a methods section.

Troubleshooting Trilinos builds

CMake refuses to configure

Check the CMake version first. INSTALL.rst requires 3.27.0 or newer, and an older system CMake on a cluster is a documented first suspect. Load a newer CMake module or install one in your own prefix.

A third-party library is not found

With all packages enabled, a missing TPL stops configuration or removes packages. Follow the output: provide the library’s location through the CMake options it names, or disable the package that requires it. Enabling only the packages you need, as in the intermediate recipe, reduces the number of TPLs involved.

The compiler or MPI is not supported

INSTALL.rst states that compilers and MPI implementations outside the automated testing list get no support. If a problem appears only with an untested toolchain, try a tested one before investigating further.

The downstream test fails

The simpleBuildAgainstTrilinos README says the test fails unless Trilinos was built with MPI and MPI works. Rebuild with -D TPL_ENABLE_MPI=ON and confirm that a plain MPI program runs on the same system before suspecting your application.

CUDA builds

Use nvcc_wrapper with mpicxx and the OMPI_CXX variable, as the demo describes. For the performance-portability layer itself, see our guide to Kokkos for HPC research code.

Free alternatives to Trilinos

Trilinos competes for the same role as other numerical libraries that sit under simulation codes. The table lists tools our site covers, with only what the cited pages state.

Tool What its project page says Relationship to Trilinos
PETSc A library for the scalable (parallel) solution of scientific applications modelled by partial differential equations; includes the TAO optimisation toolkit; supports MPI, and GPUs through CUDA, HIP, Kokkos or OpenCL; has C, Fortran and Python (petsc4py) bindings. Closest alternative: a solver-and-toolkit library used by other simulation frameworks.
Kokkos A C++ performance-portability library, covered in our Kokkos guide. Complementary, not a replacement: Trilinos can be configured with Kokkos enabled, and the 2025 paper describes a stack based on it.
SciPy sparse Sparse array formats and sparse solvers in Python, covered in our SciPy sparse guide. A Python-level option for smaller problems that do not need a distributed C++ stack.

Which one fits depends on the simulation code you inherit or are writing: if an existing application already calls PETSc or Trilinos, keep its dependency rather than replacing it. Our research software engineer role definition describes who usually owns that decision in a research group.

Sources

Data: Documented Trilinos CMake configure recipes

Original compilation of the configure recipes shown in the Trilinos INSTALL.rst, Getting Started page and simpleBuildAgainstTrilinos demo: the options each recipe sets and what it builds. Compiled from the project's own documentation; no performance or version claims.

Documented Trilinos CMake configure recipes
RecipeKey CMake optionsWhat it enablesDocumented in
Basic source build-DCMAKE_INSTALL_PREFIX=/path/to/installBasic configure, build and install into the chosen prefixGetting Started page
Simple MPI build, all packages-DTPL_ENABLE_MPI=ON -DMPI_BASE_DIR=MPI_PREFIX -DTrilinos_ENABLE_ALL_PACKAGES=ONEvery package, with MPI; triggers third-party library searchesINSTALL.rst
Non-MPI build-DCMAKE_C_COMPILER -DCMAKE_CXX_COMPILER -DCMAKE_Fortran_COMPILERSerial build with explicitly chosen compilersINSTALL.rst
Intermediate selected packages-DTrilinos_ENABLE_Epetra=ON -DTrilinos_ENABLE_AztecOO=ON -DTrilinos_ENABLE_Ifpack=ONEpetra, AztecOO and IfpackINSTALL.rst
Build for a downstream application-D CMAKE_INSTALL_PREFIX -D TPL_ENABLE_MPI=ON -D Trilinos_ENABLE_Tpetra=ONTpetra with MPI; installs TrilinosConfig.cmake for find_packagesimpleBuildAgainstTrilinos README
Optional scalar types and tests-DTrilinos_ENABLE_FLOAT=ON -DTrilinos_ENABLE_COMPLEX=ON -DTrilinos_ENABLE_TESTS=ONFloat and complex types; testsINSTALL.rst

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Trilinos: What It Is, How to Build It and Read the Configure Output

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →