Skip to content

Tools | CMake

Roscoe A. Bartlett edited this page Jun 4, 2024 · 6 revisions

Tools - CMake

Minimum supported CMake version: 2.23

The Trilinos build system is based on CMake. CTest, used for Trilinos testing, is included in the CMake distribution.

Trilinos CMake Links

Installing CMake

An easy way to build and install various versions of CMake from source on many machines is to use the script:

Trilinos/cmake/tribits/devtools_install/install-cmake.py

For example:

$ cd Trilinos/
$ cmake/tribits/devtools_install/install-cmake.py --cmake-version=3.23.5 \
  --install-dir=~/cmake-3.23.5 --parallel=<num-procs> --do-all
$ export PATH=$HOME/cmake-3.23.5/bin:$PATH

See install-cmake.py --help for more details. This script will apply patches to certain versions of CMake to address bugs or performance issues.

Another way to install binary versions of CMake from source is to use Spack.

Another installation option is to use a pre-built binary from the CMake download page. The source code can be found on the same page.

Download the latest released installer for your system and install it anywhere you like. For the *.tar.gz files, you can untar them into any directory. Under that path, you'll find cmake, ctest and cpack in the "bin" directory. You may add this location to your PATH environment value for easy command line use if you wish.

You should uninstall your existing installation of CMake first, or put the new version in a different directory than the old version.

Clone this wiki locally