🍺 BREW Explorer

← all formulae

llvm

brew install llvm v22.1.7_1 Apache-2.0 WITH LLVM-exception keg-only

Modular compiler infrastructure library and toolchain for building languages, optimizers, and code generators.

Why you might care

LLVM is the backbone for modern language runtimes (Clang, Swift, Rust) and JIT compilers. Install it when you're building a compiler, language binding, or need the full toolchain outside macOS's system LLVM. Keg-only here because macOS provides its own; use this for development requiring a specific LLVM version or features.

Categories

Alternatives

GCC Clang rustc
102.4k
30-day installs · #38
256.5k
90-day · #63
898.5k
365-day · #64

Runtime dependencies

Build dependencies

Links

Caveats

CLANG_CONFIG_FILE_SYSTEM_DIR: $HOMEBREW_PREFIX/etc/clang
CLANG_CONFIG_FILE_USER_DIR:   ~/.config/clang

LLD is now provided in a separate formula:
  brew install lld

Using `clang`, `clang++`, etc., requires a CLT installation at `/Library/Developer/CommandLineTools`.
If you don't want to install the CLT, you can write appropriate configuration files pointing to your
SDK at ~/.config/clang.

To use the bundled libunwind please use the following LDFLAGS:
  LDFLAGS="-L$HOMEBREW_PREFIX/opt/llvm/lib/unwind -lunwind"

To use the bundled libc++ please use the following LDFLAGS:
  LDFLAGS="-L$HOMEBREW_PREFIX/opt/llvm/lib/c++ -L$HOMEBREW_PREFIX/opt/llvm/lib/unwind -lunwind"
Features newer than system libc++ will require the following define to enable
(support for this may be removed in a future major LLVM release):
  CPPFLAGS="-D_LIBCPP_DISABLE_AVAILABILITY"

NOTE: You probably want to use the libunwind and libc++ provided by macOS unless you know what you're doing.

Keg-only reason

:provided_by_macos

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [
    "llvm@22"
  ],
  "alternatives": [
    "GCC",
    "Clang",
    "rustc"
  ],
  "build_dependencies": [
    "cmake",
    "ninja",
    "swig"
  ],
  "categories": [
    "compiler",
    "library",
    "build-system"
  ],
  "caveats": "CLANG_CONFIG_FILE_SYSTEM_DIR: $HOMEBREW_PREFIX/etc/clang\nCLANG_CONFIG_FILE_USER_DIR:   ~/.config/clang\n\nLLD is now provided in a separate formula:\n  brew install lld\n\nUsing `clang`, `clang++`, etc., requires a CLT installation at `/Library/Developer/CommandLineTools`.\nIf you don\u0027t want to install the CLT, you can write appropriate configuration files pointing to your\nSDK at ~/.config/clang.\n\nTo use the bundled libunwind please use the following LDFLAGS:\n  LDFLAGS=\"-L$HOMEBREW_PREFIX/opt/llvm/lib/unwind -lunwind\"\n\nTo use the bundled libc++ please use the following LDFLAGS:\n  LDFLAGS=\"-L$HOMEBREW_PREFIX/opt/llvm/lib/c++ -L$HOMEBREW_PREFIX/opt/llvm/lib/unwind -lunwind\"\nFeatures newer than system libc++ will require the following define to enable\n(support for this may be removed in a future major LLVM release):\n  CPPFLAGS=\"-D_LIBCPP_DISABLE_AVAILABILITY\"\n\nNOTE: You probably want to use the libunwind and libc++ provided by macOS unless you know what you\u0027re doing.\n",
  "conflicts_with": [],
  "dependencies": [
    "python@3.14",
    "xz",
    "zstd",
    "z3"
  ],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Next-gen compiler infrastructure",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:40:37+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "llvm",
  "github_default_branch": null,
  "github_last_commit_at": null,
  "github_readme_excerpt": null,
  "github_repo": null,
  "github_stars": null,
  "github_topics": [],
  "homepage": "https://llvm.org/",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": "The LLVM Compiler Infrastructure Project",
  "installs_30d": 102433,
  "installs_365d": 898547,
  "installs_90d": 256510,
  "keg_only": 1,
  "keg_only_reason": ":provided_by_macos",
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "Apache-2.0 WITH LLVM-exception",
  "llm_generated_at": "2026-06-20T23:42:18+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "llvm",
  "oldnames": [],
  "one_liner": "Modular compiler infrastructure library and toolchain for building languages, optimizers, and code generators.",
  "optional_dependencies": [],
  "rank_30d": 38,
  "rank_365d": 64,
  "rank_90d": 63,
  "raw_hash": "89222f3711f2cab8",
  "recommended_dependencies": [],
  "revision": 1,
  "ruby_source_path": "Formula/l/llvm.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [
    "libedit",
    "libffi",
    "ncurses"
  ],
  "version_head": "HEAD",
  "version_stable": "22.1.7",
  "versioned_formulae": [
    "llvm@21",
    "llvm@20",
    "llvm@19",
    "llvm@18",
    "llvm@17",
    "llvm@16",
    "llvm@15",
    "llvm@14",
    "llvm@12"
  ],
  "why_use_this": "LLVM is the backbone for modern language runtimes (Clang, Swift, Rust) and JIT compilers. Install it when you\u0027re building a compiler, language binding, or need the full toolchain outside macOS\u0027s system LLVM. Keg-only here because macOS provides its own; use this for development requiring a specific LLVM version or features."
}