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

FlagValuesDefaultDescription
--compilergcc, clanggccCompiler to install
--versione.g. 14, 18.1.0latestSpecific compiler version
--cpp-standard17, 20, 2320Minimum C++ standard required
--prefixpath~/.local/sniffercommit/toolchain/<name>.<version>Install location
--force(flag)offReinstall even if already installed
--dry-run, -n(flag)offShow 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

Supported Package Managers (POSIX)

PlatformPackage Manager
Debian / Ubuntuapt-get
Fedora / RHELdnf
Arch Linuxpacman
openSUSEzypper
macOSHomebrew (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.