install-compiler — Install a C++ Compiler
$ sniffercommit install-compiler
Installs a C++ compiler/toolchain. If the compiler is already on your PATH, sniffercommit detects it and reports the installed version. Otherwise it installs through your system package manager, or downloads the official LLVM release for a specific clang version.
Options
| Flag | Values | Default | Description |
|---|---|---|---|
--compiler | gcc, clang | gcc | Compiler to install |
--version | e.g. 14, 18.1.0 | latest | Specific compiler version |
--cpp-standard | 17, 20, 23 | 20 | Minimum C++ standard required |
--prefix | path | ~/.local/sniffercommit/toolchain/<name>.<version> | Install location |
--force | (flag) | off | Reinstall even if already installed |
--dry-run, -n | (flag) | off | Show what would be installed without doing it |
Examples
# Install default GCC via system package manager $ sniffercommit install-compiler # Install clang 18 with C++23 support $ sniffercommit install-compiler --compiler clang --version 18 --cpp-standard 23 # Dry run $ sniffercommit install-compiler --dry-run # Force reinstall $ sniffercommit install-compiler --force
How It Works
- Checks whether the compiler is already installed; add
--forceto reinstall. - Validates the compiler/version supports the requested C++ standard (GCC >= 11 → C++20, >= 14 → C++23; Clang >= 14 → C++20, >= 17 → C++23).
- Installs via the detected system package manager, or downloads the official LLVM release tarball when a specific
clangversion is requested.
Supported Package Managers (POSIX)
| Platform | Package Manager |
|---|---|
| Debian / Ubuntu | apt-get |
| Fedora / RHEL | dnf |
| Arch Linux | pacman |
| openSUSE | zypper |
| macOS | Homebrew (brew) or MacPorts (port) |
Note: if the installed compiler is not on your PATH afterwards, restart your shell or add the bin directory to PATH.