22 releases

0.3.2 Oct 9, 2021
0.3.1 Dec 4, 2020
0.3.0 May 15, 2020
0.2.2-alpha.1 Dec 25, 2018
0.1.8 Jun 8, 2018

#105 in Build Utils

Download history 27/week @ 2022-12-02 33/week @ 2022-12-09 44/week @ 2022-12-16 65/week @ 2022-12-23 32/week @ 2022-12-30 23/week @ 2023-01-06 32/week @ 2023-01-13 53/week @ 2023-01-20 33/week @ 2023-01-27 81/week @ 2023-02-03 107/week @ 2023-02-10 122/week @ 2023-02-17 44/week @ 2023-02-24 36/week @ 2023-03-03 47/week @ 2023-03-10 48/week @ 2023-03-17

177 downloads per month

MIT license

1.5K SLoC

🆘 This project is only somewhat active due to the low number of active maintainers. If you wish to participate, see #72.


crate docs.rs

Manage multiple LLVM/Clang build


  1. Install cmake, builder (make/ninja), and C++ compiler (g++/clang++)
  2. Install Rust using rustup or any other method. The minimum supported Rust version is currently 1.48.0.
  3. cargo install llvmenv

Basic Usage

To install a specific version of LLVM after following the installation steps above, run these shell commands ("10.0.0" can be replaced with any other version found with llvmenv entries):

llvmenv init
llvmenv entries
llvmenv build-entry 10.0.0

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.


~481K SLoC