# 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-07-10. Also installable with debian: sudo apt install csmith.

## 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## Package facts

- **Package key:** brew:csmith
- **Package manager:** Homebrew
- **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>
- **Last updated:** 2026-07-10T13:05:07-04:00
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

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

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 2.3.0
## 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

## 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-16.fc45: normalized package name match | Fedora Rawhide package metadata: csmith from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Tool to generate random C programs for compiler testing | http://embed.cs.utah.edu/csmith/
- dnf - csmith-devel - 2.4.0-16.fc45: 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Header files and libraries for Csmith development | http://embed.cs.utah.edu/csmith/
- zypper - csmith - 2.3.0-1.33: normalized package name match | openSUSE Tumbleweed package metadata: csmith from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Random C code generator | https://github.com/csmith-project/csmith


## Combined YAML source

View the package source record on GitHub. [combined/csmith.yml](https://github.com/mxcl/pkgdb/blob/main/combined/csmith.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
