cpp-toolchain documentation
Up-to-date C++ toolchain images for the complete development cycle - GNU and LLVM side by side
Loading...
Searching...
No Matches
Standalone scripts

The public scripts are published self-contained: fetch one from a release and run it on any Debian/Ubuntu-based host, with no image and no checkout involved. In this repository they source their shared helpers instead of carrying them, so fetch the published copy rather than the file here - see Using a public script on its own. Using the images is the Docker route instead.

Directory Scope What lives there
install/ Public - standalone Toolchain installers - cmake.sh, gcc.sh, llvm.sh, binutils.sh, doxygen.sh, ninja.sh, bazel.sh, build2.sh. Reusable on any Debian/Ubuntu-based system, with no dependency on this repository. See install/README.md for the full option reference.
checks/ Public - standalone cxx-standards.sh - which C++ standards a compiler accepts. cxx-stdlibs.sh - which C++ standard libraries are installed, with the SONAME and ABI version a binary will need to find. c-stdlibs.sh - the same, for the C standard library. Point either at any machine, checkout or not. See checks/README.md.
build/ Internal iwyu.sh - include-what-you-use, which upstream publishes as source only. Internal: it builds against an LLVM at a given prefix, not against an arbitrary host.
checks/details/ Internal The image validation gate, which runs inside a built image: it knows this repo's expected package origins and asks its installers what is present. See docs/IMAGES_VALIDATION.md.
lib/ Internal shared.sh - one body per helper, sourced by every install/ and checks/ script that uses one. A published copy carries the helpers it needs inlined instead, composed from this file.
internal/ Internal This repository's own tooling, split by where it runs: host/ - the version-pin guard, the release-note renderer, the standalone composer and the promotion-record schema; image/ - the version collector and the smoke test, bind-mounted into a built image. Not reusable: they parse this repo's Dockerfile, renovate.json and releases/ records. See internal/README.md.

The Dockerfile copies in and runs the install/ and build/ scripts, one per stage that needs one, and copies scripts/ whole into the throwaway validate stages so checks/ can run there.
lib/ is copied in beside them, because the install/, build/ and checks/ scripts source it and it has to reach every stage that runs one. internal/ is this repository's own tooling, which .dockerignore keeps out of the build context entirely - what has to reach a built image gets there by bind-mount instead.

checks/details/ is implementation detail of checks/, in the C++ sense of a nested detail namespace. Repo-specific like internal/, but unlike it these must ship into the image they validate.

Using a public script on its own

Caution
For all scripts in this repo:

  • Optional value needs <name>=<value> semantic
  • There are no positional arguments.

Every file marked Public is published as a standalone file, so you can drop it into a project, a CI job or a plain shell - no image to pull, no repository to clone, no commitment to the rest of this toolchain:

base=https://github.com/GuillaumeDua/cpp-toolchain/releases/latest/download
# Install GCC on any Debian/Ubuntu-based host
wget "${base}/install_gcc.sh"
sudo bash install_gcc.sh --versions='>=13'
# Install LLVM on any Debian/Ubuntu-based host
wget "${base}/install_llvm.sh"
sudo bash install_llvm.sh --versions='21 23' --mode='full'
# clang-21, clang-22, clang-tidy-21, clang-tidy-22, clang-format-21, etc.
# Ask a compiler which C++ standards it accepts - useful to drive a CI matrix
wget "${base}/checks_cxx-standards.sh"
bash checks_cxx-standards.sh --greatest --stable --format=std g++
# -> c++26
# Ask which ABI the installed libstdc++ exposes - the marker a 'GLIBCXX_... not found' names
wget "${base}/checks_cxx-stdlibs.sh"
bash checks_cxx-stdlibs.sh --stdlib=libstdc++ --format=abi
# -> GLIBCXX_3.4.35
# The same question about the C standard library
wget "${base}/checks_c-stdlibs.sh"
bash checks_c-stdlibs.sh --format=abi
# -> GLIBC_2.39

Every one of them describes itself with --help, so the fetched file is its own documentation.

An asset is named for the directory it comes from, since a release asset name carries no directory of its own.

latest is the newest release, and skips the release candidates. Swap it for download/<tag> when you want the URL pinned, which is what you usually want in CI:

base=https://github.com/GuillaumeDua/cpp-toolchain/releases/download/v1.4

v1.4 publishes these without the prefix, as gcc.sh rather than install_gcc.sh; no release before it attaches them at all.

Note
The file in this repository is not the file you download. Here, each script sources its shared helpers from lib/shared.sh, so a helper is written once. The published copy carries them inlined, which is what makes it runnable on its own - see internal/host/compose_standalone.py. Fetching scripts/install/gcc.sh out of the repository gets you a script that cannot find its helpers.

The Internal rows are not published at all. They reach the rest of the tree by relative path and only work inside a checkout or an image.