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" >
2016-02-04 00:18:24 +08:00
< h1 > Building and Installing Polly< / h1 >
2021-10-15 01:24:09 +08:00
You can build Polly with < a href = "https://cmake.org/" > cmake< / a > and your preferred geneator (e.g. Ninja, make, Visual Studio, etc.).
2011-05-02 15:48:29 +08:00
2021-10-15 01:24:09 +08:00
< h3 id = "source" > Get the code< / h3 >
2012-01-17 22:44:35 +08:00
< pre >
2021-10-15 01:24:09 +08:00
git clone https://github.com/llvm/llvm-project.git
2012-01-17 22:44:35 +08:00
< / pre >
2021-10-15 01:24:09 +08:00
You can also get a shallow clone by running:
2015-02-15 19:19:24 +08:00
< pre >
2021-10-15 01:24:09 +08:00
git clone --depth 1 https://github.com/llvm/llvm-project.git
2015-02-15 19:19:24 +08:00
< / pre >
2021-10-15 01:24:09 +08:00
2015-02-15 19:19:24 +08:00
< h3 id = "build" > Build Polly< / h3 >
< pre >
2021-10-15 01:24:09 +08:00
mkdir build & & cd build
cmake '-DLLVM_ENABLE_PROJECTS=clang;polly' ../llvm
cmake --build .
2015-02-15 19:19:24 +08:00
< / pre >
2021-10-15 01:24:09 +08:00
You can also pass arguments to cmake to specify a particular generator (e.g. < code > -G Ninja< / code > ) or the build type (< code > -DCMAKE_BUILD_TYPE=Release< / code > ).
If you just want to play around with Polly, it is recommended to do a Release+Assert build by passing
< code > -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON< / code > .
< h3 > Test Polly< / h3 >
2015-02-15 19:19:24 +08:00
2021-10-15 01:24:09 +08:00
To test Polly, you can run
2011-05-02 15:48:29 +08:00
2021-10-15 01:24:09 +08:00
< pre > cmake --build . --target check-polly< / pre >
2017-07-12 04:37:28 +08:00
2021-10-15 01:24:09 +08:00
< h3 > Using Polly< / h3 >
2017-07-12 04:37:28 +08:00
2021-10-15 01:24:09 +08:00
Suppose that you want to compile a program hello.c using Polly.
To compile it with Polly (in the build folder), you can run:
< pre >
bin/clang -O3 -mllvm -polly hello.c
< / pre >
2011-05-02 15:48:29 +08:00
2016-02-04 00:18:24 +08:00
< h3 > Troubleshooting< / h3 >
2012-03-30 16:18:19 +08:00
2021-10-15 01:24:09 +08:00
< p >
If you run out of memory when building with Ninja, try lowering the concurrency of Ninja (e.g. < code > ninja -j 2 < / code > ).
More tips and tricks to building and using LLVM can be found < a href = "https://llvm.org/docs/GettingStarted.html#common-problems" > here< / a > .
< / p >
2014-04-04 02:12:13 +08:00
2021-10-15 01:24:09 +08:00
< p >
For more information on getting started with Polly and LLVM in general, see LLVM's < a href = "https://llvm.org/docs/GettingStarted.html" > getting started docs< / a > .
< / p >
2014-04-04 02:12:13 +08:00
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 >