Frontend application compiler that generates CDFG from C code based on LLVM
-
LLVM-10.0.0 with Polly included
-
CMake
-
C++-17
-
download llvm source codes from https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-10.0.0.tar.gz
extract and change directory name
tar xvf llvmorg-10.0.0.tar.gz
mv llvmorg-10.0.0 llvm-project-10.0.0- build llvm
mkdir llvm-10.0.0-built
cd llvm-project-10.0.0
mkdir build
cd build
cmake -DLLVM_ENABLE_PROJECTS='polly;clang' -G "Unix Makefiles" ../llvm
# multi-thread consumes lots of memory, e.g. -j4 : 30G+
make -j4
# DESTDIR set install directory
make install DESTDIR=/xxx/llvm/llvm-10.0.0-built- set llvm env
# add following env to .bashrc and then source ~/.bashrc.
# or directly export the env
export LLVM_HOME=/xxx/llvm/llvm-10.0.0-built/usr/local/bin
export PATH=$LLVM_HOME:$PATH
# or set the LLVM path in the CMakeLists.txt
set(LLVM_INCLUDE_DIRS "/xxx/llvm-10.0.0-built/usr/local/include")
set(LLVM_LIBRARY_DIRS "/xxx/llvm-10.0.0-built/usr/local/lib")Using the script build.sh in this app-compiler directory
./build.sh