Skip to content

Instantly share code, notes, and snippets.

@RadhikaG
Created December 2, 2017 10:05
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 RadhikaG/6c1f5010b9a5a15e4d66837d3568cdde to your computer and use it in GitHub Desktop.
Save RadhikaG/6c1f5010b9a5a15e4d66837d3568cdde to your computer and use it in GitHub Desktop.
#!/bin/bash
# See: https://llvm.org/docs/GettingStarted.html
# Download this script onto your home directory, ie. whatever is $HOME for you.
# outputs all the commands run to stdout
set -x
echo $HOME
mkdir compiler_session && cd compiler_session
# Downloading the llvm source
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
# Downloading the clang source and adding it to the right directory
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd llvm
mkdir _build && cd _build
# Generating Makefiles for llvm
cmake -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="X86" ../
# Building llvm
cmake --build .
# Installing llvm
cmake -DCMAKE_INSTALL_PREFIX=$HOME/compiler_session/ -P cmake_install.cmake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment