Skip to content

Instantly share code, notes, and snippets.

@Prajwalprakash3722
Last active July 27, 2023 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Prajwalprakash3722/aab5cbee38c313fe65a465d5d6a3da3c to your computer and use it in GitHub Desktop.
Save Prajwalprakash3722/aab5cbee38c313fe65a465d5d6a3da3c to your computer and use it in GitHub Desktop.
llvm-building.md

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:
$ cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD=X86 [LLVM_SRC]/llvm
  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