llvm

Install command:
brew install llvm

Also known as: llvm@23

Next-gen compiler infrastructure

https://llvm.org/

License: Apache-2.0 WITH LLVM-exception

Development: Pull requests

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 23.1.0
head ⚡️ HEAD

Other versions:

llvm@22 22.1.8 Next-gen compiler infrastructure
llvm@21 21.1.8 Next-gen compiler infrastructure
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

Keg-only because macOS already provides this software.

Depends on:

zstd 1.5.7 Zstandard is a real-time compression algorithm
z3 5.1.0 High-performance theorem prover

Depends on when building from source:

cmake 4.4.3 Cross-platform make
ninja 1.13.2 Small build system for use with gyp or CMake
python@3.14 3.14.7 Interpreted, interactive, object-oriented programming language

Uses from macOS: libedit, libffi

Binaries: FileCheck, UnicodeNameMappingGenerator, amdgpu-arch, analyze-build, clang, clang++, clang-23, clang-apply-replacements, clang-change-namespace, clang-check, clang-cl, clang-cpp, clang-doc, clang-extdef-mapping, clang-format, clang-include-cleaner, clang-include-fixer, clang-installapi, clang-linker-wrapper, clang-move, clang-nvlink-wrapper, clang-offload-bundler, clang-offload-packager, clang-query, clang-refactor, clang-reorder-fields, clang-repl, clang-scan-deps, clang-ssaf-analyzer, clang-ssaf-format, clang-ssaf-linker, clang-sycl-linker, clang-tblgen, clang-tidy, clangd, count, diagtool, dsymutil, find-all-symbols, git-clang-format, hmaptool, intercept-build, llc, lli, lli-child-target, llubi, llvm-PerfectShuffle, llvm-addr2line, llvm-ar, llvm-as, llvm-bcanalyzer, llvm-bitcode-strip, llvm-c-test, llvm-cas, llvm-cat, llvm-cfi-verify, llvm-cgdata, llvm-config, llvm-cov, llvm-ctxprof-util, llvm-cvtres, llvm-cxxdump, llvm-cxxfilt, llvm-cxxmap, llvm-debuginfo-analyzer, llvm-debuginfod, llvm-debuginfod-find, llvm-diff, llvm-dis, llvm-dlltool, llvm-dwarfdump, llvm-dwarfutil, llvm-dwp, llvm-exegesis, llvm-extract, llvm-extract-bundle-entry, llvm-gpu-loader, llvm-gsymutil, llvm-ifs, llvm-install-name-tool, llvm-ir2vec, llvm-jitlink, llvm-jitlink-executor, llvm-lib, llvm-libtool-darwin, llvm-link, llvm-lipo, llvm-lto, llvm-lto2, llvm-mc, llvm-mca, llvm-ml, llvm-ml64, llvm-modextract, llvm-nm, llvm-objcopy, llvm-objdump, llvm-offload-binary, llvm-offload-wrapper, llvm-opt-report, llvm-otool, llvm-pdbutil, llvm-profdata, llvm-profgen, llvm-ranlib, llvm-rc, llvm-readelf, llvm-readobj, llvm-readtapi, llvm-reduce, llvm-remarkutil, llvm-rtdyld, llvm-sim, llvm-size, llvm-split, llvm-stress, llvm-strings, llvm-strip, llvm-symbolizer, llvm-tblgen, llvm-test-mustache-spec, llvm-tli-checker, llvm-undname, llvm-windres, llvm-xray, mlir-cat, mlir-irdl-to-cpp, mlir-linalg-ods-yaml-gen, mlir-lsp-server, mlir-minimal-opt, mlir-minimal-opt-canonicalize, mlir-opt, mlir-pdll, mlir-pdll-lsp-server, mlir-query, mlir-reduce, mlir-rewrite, mlir-runner, mlir-src-sharder, mlir-tblgen, mlir-transform-opt, mlir-translate, modularize, not, nvptx-arch, obj2yaml, offload-arch, opt, pp-trace, reduce-chunk-list, run-clang-tidy, sancov, sanstats, scan-build, scan-build-py, scan-view, split-file, tblgen-lsp-server, tblgen-to-irdl, verify-uselistorder, yaml-bench, yaml2obj

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

LLD and LLDB are now provided in separate formulae:
    brew install lld
    brew install lldb

Z3 solver support will be removed in LLVM 24 as it is unsupported upstream,
see https://github.com/llvm/llvm-project/pull/205370

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.

Analytics:

30 days90 days365 days
Installs76,981240,845930,601
Installs (--HEAD)41107524
Installs on Request24,37270,217327,993
Installs on Request (--HEAD)40100508
Build Errors663