Skip to content

Instantly share code, notes, and snippets.

@tuxology
Created July 31, 2015 16:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuxology/357d8826e97eb72c9277 to your computer and use it in GitHub Desktop.
Save tuxology/357d8826e97eb72c9277 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e -x
numcpu=$(grep -c ^processor /proc/cpuinfo)
git clone https://github.com/llvm-mirror/llvm.git
git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang
mkdir llvm/build/
cd llvm/build/
cmake .. \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_TARGETS_TO_BUILD="ARM;CppBackend;X86;BPF" \
-DCMAKE_INSTALL_PREFIX=/opt/local/llvm
make -j$numcpu
sudo make install
grep -q llvm $HOME/.bashrc || echo 'PATH=/opt/local/llvm/bin:$PATH' >> $HOME/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment