-
Notifications
You must be signed in to change notification settings - Fork 1
/
get-llvm-with-polly.sh
executable file
·70 lines (53 loc) · 1.53 KB
/
get-llvm-with-polly.sh
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
#!/bin/bash
####
# This script obtains and builds a version of LLVM that has
# special extensions for supporting polly transformation
# annotations in the LLVM IR.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
if [ $# -ne 1 ]; then
echo "expected args: <path to empty dir>"
exit 1
fi
############
# prefer using Ninja if available
command -v ninja
if [ $? -eq 0 ]; then
GENERATOR="Ninja"
BUILD_CMD="ninja install"
else
NUM_CPUS=`getconf _NPROCESSORS_ONLN`
GENERATOR="Unix Makefiles"
BUILD_CMD="make install -j${NUM_CPUS}"
fi
echo "WARNING: this script is deprecated. Please consider using vanilla LLVM."
cd $1
#####
# make sure we're in an empty dir
if [ `ls -1A . | wc -l` -ne 0 ]; then
echo "provided directory must be empty!"
exit 1
fi
#####
# get sources
# PULL LLVM
git clone --branch pragma --single-branch https://github.com/Meinersbur/llvm.git src
cd ./src
git reset --hard 87877c50435bba433b7fa261574b7e3c4372ea5a
cd ./tools
## PULL CLANG
git clone --branch pragma --single-branch https://github.com/Meinersbur/clang.git
cd ./clang
git reset --hard 2c565d6149be499a22ae3089eae37b0a07057b15
cd ..
# PULL POLLY
git clone --branch pragma --single-branch https://github.com/Meinersbur/polly.git
cd ./polly
git reset --hard 0abadf4cea38d9f6cf2236588e551ebfdcb80590
cd ..
cd ../..
##################
## configure & build
mkdir build install
cd ./build
cmake -C $DIR/cmake/LLVM.cmake -G "$GENERATOR" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_INSTALL_PREFIX=../install ../src
$BUILD_CMD