-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
executable file
·175 lines (148 loc) · 4.48 KB
/
setup.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/bin/bash
prefix=$1
threads=$2
current_dir=$(pwd)
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
LIGHTGRAY='\033[0;37m'
DARKGRAY='\033[1;30m'
LIGHTRED='\033[1;31m'
LIGHTGREEN='\033[1;32m'
YELLOW='\033[1;33m'
LIGHTBLUE='\033[1;34m'
LIGHTPURPLE='\033[1;35m'
LIGHTCYAN='\033[1;36m'
WHITE='\033[1;37m'
clang_bin=$prefix/bin/clang
approx_runtime_lib=$prefix/lib/libapprox.so
if [ ! -f $clang_bin ]; then
mkdir -p build_compiler
mkdir -p $prefix
pushd build_compiler
cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DLLVM_CCACHE_BUILD='Off'\
-DCMAKE_EXPORT_COMPILE_COMMANDS='On'\
-DCMAKE_BUILD_TYPE='RelWithDebInfo' \
-DLLVM_FORCE_ENABLE_STATS='On' \
-DLLVM_ENABLE_PROJECTS='clang;openmp' \
-DLLVM_OPTIMIZED_TABLEGEN='On' \
-DCLANG_BUILD_EXAMPLES='On' \
-DBUILD_SHARED_LIBS='On' \
-DLLVM_ENABLE_ASSERTIONS='On' \
../llvm
ninja -j $threads
ninja -j $threads install
popd
echo "#!/bin/bash" > hpac_env.sh
echo "export PATH=$prefix/bin/:\$PATH" >> hpac_env.sh
echo "export LD_LIBRARY_PATH=$prefix/lib/:\$LD_LIBRARY_PATH" >> hpac_env.sh
echo "export CC=clang" >> hpac_env.sh
echo "export CPP=clang++" >> hpac_env.sh
fi
source hpac_env.sh
if [ ! -f $approx_runtime_lib ]; then
mkdir build_hpac
pushd build_hpac
CC=clang CPP=clang++ cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${current_dir}/clang/ \
-DPACKAGE_VERSION=15.0.0git \
../approx
ninja -j $threads
ninja -j $threads install
popd
fi
pushd ./approx/approx_utilities/
if [ ! -f 'original_src.tar.gz' ]; then
wget -O original_src.tar.gz 'https://www.dropbox.com/s/pj11naf3twdrv23/original_src.tar.gz?dl=0'
fi
if [ ! -d 'original_src' ]; then
tar -xvf original_src.tar.gz
fi
printf "${RED}Creating Benchmarks${NOCOLOR}\n"
if [ ! -d benchmarks/blackscholes ]; then
cp -r original_src/parsec-3.0/pkgs/apps/blackscholes/src/ benchmarks/blackscholes
printf "${GREEN}Blackscholes${NOCOLOR}\n"
pushd benchmarks/blackscholes
patch -p1 < ../patches/blackscholes.patch
popd
fi
if [ ! -d benchmarks/HPCCG ]; then
printf "${GREEN}HPCCG${NOCOLOR}\n"
cp -r original_src/HPCCG benchmarks/HPCCG
pushd benchmarks/HPCCG
patch -p1 < ../patches/HPCCG.patch
popd
fi
if [ ! -d benchmarks/cfd ]; then
printf "${GREEN}CFD${NOCOLOR}\n"
cp -r original_src/rodinia_3.1/openmp/cfd/ benchmarks/cfd
pushd benchmarks/cfd
patch -p1 < ../patches/euler.patch
popd
fi
if [ ! -d benchmarks/kmeans ]; then
printf "${GREEN}K-Means${NOCOLOR}\n"
cp -r original_src/rodinia_3.1/openmp/kmeans/kmeans_openmp/ benchmarks/kmeans/
pushd benchmarks/kmeans
patch -p1 < ../patches/kmeans.patch
popd
fi
if [ ! -d benchmarks/lavaMD ]; then
printf "${GREEN}lavaMD${NOCOLOR}\n"
cp -r original_src/rodinia_3.1/openmp/lavaMD/ benchmarks/
pushd benchmarks/lavaMD
patch -p1 < ../patches/lavaMD.patch
popd
fi
if [ ! -d benchmarks/particlefilter ]; then
printf "${GREEN}Particle Filter${NOCOLOR}\n"
cp -r original_src/rodinia_3.1/openmp/particlefilter/ benchmarks/particlefilter
pushd benchmarks/particlefilter
patch -p1 < ../patches/particlefilter.patch
popd
fi
if [ ! -d benchmarks/lulesh ]; then
printf "${GREEN} Lulesh ${NOCOLOR}\n"
cp -r original_src/LULESH/ benchmarks/lulesh/
pushd benchmarks/lulesh
patch -p1 < ../patches/lulesh.patch
popd
fi
if [ ! -d benchmarks/leukocyte ]; then
printf "${GREEN}Leukocyte ${NOCOLOR}\n"
cp -r original_src/rodinia_3.1/openmp/leukocyte/ benchmarks/leukocyte
pushd benchmarks/leukocyte
patch -p1 < ../patches/leukocyte.patch
popd
fi
printf "${RED} Patched all benchmarks${NOCOLOR}\n"
printf "${GREEN} Copying Inputs${NOCOLOR}"
if [ ! -f benchmarks/blackscholes/random_input.bin ]; then
printf "${RED} copying blackscholes ${NOCOLOR}\n"
cp original_src/inputs/random_input.bin benchmarks/blackscholes
fi
if [ ! -f benchmarks/kmeans/kdd_bin ]; then
printf "${RED} copying kdd_bin ${NOCOLOR}\n"
cp original_src/inputs/kdd_bin benchmarks/kmeans
fi
if [ ! -f benchmarks/leukocyte/testfile.avi ]; then
printf "${RED} copying leukocyte ${NOCOLOR}\n"
cp original_src/inputs/testfile.avi benchmarks/leukocyte
fi
if [ ! -f benchmarks/cfd/fvcorr.domn.097K ]; then
printf "${RED} copying cfd ${NOCOLOR}\n"
cp original_src/rodinia_3.1/data/cfd/fvcorr.domn.097K benchmarks/cfd/
fi
printf "${GREEN} Creating Approximate search space${NOCOLOR}\n"
mkdir -p build
pushd build
cmake ../
make -j
popd