llvm

Install command:
brew install llvm

Also known as: llvm@21

Next-gen compiler infrastructure

https://llvm.org/

License: Apache-2.0 WITH LLVM-exception

Formula JSON API: /api/formula/llvm.json

Formula code: llvm.rb on GitHub

Bottle (binary package) installation support provided for:

macOS on
Apple Silicon
tahoe
sequoia
sonoma
macOS on
Intel
sonoma
Linux ARM64
x86_64

Current versions:

stable 21.1.5
head ⚡️ HEAD

Other versions:

llvm@20 20.1.8 Next-gen compiler infrastructure
llvm@19 19.1.7 Next-gen compiler infrastructure
llvm@18 18.1.8 Next-gen compiler infrastructure
llvm@17 17.0.6 Next-gen compiler infrastructure
llvm@16 16.0.6 Next-gen compiler infrastructure
llvm@15 15.0.7 Next-gen compiler infrastructure
llvm@14 14.0.6 Next-gen compiler infrastructure
llvm@13 13.0.1 Next-gen compiler infrastructure
llvm@12 12.0.1 Next-gen compiler infrastructure

Keg-only

Depends on:

python@3.14 3.14.0 Interpreted, interactive, object-oriented programming language
xz 5.8.1 General-purpose data compression with high compression ratio
z3 4.15.4 High-performance theorem prover
zstd 1.5.7 Zstandard is a real-time compression algorithm

Depends on when building from source:

cmake 4.1.2 Cross-platform make
ninja 1.13.1 Small build system for use with gyp or CMake
swig 4.4.0 Generate scripting interfaces to C/C++ code
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"

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

Analytics:

Installs (30 days)
llvm 96,530
llvm --HEAD 63
Installs on Request (30 days)
llvm 37,562
llvm --HEAD 63
Build Errors (30 days)
llvm 599
llvm --HEAD 2
Installs (90 days)
llvm 229,126
llvm --HEAD 189
Installs on Request (90 days)
llvm 87,768
llvm --HEAD 188
Installs (365 days)
llvm 903,460
llvm --HEAD 1,097
Installs on Request (365 days)
llvm 398,167
llvm --HEAD 1,096