Install the latest stable version from homebrew (macOS only)

Installation

  1. Get homebrew package manager from https://brew.sh
  2. Run brew install llvm , you should get the information like:

Congrats! The LLVM has been installed successfully.

Environment variables setup

export PATH="$PATH:/usr/local/opt/llvm/bin"

This will help cmake find llvm-config package directly, which will automatically help you configure the LLVM_HOME variable and the paths to LLVM headers and libraries.

Get the pre-built LLVM binaries and libraries (Linux and other platforms)

Download and extract LLVM binaries

Environment variables setup

export PATH="$PATH:PATH_TO_PREBUILT"

This will help cmake find llvm-config package directly, which will automatically help you configure the LLVM_HOME variable and the paths to LLVM headers and libraries.