2011-05-02 15:48:29 +08:00
|
|
|
<!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>
|
|
|
|
|
2013-12-20 06:50:10 +08:00
|
|
|
<div id="box">
|
2011-05-02 15:48:29 +08:00
|
|
|
<!--#include virtual="menu.html.incl"-->
|
|
|
|
|
|
|
|
<div id="content">
|
|
|
|
|
|
|
|
<h1>Getting Started: Building and Installing Polly</h1>
|
|
|
|
|
2012-01-17 22:44:35 +08:00
|
|
|
<h2> Automatic </h2>
|
|
|
|
|
|
|
|
There is a <a href="polly.sh">script</a> available to automatically checkout,
|
|
|
|
update, build, and test Polly. This script contains all the commands that are
|
|
|
|
subsequently described on this webpage. The automatic installation consists
|
2012-07-25 00:58:57 +08:00
|
|
|
of four simple steps:
|
2012-01-17 22:44:35 +08:00
|
|
|
|
|
|
|
<pre>
|
2012-07-25 00:58:57 +08:00
|
|
|
mkdir polly && cd polly
|
2012-02-20 16:41:51 +08:00
|
|
|
wget http://polly.llvm.org/polly.sh
|
2012-01-17 22:44:35 +08:00
|
|
|
chmod +x polly.sh
|
|
|
|
./polly.sh
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<h2> Manual </h2>
|
|
|
|
<h3 id="source"> Get the code </h3>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2011-10-06 14:53:17 +08:00
|
|
|
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>
|
2011-10-06 05:10:10 +08:00
|
|
|
directory of the llvm sources.
|
2011-10-06 14:53:17 +08:00
|
|
|
<b>Polly and LLVM need to be checked out at the same time. Checkouts
|
2011-10-06 05:10:10 +08:00
|
|
|
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
|
2012-01-16 23:19:19 +08:00
|
|
|
|
|
|
|
# Also build the matching clang-version (optional)
|
|
|
|
export CLANG_SRC=${LLVM_SRC}/tools/clang
|
2011-10-06 05:10:10 +08:00
|
|
|
</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}
|
2012-01-16 23:19:19 +08:00
|
|
|
|
|
|
|
# Also build the matching clang-version (optional)
|
2012-01-17 02:50:43 +08:00
|
|
|
svn checkout http://llvm.org/svn/llvm-project/cfe/trunk ${CLANG_SRC}
|
2011-10-06 05:10:10 +08:00
|
|
|
</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}
|
2012-01-16 23:19:19 +08:00
|
|
|
|
|
|
|
# Also build the matching clang-version (optional)
|
|
|
|
git clone http://llvm.org/git/clang.git ${CLANG_SRC}
|
2011-10-06 05:10:10 +08:00
|
|
|
</pre>
|
2012-01-17 22:44:35 +08:00
|
|
|
<h3 id="prerequisites"> Prerequisites </h3>
|
2011-10-06 05:10:10 +08:00
|
|
|
<ul>
|
|
|
|
<li>libgmp</li>
|
2014-12-03 03:26:58 +08:00
|
|
|
<li>isl</li>
|
2011-10-06 05:10:10 +08:00
|
|
|
</ul>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2012-01-17 22:44:35 +08:00
|
|
|
<h4> libgmp </h4>
|
2011-10-06 05:10:10 +08:00
|
|
|
Install libgmp (library + developer package) through the package management
|
2011-05-02 15:48:29 +08:00
|
|
|
system of your operating system.
|
|
|
|
|
2014-12-03 03:26:58 +08:00
|
|
|
<h4> isl</h4>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2014-12-03 03:26:58 +08:00
|
|
|
Polly is tested with a fixed version of isl. To obtain the source code of isl
|
|
|
|
use checkout_isl.sh as available in ${POLLY_SRC}/utils/checkout_isl.sh.
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2011-10-06 05:10:10 +08:00
|
|
|
<h4>Set the directory layout:</h4>
|
|
|
|
<pre>
|
2014-12-03 03:26:58 +08:00
|
|
|
export ISL_SRC=${BASE}/isl_src
|
|
|
|
export ISL_INSTALL=${BASE}/isl_install
|
2011-10-06 05:10:10 +08:00
|
|
|
</pre>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2011-09-09 17:08:09 +08:00
|
|
|
<h4> First installation</h4>
|
2011-05-02 15:48:29 +08:00
|
|
|
<pre>
|
2014-12-03 03:26:58 +08:00
|
|
|
${POLLY_SRC}/utils/checkout_isl.sh ${ISL_SRC}
|
|
|
|
cd ${ISL_SRC}
|
|
|
|
./configure --prefix=${ISL_INSTALL}
|
2011-05-02 15:48:29 +08:00
|
|
|
make
|
|
|
|
make install
|
2011-10-26 20:25:49 +08:00
|
|
|
cd ${BASE}
|
2011-05-02 15:48:29 +08:00
|
|
|
</pre>
|
|
|
|
|
2011-10-06 05:10:10 +08:00
|
|
|
<h4> Update the installation</h4>
|
|
|
|
|
2014-12-03 03:26:58 +08:00
|
|
|
Updating isl may become necessary, if Polly uses a feature
|
|
|
|
only available in a recent version of isl.
|
2011-06-30 22:07:23 +08:00
|
|
|
<pre>
|
2014-12-03 03:26:58 +08:00
|
|
|
${POLLY_SRC}/utils/checkout_isl.sh ${ISL_SRC}
|
|
|
|
cd ${ISL_SRC}
|
2011-06-30 22:07:23 +08:00
|
|
|
make
|
|
|
|
make install
|
2011-10-26 20:25:49 +08:00
|
|
|
cd ${BASE}
|
2011-06-30 22:07:23 +08:00
|
|
|
</pre>
|
|
|
|
|
2012-01-17 22:44:35 +08:00
|
|
|
<h3 id="build">Build Polly</h3>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
|
|
|
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
|
2013-08-18 15:33:28 +08:00
|
|
|
the cmake build system allows to run 'make check-polly'.
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2011-10-06 05:10:10 +08:00
|
|
|
<h4>Set the directory layout:</h4>
|
2011-05-02 15:48:29 +08:00
|
|
|
<pre>
|
2011-10-06 05:10:10 +08:00
|
|
|
export LLVM_BUILD=${BASE}/llvm_build
|
|
|
|
mkdir ${LLVM_BUILD}
|
|
|
|
cd ${LLVM_BUILD}
|
|
|
|
</pre>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2011-10-06 05:10:10 +08:00
|
|
|
<h4>CMake</h4>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2011-10-06 05:10:10 +08:00
|
|
|
<pre>
|
2014-12-03 03:26:58 +08:00
|
|
|
cmake -DCMAKE_PREFIX_PATH=${ISL_INSTALL} ${LLVM_SRC}
|
2011-05-02 15:48:29 +08:00
|
|
|
make
|
|
|
|
</pre>
|
|
|
|
|
2011-10-06 05:10:10 +08:00
|
|
|
<h4> Autoconf </h4>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
|
|
|
<pre>
|
2014-12-03 03:26:58 +08:00
|
|
|
${LLVM_SRC}/configure --with-isl=${ISL_INSTALL}
|
2011-05-02 15:48:29 +08:00
|
|
|
make
|
|
|
|
</pre>
|
|
|
|
|
2012-01-17 22:44:35 +08:00
|
|
|
<h3> Test Polly</h3>
|
2011-05-02 15:48:29 +08:00
|
|
|
|
2013-08-18 15:33:28 +08:00
|
|
|
<p>To check if Polly works correctly you can run <em>make check-polly</em> for the
|
|
|
|
cmake build or <em>make check-polly -C tools/polly/test/</em> for the autoconf
|
2011-11-23 03:40:34 +08:00
|
|
|
build.
|
2012-01-31 16:50:16 +08:00
|
|
|
|
2012-03-30 16:18:19 +08:00
|
|
|
<p>If you get something like <em>"... libisl.so.9: cannot open shared object file .."</em>,
|
2014-12-03 03:26:58 +08:00
|
|
|
it is because you installed isl to a non-standard path, and libisl
|
2012-03-30 16:18:19 +08:00
|
|
|
could not be found. To solve this issue, you need to append the path of parent
|
2014-12-03 03:26:58 +08:00
|
|
|
directory of libisl, i.e. ${ISL_INSTALL}/lib, to LD_LIBRARY_PATH by:
|
2012-03-30 16:18:19 +08:00
|
|
|
|
2014-12-03 03:26:58 +08:00
|
|
|
<pre>export LD_LIBRARY_PATH=${ISL_INSTALL}/lib:$LD_LIBRARY_PATH</pre>
|
2014-04-04 03:38:38 +08:00
|
|
|
|
|
|
|
<p>Also try the above command if you get errors such as:
|
|
|
|
<code>undefined symbol: isl_ctx_get_max_operations</code>
|
2012-03-30 16:18:19 +08:00
|
|
|
|
2014-04-04 02:12:13 +08:00
|
|
|
<p>If you get an error in one of the python files, your system probably uses python3
|
|
|
|
as default python interpreter. This is the case, for instance, under Arch Linux.
|
|
|
|
To solve this issue, run <code>cmake</code> again, but with the added argument:
|
|
|
|
<code>-DPYTHON_EXECUTABLE=/usr/bin/python2</code> (replace <code>/usr/bin/python2</code>
|
|
|
|
with the location of the python2 interpreter under your system).
|
|
|
|
|
2014-12-03 03:26:58 +08:00
|
|
|
<pre>cmake -DCMAKE_PREFIX_PATH=${ISL_INSTALL} -DPYTHON_EXECUTABLE=/usr/bin/python2 ${LLVM_SRC}</pre>
|
2014-04-04 02:12:13 +08:00
|
|
|
|
2012-01-31 16:50:16 +08:00
|
|
|
<h2> Optional Features </h2>
|
|
|
|
|
2014-08-14 01:49:16 +08:00
|
|
|
<h3> Pocc [Supported until <a href="http://llvm.org/releases/download.html#3.4.2">LLVM 3.4.2</a>]</h3>
|
2012-01-31 16:50:16 +08:00
|
|
|
|
|
|
|
<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
|
2014-03-10 20:28:20 +08:00
|
|
|
an integrated version of <a href="http://pluto-compiler.sf.net">Pluto</a>, an
|
2012-01-31 16:50:16 +08:00
|
|
|
advanced data-locality and tileability optimizer. Polly includes internally
|
|
|
|
already a similar optimizer, such that in general PoCC is not needed. It is
|
|
|
|
only recommended for people who want to compare against a different
|
|
|
|
optimizer.</a>
|
|
|
|
<br/>
|
2014-08-14 01:49:16 +08:00
|
|
|
To use it install PoCC 1.0-rc3.1 (the one with Polly support) and add it to your PATH.
|
2012-01-31 16:50:16 +08:00
|
|
|
|
|
|
|
<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
|
2012-04-03 14:29:27 +08:00
|
|
|
export PATH=$PATH:`pwd`/bin
|
2012-01-31 16:50:16 +08:00
|
|
|
</pre>
|
|
|
|
|
|
|
|
You also need to install scoplib-0.2.0 and provide its location to
|
|
|
|
Polly's cmake or configure call.
|
|
|
|
|
|
|
|
<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>
|
2011-05-02 15:48:29 +08:00
|
|
|
</div>
|
2013-12-20 06:50:10 +08:00
|
|
|
</div>
|
2012-01-31 16:50:16 +08:00
|
|
|
|
2011-05-02 15:48:29 +08:00
|
|
|
</body>
|
|
|
|
</html>
|