llvm-project/polly/www/get_started.html

156 lines
4.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Polly - Getting Started</title>
<link type="text/css" rel="stylesheet" href="menu.css" />
<link type="text/css" rel="stylesheet" href="content.css" />
</head>
<body>
<!--#include virtual="menu.html.incl"-->
<div id="content">
<h1>Getting Started: Building and Installing Polly</h1>
<h2 id="source"> Get the code </h2>
The Polly source code is available in the LLVM SVN repository as well as through
an official git mirror. It is added to the <em>tools</em>
directory of the llvm sources.
<b>Polly and LLVM need to be checked out at the same time. Checkouts
from different dates may not work!</b>
<h4>Set the directory layout:</h4>
<pre>
export BASE=`pwd`
export LLVM_SRC=${BASE}/llvm
export POLLY_SRC=${LLVM_SRC}/tools/polly
</pre>
<h4>SVN</h4>
<pre>
svn checkout http://llvm.org/svn/llvm-project/llvm/trunk ${LLVM_SRC}
svn checkout http://llvm.org/svn/llvm-project/polly/trunk ${POLLY_SRC}
</pre>
<h4>GIT</h4>
<pre>
git clone http://llvm.org/git/llvm.git ${LLVM_SRC}
git clone http://llvm.org/git/polly.git ${POLLY_SRC}
</pre>
<h2 id="prerequisites"> Prerequisites </h2>
<ul>
<li>libgmp</li>
<li>CLooG/isl</li>
<li>PoCC (optional)</li>
</ul>
<h3> libgmp </h3>
Install libgmp (library + developer package) through the package management
system of your operating system.
<h3> CLooG/isl</h3>
Polly is tested with a fixed version of <a href="http://www.cloog.org">CLooG</a>
and isl. To obtain the source code of CLooG (including isl) use
checkout_cloog.sh as available in ${POLLY_SRC}/utils/checkout_cloog.sh.
<h4>Set the directory layout:</h4>
<pre>
export CLOOG_SRC=${BASE}/cloog_src
export CLOOG_INSTALL=${BASE}/cloog_install
</pre>
<h4> First installation</h4>
<pre>
${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC}
cd ${CLOOG_SRC}
./configure --prefix=${CLOOG_INSTALL}
make
make install
cd ${BASE}
</pre>
<h4> Update the installation</h4>
Updating CLooG may become necessary, if Polly uses a feature
only available in a recent version of CLooG.
<pre>
${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC}
cd ${CLOOG_SRC}
make
make install
cd ${BASE}
</pre>
<h3> Install Pocc (Optional) </h3>
<p>Polly can use <a href="http://www.cse.ohio-state.edu/~pouchet/software/pocc">
PoCC</a> as an external optimizer. PoCC is a research project that provides
an integrated version of <a href="http://pluto.sf.net">Pluto</a>, 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.</p>
Install PoCC 1.0-rc3.1 (the one with Polly support) and add it to your PATH.
<pre>
wget <a
href="http://www.cse.ohio-state.edu/~pouchet/software/pocc/download/pocc-1.0-rc3.1-full.tar.gz">http://www.cse.ohio-state.edu/~pouchet/software/pocc/download/pocc-1.0-rc3.1-full.tar.gz</a>
tar xzf pocc-1.0-rc3.1-full.tar.gz
cd pocc-1.0-rc3.1
./install.sh
export PATH=`pwd`/bin
</pre>
Install scoplib-0.2.0
<pre>
wget <a
href="http://www.cse.ohio-state.edu/~pouchet/software/pocc/download/modules/scoplib-0.2.0.tar.gz"
>http://www.cse.ohio-state.edu/~pouchet/software/pocc/download/modules/scoplib-0.2.0.tar.gz</a>
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
</pre>
<h2 id="build">Build Polly</h2>
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'.
<h4>Set the directory layout:</h4>
<pre>
export LLVM_BUILD=${BASE}/llvm_build
mkdir ${LLVM_BUILD}
cd ${LLVM_BUILD}
</pre>
<h4>CMake</h4>
<pre>
cmake -DCMAKE_PREFIX_PATH=${CLOOG_INSTALL} ${LLVM_SRC}
make
</pre>
<h4> Autoconf </h4>
<pre>
${LLVM_SRC}/configure --with-cloog=${CLOOG_INSTALL} --with-isl=${CLOOG_INSTALL}
make
</pre>
<h2> Test Polly</h2>
To check if Polly works correctly you can run <em>make polly-test</em> for the
cmake build or <em>make polly-test -C tools/polly/test/</em> for the autoconf
build.
</div>
</body>
</html>