19 releases

✓ Uses Rust 2018 edition

0.2.2-alpha.1 Dec 25, 2018
0.2.1 Dec 21, 2018
0.2.0-alpha.2 Nov 30, 2018
0.1.13 Oct 25, 2018
0.1.6 May 24, 2018

#36 in Configuration

Download history 49/week @ 2019-06-23 158/week @ 2019-06-30 46/week @ 2019-07-07 8/week @ 2019-07-14 28/week @ 2019-07-21 27/week @ 2019-07-28 35/week @ 2019-08-04 25/week @ 2019-08-11 7/week @ 2019-08-18 266/week @ 2019-08-25 66/week @ 2019-09-01 45/week @ 2019-09-08 156/week @ 2019-09-15 93/week @ 2019-09-22 44/week @ 2019-09-29

155 downloads per month

MIT license



crate docs.rs CircleCI Azure Pipeline

Manage multiple LLVM/Clang build


  1. Install cmake, builder (make/ninja), and C++ compiler (g++/clang++)
  2. Install Rust using rustup
  3. cargo install llvmenv

zsh integration

You can swtich LLVM/Clang builds automatically using zsh precmd-hook. Please add a line into your .zshrc:

source <(llvmenv zsh)

If $LLVMENV_RUST_BINDING environmental value is non-zero, llvmenv exports LLVM_SYS_60_PREFIX=$(llvmenv prefix) in addition to $PATH.

source <(llvmenv zsh)

This is useful for llvm-sys.rs users. Be sure that this env value will not be unset by llvmenv, only overwrite.



  • entry describes how to compile LLVM/Clang
  • Two types of entries
    • Remote: Download LLVM from Git/SVN repository or Tar archive, and then build
    • Local: Build locally cloned LLVM source
  • See the module document for detail


  • build is a directory where compiled executables (e.g. clang) and libraries are installed.
  • They are compiled by llvmenv build-entry, and placed at $XDG_DATA_HOME/llvmenv (usually $HOME/.local/share/llvmenv).
  • There is a special build, "system", which uses system's executables.

global/local prefix

  • llvmenv prefix returns the path of the current build (e.g. $XDG_DATA_HOME/llvmenv/llvm-dev, or /usr for system build).
  • llvmenv global [name] sets default build, and llvmenv local [name] sets directory-local build by creating .llvmenv text file.
  • You can confirm which .llvmenv sets the current prefix by llvmenv prefix -v.


~415K SLoC