User Tools

Site Tools


How To Update to LegUp 3.5

This page describes how to switch branches from the current master (with LLVM 2.9) to the llvm-3.5 branch (with LLVM 3.5).

1. Install dependencies

Get system dependencies.

If you are running Ubuntu < 14.04:

Warning: Be careful running these commands. Don't run them if they remove hundreds of your existing packages. They didn't work for me on Ubuntu 12.10

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install qemu-system-arm gcc-4.8-plugin-dev g++4.8 gcc-4.8-multilib
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50


If you are running Ubuntu 14.04:

sudo apt-get install qemu-system-arm gcc-4.8-plugin-dev 

Get clang 3.5 and add it to your $PATH

cd ~
tar xfJv clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz
rm clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz
cd clang+llvm-3.5.0-x86_64-linux-gnu/bin
ln -s clang clang-3.5
ln -s clang clang-3.5++
echo "export PATH=\$PATH:`pwd`/" >> ~/.bashrc
source ~/.bashrc

Note: if your system is 32-bit this will not work. You can try using clang 3.4 which might work:

sudo apt-get install clang-3.4



or build clang 3.5 from source:

2. git checkout

Get the llvm-3.5 branch.

You have two options here. My preference is Option 2.

2.1 Option 1: Single branch 'llvm-3.5'

Go to your legup directory (mine is ~/legup), pull and checkout the llvm-3.5 branch

cd ~/legup
make clean
git pull
git checkout llvm-3.5

Note: if you get a warning about uncommitted files, or files that may get overwritten, you may want to commit/stash your changes, then attempt the checkout again.

To check which branch you are on run:

git branch

Any changes you commit or push while you are on the llvm-3.5 branch will only exist in the llvm-3.5 branch until you merge them back to the main (master) branch.

To go back to the main (master) branch run:

git checkout master

2.2 Option 2: Concurrent 'master' and 'llvm-3.5' branches

I find it handy to have both the current master branch and llvm-3.5 branch on my machine at the same time. This allows you to switch between the two branches by switching directories, rather than recompiling all of legup. The following instructions will create a new directory called legup-3.5 that is an entire copy of legup. This way you run tests, etc, in 'master' and 'llvm-3.5' at the same time, and make sure they both function the same.

cd ~
git clone legup-3.5
cd legup-3.5
git checkout llvm-3.5

3. make llvm-3.5

cd ~/legup
make clean
make -j4


cd ~/legup-3.5
make clean
make -j4

This will take some time.

4. test

cd examples
make check

If you run into any errors along the way Please email Bain, and/or update this wiki.

how_to_update_to_legup-3.5.txt · Last modified: 2014/10/29 17:30 by acanis