1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 2 "http://www.w3.org/TR/html4/strict.dtd"> 3<html> 4<head> 5 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> 6 <title>Polly - Getting Started</title> 7 <link type="text/css" rel="stylesheet" href="menu.css" /> 8 <link type="text/css" rel="stylesheet" href="content.css" /> 9</head> 10<body> 11 12<div id="box"> 13<!--#include virtual="menu.html.incl"--> 14 15<div id="content"> 16 17<h1>Building and Installing Polly</h1> 18 19<h2> Automatic </h2> 20 21There is a <a href="polly.sh">script</a> available to automatically checkout, 22update, build, and test Polly. This script contains all the commands that are 23subsequently described on this webpage. The automatic installation consists 24of four simple steps: 25 26<pre> 27mkdir polly && cd polly 28wget https://polly.llvm.org/polly.sh 29chmod +x polly.sh 30./polly.sh 31</pre> 32 33<h2> Manual </h2> 34<h3 id="source"> Get the code </h3> 35 36<pre> 37git clone https://github.com/llvm/llvm-project.git llvm_git 38</pre> 39<h3 id="build">Build Polly</h3> 40 41<pre> 42mkdir llvm_build && cd llvm_build 43cmake -DLLVM_ENABLE_PROJECTS='polly;clang' ../llvm_git/llvm && make 44</pre> 45 46<h3> Test Polly</h3> 47 48<pre>make check-polly</pre> 49 50<h3>Building Polly Without LLVM</h3> 51It is also possible to build Polly without 52also building LLVM. All you need is an installed version of LLVM or a previous 53build. To configure Polly to use a pre-built LLVM, set the 54<code>-DCMAKE_PREFIX_PATH</code> option: 55 56<pre>cmake -DCMAKE_PREFIX_PATH=${LLVM_PREFIX}/lib/cmake/llvm ../llvm_git/polly</pre> 57 58To run unittests, however, you need to have the LLVM source directory around. 59Polly will use the <code>llvm-config</code> of the LLVM you're building against 60to guess the location of the source directory. You may override autodetected 61location by setting the <code>-DLLVM_SOURCE_ROOT</code> option. 62 63<h3> Troubleshooting</h3> 64 65<p>If you get an error in one of the python files, your system probably uses python3 66as default python interpreter. This is the case, for instance, under Arch Linux. 67To solve this issue, run <code>cmake</code> again, but with the added argument: 68<code>-DPYTHON_EXECUTABLE=/usr/bin/python2</code> (replace <code>/usr/bin/python2</code> 69with the location of the python2 interpreter under your system). 70 71<pre>cmake -DCMAKE_PREFIX_PATH=${ISL_INSTALL} -DPYTHON_EXECUTABLE=/usr/bin/python2 ${LLVM_SRC}</pre> 72 73</div> 74</div> 75 76</body> 77</html> 78