[llvm-commits] [polly] r141212 - in /polly/trunk: utils/checkout_cloog.sh utils/get_cloog.sh www/get_started.html www/menu.html.incl
Tobias Grosser
grosser at fim.uni-passau.de
Wed Oct 5 14:10:10 PDT 2011
Author: grosser
Date: Wed Oct 5 16:10:10 2011
New Revision: 141212
URL: http://llvm.org/viewvc/llvm-project?rev=141212&view=rev
Log:
Add a tool to checkout cloog/isl automatically with the correct versions.
The tool is called checkout_cloog.sh. We also update the get_started
documentation to include this tool. An older unfinished tool called
'get_cloog.sh' is removed to avoid confusion.
Added:
polly/trunk/utils/checkout_cloog.sh (with props)
Removed:
polly/trunk/utils/get_cloog.sh
Modified:
polly/trunk/www/get_started.html
polly/trunk/www/menu.html.incl
Added: polly/trunk/utils/checkout_cloog.sh
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/utils/checkout_cloog.sh?rev=141212&view=auto
==============================================================================
--- polly/trunk/utils/checkout_cloog.sh (added)
+++ polly/trunk/utils/checkout_cloog.sh Wed Oct 5 16:10:10 2011
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+CLOOG_HASH="cloog-0.16.3"
+ISL_HASH="cd1939ed06617d00159e8e51b72a804b467e98b4"
+
+check_command_line() {
+ if [ "${1}x" = "x" ] || [ "${2}x" != "x" ]
+ then
+ echo "Usage: " ${0} '<Directory to checkout CLooG>'
+ else
+ CLOOG_DIR="${1}"
+ fi
+}
+
+check_cloog_directory() {
+ if not [ -e ${CLOOG_DIR} ]
+ then
+ echo :: Directory "'${CLOOG_DIR}'" does not exists. Trying to create it.
+ if not mkdir -p "${CLOOG_DIR}"
+ then exit 1
+ fi
+ fi
+
+ if not [ -d ${CLOOG_DIR} ]
+ then
+ echo "'${CLOOG_DIR}'" is not a directory
+ exit 1
+ fi
+
+ if not [ -e "${CLOOG_DIR}/.git" ]
+ then
+ IS_GIT=0
+ echo ":: No git checkout found"
+ if [ `ls -A ${CLOOG_DIR}` ]
+ then
+ echo but directory "'${CLOOG_DIR}'" contains files
+ exit 1
+ fi
+ else
+ echo ":: Existing git repo found"
+ IS_GIT=1
+ fi
+}
+
+complain() {
+ echo "$@"
+ exit 1
+}
+
+run() {
+ $cmdPre $*
+ if [ $? != 0 ]
+ then
+ complain $* failed
+ fi
+}
+
+check_command_line $@
+check_cloog_directory
+
+cd ${CLOOG_DIR}
+
+
+
+
+if [ ${IS_GIT} -eq 0 ]
+then
+ echo :: Performing initial checkout
+ run git clone git://repo.or.cz/cloog.git .
+ run git submodule init
+ run git submodule update
+fi
+
+echo :: Fetch versions required by Polly
+run git remote update
+run git reset --hard "${CLOOG_HASH}"
+run cd isl
+run git remote update
+run git reset --hard "${ISL_HASH}"
+
+echo :: Generating configure
+run ./autogen.sh
+
+echo :: If you install cloog/isl the first time run "'./configure'" followed by
+echo :: "'make'" and "'make install'", otherwise, just call "'make'" and
+echo :: "'make'" install.
Propchange: polly/trunk/utils/checkout_cloog.sh
------------------------------------------------------------------------------
svn:executable = *
Removed: polly/trunk/utils/get_cloog.sh
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/utils/get_cloog.sh?rev=141211&view=auto
==============================================================================
--- polly/trunk/utils/get_cloog.sh (original)
+++ polly/trunk/utils/get_cloog.sh (removed)
@@ -1,160 +0,0 @@
-#!/bin/bash
-#
-# get_cloog.sh - retrieve cloog from git repo to current directory, configure, build
-# and install into <destdir>, which defaults to cwd.
-#
-# Basic process is:
-# 1. git clone git://repo.or.cz/cloog.git
-# 2. cd cloog
-# 3. ./get_submodules.sh
-# 4. ./autogen.sh
-# 5. ./configure --prefix=<destdir>
-#
-
-this=$0
-verb=false
-destDir=none
-libGMPDir=/usr
-forceClone=false
-cmdPre=""
-
-usage() {
- echo usage: $this '[--verbose --dry-run --force --gmp=<gmpdir> <install-directory>]'
- echo 'where: <install-directory> must exist, defaults to cwd'
- echo ' <gmpdir>: path to GMP library, defaults to /usr'
- exit $1
-}
-
-vsay() {
- if [[ $verb = true ]] ; then
- echo "$@"
- fi
-}
-
-complain() {
- echo "$@"
- exit 1
-}
-
-# Function to make a directory including its ancestors.
-makedir() {
- if [[ $1 == "" ]] ; then
- :
- elif [[ -d $1 ]] ; then
- :
- else
- makedirtmp=`dirname "$1"`
- makedir "$makedirtmp"
- vsay "$this: Making directory $1"
- if mkdir "$1" ; then
- :
- else
- complain "$this: mkdir $1 failed"
- fi
- fi
-}
-
-# echo/run command line, complain if it fails.
-runCmd() {
- $cmdPre $*
- if [[ $? != 0 ]] ; then
- complain $* failed
- fi
-}
-
-ACTUAL_PWD=`pwd`
-ROOT=${PWD:-$ACTUAL_PWD}
-vsay $this: Polylibs root is $ROOT.
-
-while [[ $# != 0 ]] ; do
- tmp=`echo $1 | sed -e 's;^[-]*;;g'`
- if [[ $tmp == $1 ]] ; then
- if [[ $destDir == none ]] ; then
- destDir=$tmp
- fi
- else
- switchArg=`echo $tmp | cut -s -d= -f2`
- if [[ $switchArg != "" ]] ; then
- tmp=`echo $tmp | cut -d= -f1`
- fi
- case $tmp in
- dry-run)
- cmdPre=echo
- ;;
- force)
- forceClone=true
- ;;
- gmp)
- if [[ $switchArg == "" ]] ; then
- echo "$this: --gmp requires a pathname argument"
- usage 1
- fi
- libGMPDir=$switchArg
- ;;
- help)
- usage 0
- ;;
- verbose)
- verb=true
- ;;
- *)
- usage 1
- ;;
- esac
- fi
- shift
-done
-
-if [[ $destDir == none ]] ; then
- destDir=$ACTUAL_PWD
-else
- # Create specified install directory if it doesn't exist.
- makedir $destDir
-fi
-
-destDir=`(cd $destDir ; echo $PWD)`
-
-if [[ ! -d $libGMPDir ]] ; then
- complain GMP dir $libGMPDIR not found.
-fi
-if [[ ! -f $libGMPDir/include/gmp.h ]] ; then
- complain $libGMPDir does not appear to contain a GMP library.
-fi
-
-# Check for libtoolize, required by cloog/autogen.sh
-tmp=`which libtoolize`
-if [[ $tmp == "" ]] ; then
- complain libtoolize '(needed by cloog/autogen.sh)' not found
-fi
-
-# 1. Get cloog, remove existing cloog tree if forcing.
-if [[ $forceClone == true ]] ; then
- vsay removing existing cloog tree
- rm -rf ./cloog
-fi
-
-# Allow reuse of existing cloog tree.
-if [[ ! -d cloog ]] ; then
- vsay cloning git repo into $ROOT/cloog
- runCmd git clone git://repo.or.cz/cloog.git
-else
- vsay using existing cloog tree: $ROOT/cloog
-fi
-
-runCmd cd cloog
-
-# 2. Get bundled isl library
-runCmd ./get_submodules.sh
-
-# 3. Generate configure scripts for cloog and isl
-runCmd ./autogen.sh
-
-configArgs="--without-polylib --with-isl=bundled"
-configArgs="$configArgs --with-gmp-prefix=$libGMPDir --prefix=$destDir"
-
-# 4. Configure cloog and isl
-runCmd ./configure $configArgs
-
-exit 0
-
-
Modified: polly/trunk/www/get_started.html
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/www/get_started.html?rev=141212&r1=141211&r2=141212&view=diff
==============================================================================
--- polly/trunk/www/get_started.html (original)
+++ polly/trunk/www/get_started.html Wed Oct 5 16:10:10 2011
@@ -15,47 +15,69 @@
<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 in an
+official a 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 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>
-The following prerequisites can be installed through the package management
+<h3> libgmp </h3>
+Install libgmp (library + developer package) through the package management
system of your operating system.
-<ul>
-<li>libgmp (library + developer package)</li>
-</ul>
+<h3> CLooG/isl</h3>
-<h3> Install ISL / CLooG libraries </h3>
+Polly is tested and works with <a href="http://www.cloog.org">CLooG</a> as of
+commit 225c2ed62fe37a4db22bf4b95c3731dab1a50dde
+and <a href="http://repo.or.cz/w/isl.git">isl</a> as of
+commit cd1939ed06617d00159e8e51b72a804b467e98b4. To get and install the
+relevant cloog version use the following commands:
-Polly requires the latest versions of <a href="http://www.cloog.org">CLooG</a>
-and <a href="http://repo.or.cz/w/isl.git">isl</a> checked out at
-commit cd1939ed06617d00159e8e51b72a804b467e98b4.
+<h4>Set the directory layout:</h4>
+<pre>
+export CLOOG_SRC=${BASE}/cloog_src
+export CLOOG_INSTALL=${LLVM_SRC}/cloog_install
+</pre>
<h4> First installation</h4>
<pre>
-git clone git://repo.or.cz/cloog.git
-cd cloog
-git checkout cloog-0.16.3
-./get_submodules.sh
-cd isl
-git remote update
-git checkout cd1939ed06617d00159e8e51b72a804b467e98b4
-cd ..
-./autogen.sh
-./configure --with-gmp-prefix=/path/to/gmp/installation --prefix=/path/to/cloog/installation
+${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC}
+${POLLY_SRC}/configure --prefix=${CLOOG_INSTALL}
make
make install
</pre>
-<h4> Update an earlier installation</h4>
+<h4> Update the installation</h4>
+
+Updating CLooG may become necessary, if Polly uses a feature
+only available in a recent version of CLooG.
<pre>
-cd cloog
-git remote update
-git checkout cloog-0.16.3
-cd isl
-git remote update
-git checkout cd1939ed06617d00159e8e51b72a804b467e98b4
-cd ..
+${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC}
make
make install
</pre>
@@ -94,59 +116,30 @@
make && make install
</pre>
-<h2 id="source"> Get the code </h2>
-
-<p>
-The Polly source code is available in the LLVM SVN repository. For convenience
-we also provide a git mirror. To build Polly we extract its source code into the
-<em>tools</em> directory of the llvm sources.</p>
-<b>A recent LLVM checkout is needed. Older versions may not work!</b>
-
-<h3>SVN</h3>
-<pre>
-export LLVM_SRC=`pwd`/llvm
-svn checkout http://llvm.org/svn/llvm-project/llvm/trunk ${LLVM_SRC}
-cd ${LLVM_SRC}/tools
-svn checkout http://llvm.org/svn/llvm-project/polly/trunk polly
-</pre>
-<h3>GIT</h3>
-<pre>
-export LLVM_SRC=`pwd`/llvm
-git clone http://llvm.org/git/llvm.git ${LLVM_SRC}
-cd ${LLVM_SRC}/tools
-git clone http://llvm.org/git/polly.git
-</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'.
-<h3>CMake</h3>
-
+<h4>Set the directory layout:</h4>
<pre>
-mkdir build
-cd build
-cmake ${LLVM_SRC}
-
-# If CMAKE cannot find CLooG and ISL
-cmake -DCMAKE_PREFIX_PATH=/cloog/installation .
+export LLVM_BUILD=${BASE}/llvm_build
+mkdir ${LLVM_BUILD}
+cd ${LLVM_BUILD}
+</pre>
-# To point CMAKE to the scoplib source
-cmake -DCMAKE_PREFIX_PATH=/scoplib/installation .
+<h4>CMake</h4>
+<pre>
+cmake -DCMAKE_PREFIX_PATH=${CLOOG_INSTALL} ${LLVM_SRC}
make
</pre>
-<h3> Autoconf </h2>
+<h4> Autoconf </h4>
<pre>
-mkdir build
-cd build
-${LLVM_SRC}/configure --with-cloog=/cloog/installation --with-isl=/cloog/installation --with-scoplib=/scoplib/installation
+${LLVM_SRC}/configure --with-cloog=${CLOOG_INSTALL} --with-isl=${CLOOG_INSTALL}
make
</pre>
Modified: polly/trunk/www/menu.html.incl
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/www/menu.html.incl?rev=141212&r1=141211&r2=141212&view=diff
==============================================================================
--- polly/trunk/www/menu.html.incl (original)
+++ polly/trunk/www/menu.html.incl Wed Oct 5 16:10:10 2011
@@ -26,9 +26,7 @@
<div class="submenu">
<label>The Code</label>
- <a href="/get_started.html#prerequisites">Prerequisites</a>
- <a href="/get_started.html#source">Download</a>
- <a href="/get_started.html#build">Build</a>
+ <a href="/get_started.html>Get and Install</a>
<a href="http://llvm.org/viewvc/llvm-project/polly/trunk/">
Browse (ViewVC)
</a>
More information about the llvm-commits
mailing list