# 使用 Homebrew, apk, apt, dnf, Nix, zypper 安装 csmith

查看 csmith 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install csmith
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add csmith
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:csmith
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/csmith>
- **版本:** 2.3.0
- **来源摘要:** Generates random C programs conforming to the C99 standard
- **主页:** <https://github.com/csmith-project/csmith>
- **仓库:** <https://github.com/csmith-project/csmith>
- **上游文档:** <https://github.com/csmith-project/csmith#readme>
- **许可证:** BSD-2-Clause
- **源码归档:** <https://github.com/csmith-project/csmith/archive/refs/tags/csmith-2.3.0.tar.gz>
- **最后更新:** 2026-06-19T12:30:04-07:00
- **已生成:** 2026-07-08T18:08:21+00:00

## 可执行文件

- compiler_test.pl (cli)
- csmith (cli)
- launchn.pl (cli)
- compiler_test.pl (别名)
- csmith (别名)
- launchn.pl (别名)

## 安装行为

- post-install 钩子: 未定义
- 注意事项: It is recommended that you set the environment variable 'CSMITH_PATH' to $HOMEBREW_CELLAR/csmith/2.3.0/include/csmith-2.3.0
- Bottle: 可用 于 arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 2.3.0
- 管理器更新时间: 2026-06-19
- 本地数据: OK
- 上游仓库: https://github.com/csmith-project/csmith
- 检测到的最新版本: csmith-2.3.0 (当前)
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

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


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

- **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

## 其他软件包管理器记录

- 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


## 相关链接

- [Source-control packages](https://www.automicvault.com/zh-hans/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/zh-hans/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [creduce](https://www.automicvault.com/zh-hans/pkg/brew/creduce/) - Shares av.db curated category or tags: c, cli, compiler-testing, developer-tools, testing.
- [cargo-fuzz](https://www.automicvault.com/zh-hans/pkg/brew/cargo-fuzz/) - Shares av.db curated category or tags: cli, developer-tools, fuzzing, testing.
- [check](https://www.automicvault.com/zh-hans/pkg/brew/check/) - Shares av.db curated category or tags: c, cli, developer-tools, testing.
- [cppunit](https://www.automicvault.com/zh-hans/pkg/brew/cppunit/) - Shares av.db curated category or tags: c, cli, developer-tools, testing.
- [cutter-cli](https://www.automicvault.com/zh-hans/pkg/brew/cutter-cli/) - Shares av.db curated category or tags: c, cli, developer-tools, testing.
- [sqlancer](https://www.automicvault.com/zh-hans/pkg/brew/sqlancer/) - Shares av.db curated category or tags: cli, developer-tools, fuzzing, testing.
- [abnfgen](https://www.automicvault.com/zh-hans/pkg/brew/abnfgen/) - Shares av.db curated category or tags: cli, developer-tools, testing.
- [allure](https://www.automicvault.com/zh-hans/pkg/brew/allure/) - Shares av.db curated category or tags: cli, developer-tools, testing.
- [counterfeiter](https://www.automicvault.com/zh-hans/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/zh-hans/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)


## 来源

- 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
