summaryrefslogtreecommitdiffstats
path: root/polly/www/polly.sh
blob: bf81c06d74be4331214f570d2931a74dbd7da55d (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
#!/bin/bash -xe

export BASE=`pwd`
export LLVM_SRC=${BASE}/llvm
export POLLY_SRC=${LLVM_SRC}/tools/polly
export CLANG_SRC=${LLVM_SRC}/tools/clang
export CLOOG_SRC=${BASE}/cloog_src
export CLOOG_INSTALL=${BASE}/cloog_install
export LLVM_BUILD=${BASE}/llvm_build
export SCOPLIB_DIR=${BASE}/scoplib-0.2.0
export POCC_DIR=${BASE}/pocc-1.0-rc3.1

if [ -e /proc/cpuinfo ]; then
    procs=`cat /proc/cpuinfo | grep processor | wc -l`
else
    procs=1
fi

if ! test -d ${LLVM_SRC}; then
    git clone http://llvm.org/git/llvm.git ${LLVM_SRC}
fi

if ! test -d ${POLLY_SRC}; then
    git clone http://llvm.org/git/polly.git ${POLLY_SRC}
fi

if ! test -d ${POLLY_SRC}; then
    git clone http://llvm.org/git/clang.git ${CLANG_SRC}
fi

${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC}
cd ${CLOOG_SRC}

if ! test -e ${CLOOG_SRC}/config.log; then
    ./configure --prefix=${CLOOG_INSTALL}
fi
make
make install
cd ${BASE}

if ! test -d ${POCC_DIR}; then
    wget http://www.cse.ohio-state.edu/~pouchet/software/pocc/download/pocc-1.0-rc3.1-full.tar.gz
    tar xzf pocc-1.0-rc3.1-full.tar.gz
    cd ${POCC_DIR}
    ./install.sh
    cd ${BASE}
fi
export PATH=${POCC_DIR}/bin:$PATH

if ! test -d ${SCOPLIB_DIR}; then
    wget http://www.cse.ohio-state.edu/~pouchet/software/pocc/download/modules/scoplib-0.2.0.tar.gz
    tar xzf  scoplib-0.2.0.tar.gz
    cd ${SCOPLIB_DIR}
    ./configure --enable-mp-version --prefix=${SCOPLIB_DIR}/usr
    make -j${procs} -l${procs} && make install
fi

mkdir -p ${LLVM_BUILD}
cd ${LLVM_BUILD}

if which cmake ; then
    cmake -DCMAKE_PREFIX_PATH=${CLOOG_INSTALL} ${LLVM_SRC}
    make -j$procs -l$procs
    make polly-test
else
    ${LLVM_SRC}/configure --with-cloog=${CLOOG_INSTALL} --with-isl=${CLOOG_INSTALL}
    make -j$procs -l$procs
    make polly-test -C tools/polly/test/
fi
OpenPOWER on IntegriCloud