This project depends on LLVM and clang
v7.0.0.
No support is offered for other versions.
sudo apt install llvm-7
sudo apt install clang-7
Check the package manager for the system you're on.
Check the Official Releases page for downloads.
Build LLVM and clang
by using CMAKE to create the Makefile. In this directory, run:
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=On ../llvm-project/llvm/
To build with the RISC-V backend enabled, add the flag -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV
Then run make
. Make sure to do a parallel build, otherwise it will take a long time:
make -j4
Not enabling debug or assertions will make the compile time faster. However, if you are developing passes, having debug enabled is well worth the wait. In fact, developing passes is probably the only reason you'd want to build from source. Otherwise, just use the package.