Skip to content

Instantly share code, notes, and snippets.

@shovon
Last active April 18, 2019 08:37
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shovon/6151878 to your computer and use it in GitHub Desktop.
Save shovon/6151878 to your computer and use it in GitHub Desktop.
An install script for LLVM and Clang v3.2.

Installing LLVM and Clang v3.2 on OS X

I'm assuming you need this version for Emscripten.

Don't worry, this script will not override your current installation of LLVM and Clang.

Be sure that you have:

  • read this README file
  • read this README file
  • understood that you have been told to read the README file twice
  • read the comments in the script

You should create a folder, cd to it, download the script, and then run it using the sh command.

So the whole process should look like:

$ SCRIPT_URL=https://gist.github.com/shovon/6151878/raw/62c4f4b5733e772b5a627aebd2b0b32d7cd4ab1e/gistfile1.sh
$ mkdir llvm-src
$ cd llvm-src
$ curl $SCRIPT_URL | sh

And if all went well, LLVM and Clang v3.2 should be in /usr/local/llvm/3.2/bin.

# Please read the README file before doing anything.
# Downloads LLVM
curl http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz > llvm-3.2.src.tar.gz
tar -xvzf llvm-3.2.src.tar.gz
rm llvm-3.2.src.tar.gz
mv llvm-3.2.src llvm
# Downlaods Clang in the `tools/` directory
cd llvm/tools
curl http://llvm.org/releases/3.2/clang-3.2.src.tar.gz > clang-3.2.src.tar.gz
tar -xvzf clang-3.2.src.tar.gz
rm clang-3.2.src.tar.gz
mv clang-3.2.src clang
cd ..
# Downloads Compiler RT in the `projects/` directory
cd projects
curl http://llvm.org/releases/3.2/compiler-rt-3.2.src.tar.gz > compiler-rt-3.2.src.tar.gz
tar -xvzf compiler-rt-3.2.src.tar.gz
rm compiler-rt-3.2.src.tar.gz
mv compiler-rt-3.2.src compiler-rt
cd ..
# Prepare to compile
mkdir build
cd build
../configure --prefix=/usr/local/llvm/3.2
# Compile and install
make -j 4
make install
@maayalee
Copy link

maayalee commented Jul 1, 2015

thank you

@tobiasweibel
Copy link

URL gets forwarded by github --> curl needs to be told that it should follow redirects (-L parameter):

curl -L $SCRIPT_URL | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment