# Install csmith with Homebrew, apk, apt, dnf, Nix, zypper

Generates random C programs conforming to the C99 standard. Version 2.3.0 via Homebrew; verified 2026-06-19.

## Install

```sh
sudo av install brew:csmith
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install csmith
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add csmith
```

  Evidence: Alpine Linux edge package indexes: csmith from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install csmith
```

  Evidence: Debian stable package indexes: csmith from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install csmith
```

  Evidence: Fedora Rawhide package metadata: csmith from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#csmith
```

  Evidence: nixpkgs package indexes: pkgs/by-name/cs/csmith/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install csmith
```

  Evidence: openSUSE Tumbleweed package metadata: csmith from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:csmith
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/csmith>
- **Version:** 2.3.0
- **Source summary:** Generates random C programs conforming to the C99 standard
- **Homepage:** <https://github.com/csmith-project/csmith>
- **Repository:** <https://github.com/csmith-project/csmith>
- **Upstream docs:** <https://github.com/csmith-project/csmith#readme>
- **License:** BSD-2-Clause
- **Source archive:** <https://github.com/csmith-project/csmith/archive/refs/tags/csmith-2.3.0.tar.gz>
- **Last updated:** 2026-06-19T12:30:04-07:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- compiler_test.pl (cli)
- csmith (cli)
- launchn.pl (cli)
- compiler_test.pl (alias)
- csmith (alias)
- launchn.pl (alias)

## Install behavior

- Post-install hook: not defined
- Caveats: It is recommended that you set the environment variable 'CSMITH_PATH' to $HOMEBREW_CELLAR/csmith/2.3.0/include/csmith-2.3.0
- Bottle: available on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.3.0
- Package-manager updated: 2026-06-19
- Local data: ok
- Upstream repository: https://github.com/csmith-project/csmith
- Upstream latest detected: csmith-2.3.0 (current)
## Project history and usage

Csmith is a random C program generator designed for compiler testing. It is a package-nerd staple because it turns compiler validation into a repeatable command-line workload that distributions can package and compiler developers can run locally.

### Project history

The official README says Csmith was developed at the University of Utah by Xuejun Yang, Yang Chen, Eric Eide, and John Regehr as part of a compiler-testing research project. It says the project was open sourced in 2009 and is maintained as an open-source project in discretionary time.

### Adoption history

The project became known through differential testing of C compilers. The README points to the paper Finding and Understanding Bugs in C Compilers as the best summary of the research, and the packaged tool is available across Homebrew and several Linux distributions according to the input package-manager facts.

### How it is used

Official usage examples generate a random C file with csmith, compile it with GCC and Clang, run both outputs, and compare results. The README also notes that generated programs avoid undefined behavior and that timeouts are best practice because generated programs can contain infinite loops.

### Why package nerds care

Csmith is a compact command-line generator with outsized value for compiler packages: it can be scripted into local compiler checks, regression hunts, and distribution QA without a large service dependency.

### Timeline

- 2009: Csmith was open sourced.
- 2011: The GitHub repository was created.
- 2026: Homebrew formula metadata lists stable version 2.3.0.

### Related projects

- The README's primary related projects are C compilers such as GCC and Clang, used as differential-testing targets.

### Sources

- <https://github.com/csmith-project/csmith#readme>
- <https://api.github.com/repos/csmith-project/csmith>
- <https://formulae.brew.sh/formula/csmith>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** csmith
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - csmith - 2.3.0-8: normalized package name match | Debian stable package indexes: csmith from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generator of random C programs | https://embed.cs.utah.edu/csmith/
- Debian apt - libcsmith-dev - 2.3.0-8: normalized package name match | Debian stable package indexes: libcsmith-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generator of random C programs (development files) | https://embed.cs.utah.edu/csmith/
- Debian apt - libcsmith0t64 - 2.3.0-8: normalized package name match | Debian stable package indexes: libcsmith0t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generator of random C programs (runtime library) | https://embed.cs.utah.edu/csmith/
- Nix - csmith: normalized package name match | nixpkgs package indexes: pkgs/by-name/cs/csmith/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - csmith - 2.3.0-7.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: csmith from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | generator of random C programs | https://embed.cs.utah.edu/csmith/
- Ubuntu apt - libcsmith-dev - 2.3.0-7.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcsmith-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | generator of random C programs (development files) | https://embed.cs.utah.edu/csmith/
- Ubuntu apt - libcsmith0t64 - 2.3.0-7.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcsmith0t64 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | generator of random C programs (runtime library) | https://embed.cs.utah.edu/csmith/
- apk - csmith - 2.3.0-r2: normalized package name match | Alpine Linux edge package indexes: csmith from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Tool for generating random C programs | https://embed.cs.utah.edu/csmith/
- apk - csmith-doc - 2.3.0-r2: normalized package name match | Alpine Linux edge package indexes: csmith-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Tool for generating random C programs (documentation) | https://embed.cs.utah.edu/csmith/
- dnf - csmith - 2.4.0-15.fc44: normalized package name match | Fedora Rawhide package metadata: csmith from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Tool to generate random C programs for compiler testing | http://embed.cs.utah.edu/csmith/
- dnf - csmith-devel - 2.4.0-15.fc44: normalized package name match | Fedora Rawhide package metadata: csmith-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Header files and libraries for Csmith development | http://embed.cs.utah.edu/csmith/
- zypper - csmith - 2.3.0-1.31: normalized package name match | openSUSE Tumbleweed package metadata: csmith from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Random C code generator | https://github.com/csmith-project/csmith


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [creduce](https://www.automicvault.com/pkg/brew/creduce/) - Shares av.db curated category or tags: c, cli, compiler-testing, developer-tools, testing.
- [cargo-fuzz](https://www.automicvault.com/pkg/brew/cargo-fuzz/) - Shares av.db curated category or tags: cli, developer-tools, fuzzing, testing.
- [check](https://www.automicvault.com/pkg/brew/check/) - Shares av.db curated category or tags: c, cli, developer-tools, testing.
- [cppunit](https://www.automicvault.com/pkg/brew/cppunit/) - Shares av.db curated category or tags: c, cli, developer-tools, testing.
- [cutter-cli](https://www.automicvault.com/pkg/brew/cutter-cli/) - Shares av.db curated category or tags: c, cli, developer-tools, testing.
- [sqlancer](https://www.automicvault.com/pkg/brew/sqlancer/) - Shares av.db curated category or tags: cli, developer-tools, fuzzing, testing.
- [abnfgen](https://www.automicvault.com/pkg/brew/abnfgen/) - Shares av.db curated category or tags: cli, developer-tools, testing.
- [allure](https://www.automicvault.com/pkg/brew/allure/) - Shares av.db curated category or tags: cli, developer-tools, testing.
- [counterfeiter](https://www.automicvault.com/pkg/brew/counterfeiter/) - Local metadata places this package in an adjacent workflow. Shared terms: cli, developer, developer-tools, generation, test.
- [gotests](https://www.automicvault.com/pkg/brew/gotests/) - Local metadata places this package in an adjacent workflow. Shared terms: cli, developer, developer-tools, generation, test.

## Combined YAML source

View the package source record on GitHub. [combined/csmith.yml](https://github.com/automic-vault/db/blob/main/combined/csmith.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
