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.
How to configure, build and link a first Trilinos build step by step
The Getting Started page gives this sequence for a basic out-of-source build:
- Clone the repository:
git clone https://github.com/trilinos/Trilinos.git - Enter the source directory:
cd Trilinos - Create and enter a build directory:
mkdir buildthencd build - Configure with an install prefix:
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install - Build:
make -j4 - 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
-GNinjato use the Ninja generator (INSTALL.rst lists Ninja 1.10 or newer).-DBUILD_SHARED_LIBS=ONfor shared libraries.-DTrilinos_ENABLE_FLOAT=ONand-DTrilinos_ENABLE_COMPLEX=ONto add float and complex scalar types.-DTrilinos_ENABLE_Fortran=OFFto build without Fortran.-DTrilinos_ENABLE_TESTS=ONto build tests.-DTrilinos_ENABLE_Kokkos=ONto enable Kokkos, as shown in the Build Reference.
Link your own code against the installed Trilinos
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
- Trilinos Project: home page, checked 2026-11-17
- Trilinos Project: Getting Started, checked 2026-11-17
- Trilinos on GitHub: INSTALL.rst, checked 2026-11-17
- Trilinos on GitHub: repository page and licensing statement, checked 2026-11-17
- Trilinos on GitHub: simpleBuildAgainstTrilinos demo README, checked 2026-11-17
- Trilinos Project: Build Reference, checked 2026-11-17
- arXiv: Trilinos: Enabling Scientific Computing Across Diverse Hardware Architectures at Scale, checked 2026-11-17
- PETSc documentation: home page, checked 2026-11-17
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.
| Recipe | Key CMake options | What it enables | Documented in |
|---|---|---|---|
| Basic source build | -DCMAKE_INSTALL_PREFIX=/path/to/install | Basic configure, build and install into the chosen prefix | Getting Started page |
| Simple MPI build, all packages | -DTPL_ENABLE_MPI=ON -DMPI_BASE_DIR=MPI_PREFIX -DTrilinos_ENABLE_ALL_PACKAGES=ON | Every package, with MPI; triggers third-party library searches | INSTALL.rst |
| Non-MPI build | -DCMAKE_C_COMPILER -DCMAKE_CXX_COMPILER -DCMAKE_Fortran_COMPILER | Serial build with explicitly chosen compilers | INSTALL.rst |
| Intermediate selected packages | -DTrilinos_ENABLE_Epetra=ON -DTrilinos_ENABLE_AztecOO=ON -DTrilinos_ENABLE_Ifpack=ON | Epetra, AztecOO and Ifpack | INSTALL.rst |
| Build for a downstream application | -D CMAKE_INSTALL_PREFIX -D TPL_ENABLE_MPI=ON -D Trilinos_ENABLE_Tpetra=ON | Tpetra with MPI; installs TrilinosConfig.cmake for find_package | simpleBuildAgainstTrilinos README |
| Optional scalar types and tests | -DTrilinos_ENABLE_FLOAT=ON -DTrilinos_ENABLE_COMPLEX=ON -DTrilinos_ENABLE_TESTS=ON | Float and complex types; tests | INSTALL.rst |
Sources
- Trilinos INSTALL.rst (accessed 2026-11-17)
- Trilinos Getting Started (accessed 2026-11-17)
- simpleBuildAgainstTrilinos README (accessed 2026-11-17)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







