Skip to content

Instantly share code, notes, and snippets.

@joka90
Created March 27, 2016 17:15
Show Gist options
  • Save joka90/3aa620733ec8a0d85936 to your computer and use it in GitHub Desktop.
Save joka90/3aa620733ec8a0d85936 to your computer and use it in GitHub Desktop.
compile llvm and clang with some nice backends and tools
# Get llvm
svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_370/final/ llvm
# Get clang
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_370/final/ clang
#Checkout Compiler-RT (required to build the sanitizers) [Optional]:
cd ../projects
svn co http://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_370/final/ compiler-rt
# Checkout Libomp (required for OpenMP support) [Optional]:
cd ../projects
svn co http://llvm.org/svn/llvm-project/openmp/tags/RELEASE_370/final/ openmp
# Checkout libcxx and libcxxabi [Optional]:
cd ../projects
svn co http://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_370/final/ libcxx
svn co http://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_370/final/ libcxxabi
# Checkout resurrected LLVM "C Backend"
cd ../projects
git clone https://github.com/JuliaComputing/llvm-cbe.git llvm-cbe
# Create build directory
cd ..
mkdir build
cd build
# Generate makefiles
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=prefix=/usr -DLLVM_TARGETS_TO_BUILD="AArch64;AMDGPU;ARM;CppBackend;X86" ../
# Build
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment