mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
devcontainer: Add clang, gfortran, and valgrind
Provide `clang` for developers who prefer to build with it rather than with the default `g++`, and `valgrind` to run CMake and its tests under a memory checker. The sanitizer runtimes already come with both compilers, so building with `-fsanitize=` needs nothing installed. Name `gfortran` as well, without which Clang cannot link at all. Ubuntu 26.04 carries a Fortran-only `gcc-16` build that provides no C++ standard library, `libopenmpi-dev` lists `gfortran-16` first among the alternatives it accepts, and Clang selects the newest GCC installation it finds. Naming `gfortran` lets `apt` satisfy that dependency with `gfortran-15` instead, so the GCC 16 installation never appears. Suggested-by: Tyler Yankee <tyler.yankee@kitware.com>
This commit is contained in:
@@ -17,13 +17,24 @@ nano
|
||||
unminimize
|
||||
vim
|
||||
|
||||
# Build CMake.
|
||||
# Build CMake. `g++` comes from `deps_packages.lst`, as CI builds with it;
|
||||
# `clang` is here for developers who prefer to build with it instead.
|
||||
#
|
||||
# `gfortran` is named only to keep the Fortran-only `gcc-16` build that
|
||||
# Ubuntu 26.04 carries out of the container: `libopenmpi-dev` lists
|
||||
# `gfortran-16` first among the alternatives it accepts, and Clang, which
|
||||
# selects the newest GCC installation it finds, cannot link against one that
|
||||
# provides no C++ standard library.
|
||||
ccache
|
||||
clang
|
||||
cmake
|
||||
gfortran
|
||||
ninja-build
|
||||
|
||||
# Debug CMake.
|
||||
# Debug and diagnose CMake. The sanitizer runtimes come with the compilers,
|
||||
# so building with `-fsanitize=` needs nothing installed here.
|
||||
gdb
|
||||
valgrind
|
||||
|
||||
# Build the documentation.
|
||||
python3-sphinx
|
||||
|
||||
@@ -111,6 +111,13 @@ against, the container provides:
|
||||
Ubuntu release with ``-rc`` appended. Add it to the ``Suites`` field of
|
||||
``/etc/apt/sources.list.d/kitware.sources`` to install those as well.
|
||||
|
||||
* ``clang``, for developers who would rather build with it than with the
|
||||
default ``g++``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ cmake -G Ninja -B build-clang -S . -DCMAKE_CXX_COMPILER=clang++
|
||||
|
||||
* ``ccache``, to speed up repeated builds, e.g.:
|
||||
|
||||
.. code-block:: console
|
||||
@@ -140,6 +147,18 @@ against, the container provides:
|
||||
|
||||
* ``gdb``, to debug CMake as described in the `CMake Debugging Guide`_.
|
||||
|
||||
* ``valgrind``, and the sanitizer runtimes that come with ``g++`` and
|
||||
``clang``, to run CMake and its tests under a memory checker, the way the
|
||||
sanitizer and Valgrind jobs of our CI do:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ cmake -G Ninja -B build-asan -S . \
|
||||
-DCMAKE_C_FLAGS=-fsanitize=address \
|
||||
-DCMAKE_CXX_FLAGS=-fsanitize=address
|
||||
$ cmake --build build-asan
|
||||
$ ctest --test-dir build-asan
|
||||
|
||||
* ``glab``, the `GitLab CLI`_, to work with merge requests, issues, and
|
||||
pipelines on our GitLab instance, and `glab-axi`_, a wrapper around it
|
||||
whose output follows the `AXI`_ conventions:
|
||||
|
||||
Reference in New Issue
Block a user