Getting Started: Building and Installing Polly

Get the code

The Polly source code is available in the LLVM SVN repository as well as in an official a git mirror. It is added to the tools directory of the llvm sources. Polly and LLVM need to be checked out at the time. Checkouts from different dates may not work!

Set the directory layout:

export BASE=`pwd`
export LLVM_SRC=${BASE}/llvm
export POLLY_SRC=${LLVM_SRC}/tools/polly

SVN

svn checkout http://llvm.org/svn/llvm-project/llvm/trunk ${LLVM_SRC}
svn checkout http://llvm.org/svn/llvm-project/polly/trunk ${POLLY_SRC}

GIT

git clone http://llvm.org/git/llvm.git ${LLVM_SRC}
git clone http://llvm.org/git/polly.git ${POLLY_SRC}

Prerequisites

libgmp

Install libgmp (library + developer package) through the package management system of your operating system.

CLooG/isl

Polly is tested and works with CLooG as of commit 225c2ed62fe37a4db22bf4b95c3731dab1a50dde and isl as of commit cd1939ed06617d00159e8e51b72a804b467e98b4. To get and install the relevant cloog version use the following commands:

Set the directory layout:

export CLOOG_SRC=${BASE}/cloog_src
export CLOOG_INSTALL=${LLVM_SRC}/cloog_install

First installation

${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC}
${POLLY_SRC}/configure --prefix=${CLOOG_INSTALL}
make
make install

Update the installation

Updating CLooG may become necessary, if Polly uses a feature only available in a recent version of CLooG.
${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC}
make
make install

Install Pocc (Optional)

Polly can use PoCC as an external optimizer. PoCC is a research project that provides an integrated version of Pluto, an advanced data-locality and tileability optimizer. Similar functionality was recently integrated in Polly (through isl), however the optimizations are not as mature as the ones in Pluto/PoCC. Hence, if you want to use Pluto to optimize your code or you want to compare the optimizer integrated in Polly to Pluto you may want to use PoCC.

Install PoCC 1.0-rc3.1 (the one with Polly support) and add it to your PATH.
wget http://www.cse.ohio-state.edu/~pouchet/software/pocc/download/pocc-1.0-rc3.1-full.tar.gz
tar xzf pocc-1.0-rc3.1-full.tar.gz
cd pocc-1.0-rc3.1
./install.sh
export PATH=`pwd`/bin
Install scoplib-0.2.0
wget http://www.cse.ohio-state.edu/~pouchet/software/pocc/download/modules/scoplib-0.2.0.tar.gz
tar xzf  scoplib-0.2.0.tar.gz
cd scoplib-0.2.0
./configure --enable-mp-version --prefix=/path/to/scoplib/installation
make && make install

Build Polly

To build Polly you can either use the autoconf or the cmake build system. At the moment only the autoconf build system allows to run the llvm test-suite and only the cmake build system allows to run 'make polly-test'.

Set the directory layout:

export LLVM_BUILD=${BASE}/llvm_build
mkdir ${LLVM_BUILD}
cd ${LLVM_BUILD}

CMake

cmake -DCMAKE_PREFIX_PATH=${CLOOG_INSTALL} ${LLVM_SRC}
make

Autoconf

${LLVM_SRC}/configure --with-cloog=${CLOOG_INSTALL} --with-isl=${CLOOG_INSTALL}
make

Test Polly

To check if Polly works correctly you can run make polly-test. This currently works only with a cmake build.