Welcome to mirror list, hosted at ThFree Co, Russian Federation.

get_started.html « www « polly - github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 92299fb0d6118ec34b8b28d4d3459849bbcf3d14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!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>

<div id="box">
<!--#include virtual="menu.html.incl"-->

<div id="content">

<h1>Getting Started: Building and Installing Polly</h1>

<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
of four simple steps:

<pre>
mkdir polly &amp;&amp; cd polly
wget http://polly.llvm.org/polly.sh
chmod +x polly.sh
./polly.sh
</pre>

<h2> Manual [after 3.6]</h2>
<h3 id="source"> Get the code </h3>

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

# Also build the matching clang-version (optional)
export CLANG_SRC=${LLVM_SRC}/tools/clang
</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}

# Also build the matching clang-version (optional)
svn checkout http://llvm.org/svn/llvm-project/cfe/trunk ${CLANG_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}

# Also build the matching clang-version (optional)
git clone http://llvm.org/git/clang.git ${CLANG_SRC}
</pre>
<h3 id="build">Build Polly</h3>

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 check-polly'.

<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 ${LLVM_SRC} && make
</pre>

<h4> Autoconf </h4>

<pre>
${LLVM_SRC}/configure && make
</pre>

<h3> Test Polly</h3>

<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
build.

<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).

<pre>cmake -DCMAKE_PREFIX_PATH=${ISL_INSTALL} -DPYTHON_EXECUTABLE=/usr/bin/python2 ${LLVM_SRC}</pre>

<h2> Manual [before and including 3.6]</h2>
<h3 id="source"> Get the code </h3>

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

# Also build the matching clang-version (optional)
export CLANG_SRC=${LLVM_SRC}/tools/clang
</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}

# Also build the matching clang-version (optional)
svn checkout http://llvm.org/svn/llvm-project/cfe/trunk ${CLANG_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}

# Also build the matching clang-version (optional)
git clone http://llvm.org/git/clang.git ${CLANG_SRC}
</pre>
<h3 id="prerequisites"> Prerequisites </h3>
<ul>
<li>libgmp</li>
<li>isl</li>
</ul>

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

<h4> isl</h4>

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.

<h4>Set the directory layout:</h4>
<pre>
export ISL_SRC=${BASE}/isl_src
export ISL_INSTALL=${BASE}/isl_install
</pre>

<h4> First installation</h4>
<pre>
${POLLY_SRC}/utils/checkout_isl.sh ${ISL_SRC}
cd ${ISL_SRC}
./configure --prefix=${ISL_INSTALL}
make
make install
cd ${BASE}
</pre>

<h4> Update the installation</h4>

Updating isl may become necessary, if Polly uses a feature
only available in a recent version of isl.
<pre>
${POLLY_SRC}/utils/checkout_isl.sh ${ISL_SRC}
cd ${ISL_SRC}
make
make install
cd ${BASE}
</pre>

<h3 id="build">Build Polly</h3>

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 check-polly'.

<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=${ISL_INSTALL} ${LLVM_SRC}
make
</pre>

<h4> Autoconf </h4>

<pre>
${LLVM_SRC}/configure --with-isl=${ISL_INSTALL}
make
</pre>

<h3> Test Polly</h3>

<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
build.

<p>If you get something like <em>"... libisl.so.9: cannot open shared object file .."</em>,
it is because you installed isl to a non-standard path, and libisl
could not be found. To solve this issue, you need to append the path of parent
directory of libisl, i.e. ${ISL_INSTALL}/lib, to LD_LIBRARY_PATH by:

<pre>export LD_LIBRARY_PATH=${ISL_INSTALL}/lib:$LD_LIBRARY_PATH</pre>

<p>Also try the above command if you get errors such as:
<code>undefined symbol: isl_ctx_get_max_operations</code>

<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).

<pre>cmake -DCMAKE_PREFIX_PATH=${ISL_INSTALL} -DPYTHON_EXECUTABLE=/usr/bin/python2 ${LLVM_SRC}</pre>

<h2> Optional Features </h2>

<h3> Pocc [Supported until <a href="http://llvm.org/releases/download.html#3.4.2">LLVM 3.4.2</a>]</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-compiler.sf.net">Pluto</a>, an
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/>
To use it 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=$PATH:`pwd`/bin
</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>
</div>
</div>

</body>
</html>