# Install libcpucycles with Homebrew, apt, dnf, Nix

Microlibrary for counting CPU cycles. Version 20260625 via Homebrew; verified 2026-06-25.

## Install

```sh
sudo av install brew:libcpucycles
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install libcpucycles
```

  Evidence: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install cpucycles
```

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

- dnf (92%):

```sh
sudo dnf install libcpucycles
```

  Evidence: Fedora Rawhide package metadata: libcpucycles 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#libcpucycles
```

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

## Package facts

- **Package key:** brew:libcpucycles
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/libcpucycles>
- **Version:** 20260625
- **Source summary:** Microlibrary for counting CPU cycles
- **Homepage:** <https://cpucycles.cr.yp.to/>
- **Upstream docs:** <https://cpucycles.cr.yp.to/>
- **License:** LicenseRef-Homebrew-public-domain OR CC0-1.0 OR 0BSD OR MIT-0 OR MIT
- **Source archive:** <https://cpucycles.cr.yp.to/libcpucycles-20260625.tar.gz>
- **Last updated:** 2026-06-25T22:50:15Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- cpucycles-info (cli)
- cpucycles-open (cli)
- cpucycles-info (alias)
- cpucycles-open (alias)

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 20260625
- Package-manager updated: 2026-06-25
- Local data: ok
- Upstream repository: https://cpucycles.cr.yp.to/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

libcpucycles is a small timing library for counting CPU cycles across multiple CPU and operating-system counter mechanisms. It comes from the cr.yp.to ecosystem associated with Daniel J. Bernstein's performance-oriented cryptographic and systems software.

### Project history

The official introduction describes libcpucycles as a microlibrary for cycle counting, with a simple API: include `cpucycles.h`, call `cpucycles()`, and link with `-lcpucycles`. The project abstracts machine-level counters such as amd64 TSC/PMC, ARM counters, RISC-V counters, and OS fallbacks such as `mach_absolute_time`, `perf_event`, `CLOCK_MONOTONIC`, and `gettimeofday`.

The release notes visible in the 20250925 documentation show active portability work after the early 2023 tarballs, including s390x counter support, FreeBSD support, arm32-1176 support, a `cpucycles-info` man page, and macOS build fixes.

### Adoption history

Adoption is concentrated among developers who need reproducible low-overhead timing for cryptography, benchmarking, and systems tuning. Its appearance in Homebrew, Debian, Ubuntu, Fedora-family packages, and Nix reflects a package-manager role as a tiny measurement primitive rather than an end-user application.

### How it is used

Programmers use libcpucycles when they want an architecture-aware cycle counter without writing per-platform assembly and fallback code. Package users also get tools such as `cpucycles-info` and `cpucycles-open`, which help inspect available counters and support benchmarking workflows.

### Why package nerds care

libcpucycles is package-nerd interesting because it packages the messy hardware reality of cycle counters into a minimal library. It is deliberately small, but its value is in the portability table: one dependency handles CPU families and OS timing APIs that would otherwise become build-system conditionals in every benchmark.

### Timeline

- 2023-01-10: Release notes document `cpucycles_version()` and s390x counter work.
- 2023-01-15: Release notes mention behavior alignment for `cpucycles_version()`.
- 2024-01-14: Release notes add arm32-1176 counter support, FreeBSD support, and install/license documentation updates.
- 2024-03-18: Release notes mention macOS porting fixes and the `cpucycles-info` man page.
- 2025-09-25: Documentation tree published for libcpucycles-20250925.

### Related projects

- Related projects include the broader cr.yp.to software family, architecture-specific cycle counters such as TSC and PMC, Linux `perf_event`, POSIX clocks, and benchmarking code in cryptographic libraries.

### Sources

- <https://cpucycles.cr.yp.to/>
- <https://cpucycles.cr.yp.to/libcpucycles-20250925/doc/api.md.html>
- <https://cpucycles.cr.yp.to/libcpucycles-20250925/doc/download.md.html>
- <https://formulae.brew.sh/formula/libcpucycles>


## Security Notes

library-like package without higher-risk signals.

- **Geiger risk:** green / low
- library-like package without higher-risk signals

## Source Database Details

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

## Other Package-Manager Records

- Debian apt - cpucycles - 0~20240318-2: normalized package name match | Debian stable package indexes: cpucycles from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | command-line tool for counting CPU cycles (libcpucycles) | https://cpucycles.cr.yp.to/
- Debian apt - libcpucycles-dev - 0~20240318-2: normalized package name match | Debian stable package indexes: libcpucycles-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | library for counting CPU cycles - development files | https://cpucycles.cr.yp.to/
- Debian apt - libcpucycles1 - 0~20240318-2: normalized package name match | Debian stable package indexes: libcpucycles1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | library for counting CPU cycles | https://cpucycles.cr.yp.to/
- Nix - libcpucycles: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libcpucycles/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - cpucycles - 0~20240114-1: normalized package name match | Ubuntu 24.04 LTS package indexes: cpucycles from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | command-line tool for counting CPU cycles (libcpucycles) | https://cpucycles.cr.yp.to/
- Ubuntu apt - libcpucycles-dev - 0~20240114-1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcpucycles-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | library for counting CPU cycles - development files | https://cpucycles.cr.yp.to/
- Ubuntu apt - libcpucycles1 - 0~20240114-1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcpucycles1 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | library for counting CPU cycles | https://cpucycles.cr.yp.to/
- dnf - libcpucycles - 20260105-1.fc44: normalized package name match | Fedora Rawhide package metadata: libcpucycles from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Library for counting CPU cycles | https://cpucycles.cr.yp.to/
- dnf - libcpucycles-devel - 20260105-1.fc44: normalized package name match | Fedora Rawhide package metadata: libcpucycles-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Development files for libcpucycles | https://cpucycles.cr.yp.to/
- dnf - libcpucycles-static - 20260105-1.fc44: normalized package name match | Fedora Rawhide package metadata: libcpucycles-static from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Static version of the libcpucycles library | https://cpucycles.cr.yp.to/


## Related links

- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Homebrew utility packages](https://www.automicvault.com/pkg/brew-utility-packages/) - Matched Homebrew package provider.
- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Matched curated package taxonomy and local package facts.
- [ioping](https://www.automicvault.com/pkg/brew/ioping/) - Shares av.db curated category or tags: cli, performance, system.
- [libeatmydata](https://www.automicvault.com/pkg/brew/libeatmydata/) - Shares av.db curated category or tags: cli, performance, system.
- [vmtouch](https://www.automicvault.com/pkg/brew/vmtouch/) - Shares av.db curated category or tags: cli, performance, system.
- [chmlib](https://www.automicvault.com/pkg/brew/chmlib/) - Shares av.db curated category or tags: c, cli, library, system.
- [jemalloc](https://www.automicvault.com/pkg/brew/jemalloc/) - Shares av.db curated category or tags: c, cli, performance, system.
- [libcpuid](https://www.automicvault.com/pkg/brew/libcpuid/) - Shares av.db curated category or tags: c, cli, library, system.
- [liblockfile](https://www.automicvault.com/pkg/brew/liblockfile/) - Shares av.db curated category or tags: c, cli, library, system.
- [libzip](https://www.automicvault.com/pkg/brew/libzip/) - Shares av.db curated category or tags: c, cli, library, system.
- [phoronix-test-suite](https://www.automicvault.com/pkg/brew/phoronix-test-suite/) - Local package facts share a topical domain. Shared terms: benchmarking, cli, open, performance, system.

## Combined YAML source

View the package source record on GitHub. [combined/libcpucycles.yml](https://github.com/automic-vault/db/blob/main/combined/libcpucycles.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
