Skip to content

Instantly share code, notes, and snippets.

Last active July 27, 2023 15:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?

Compiling LLVM from source is mandatory if you are developing an in-source pass (within LLVM source tree). For example, a debug build of LLVM is much more pleasant to work with compared to an optimized one. To compile LLVM, please follow the following steps:

  1. Download LLVM source and unpack it in a directory of your choice which will refer to as [LLVM_SRC]

  2. Create a Seperate Build folder in your choice of directory

$ mkdir llvm-build
$ cd llvm-build
  1. Instruct CMake to detect and configure your build environment:
  1. Now start the actual compilation within your build directory (This will take time)
$ cmake --build .
  1. If you want to install the llvm in default directory, ie; (/usr/local) run the following command
$ sudo cmake --build . --target install

Enjoy Building Plugins :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment