forked from PrincetonUniversity/primesim
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_lrp_all.sh
134 lines (103 loc) · 3.09 KB
/
build_lrp_all.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
#cd ..
#This should be run outside the primesim directory.
export LRP=$PWD
echo $LRP
#source "export LRP="$PWD""
if [ ! -d "software" ]; then
echo "create software folder"
mkdir software
fi
cd software
#Open MPI
#curl "https://download.open-mpi.org/release/open-mpi/v3.0/openmpi-3.0.0.tar.gz" --output openmpi-3.0.0.tar.gz
if [ ! -f "openmpi-3.0.0.tar.gz" ]; then
echo "Downloading open mpi"
rm -rf openmpi-3.0.0
wget "https://download.open-mpi.org/release/open-mpi/v3.0/openmpi-3.0.0.tar.gz"
fi
#Install OpenMPI in the path software/ompi
tar -xvf openmpi-3.0.0.tar.gz
cd openmpi-3.0.0
./configure --prefix=${LRP}/software/ompi --enable-mpi-thread-multiple
make && make all install
cd ..
read in1
#Pin###############################
if [ ! -f "pin-2.14-71313-gcc.4.4.7-linux.tar.gz" ]; then
echo "Downloading pin"
rm -rf pin-2.14-71313-gcc.4.4.7-linux
wget "https://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-gcc.4.4.7-linux.tar.gz"
tar -xvf pin-2.14-71313-gcc.4.4.7-linux.tar.gz
fi
#curl "https://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-gcc.4.4.7-linux.tar.gz" --output pin-2.14-71313-gcc.4.4.7-linux
tar -xvf pin-2.14-71313-gcc.4.4.7-linux.tar.gz
cd ..
read in2
#Libxml2
FILE="/usr/include/libxml2"
if [ -d "$FILE" ]; then
echo "$FILE Path (libxml2) exist"
else
echo -n "Do you want to install Libxml2 uisng apt-get(y/n)? "
read answer
#answer="Y"
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo Yes
sudo apt-get install libxml2-dev
else
echo No
fi
fi
if [ ! -d "$FILE" ]; then
echo "ERROR: Please install libxml2 and rerun"
exit 1
fi
#sudo apt-get install libxml2-dev
if [ ! -d "primesim" ]; then
echo "Download primesim"
git clone https://github.com/dananjayamahesh/primesim.git
fi
cd primesim
git checkout dimp
echo $PWD
#cd $LRP/primesim
#Make sure all the paths are correct
#########################################################
#COMMON STEPS from PRIMESIM directory
#source env.sh #Only works with /bin/shh not with /bin/bash
chmod 777 env.sh
source ./env.sh
if [ $? -eq 0 ]; then
echo "Environment is setup"
else
echo "Please check the primesim/env.sh"
exit 1
fi
#Please check your libxml2
echo "Building Prime and LRP"
make -B
if [ $? -eq 0 ]; then
echo "LRP and Primesim build success"
else
echo "LRP and Primesim build fails. Please check all the software dependnecies, primesim/env.sh and run [sh build_primesim.sh]"
exit 1
fi
echo "Building Prime and LRP Finished"
echo "Building Benchmarks"
export PBENCH_PATH="$LRP/pbench/syncbench"
pbench_path=pbench/syncbench
cd pbench/syncbench
make -B
if [ $? -eq 0 ]; then
echo "Benchmark build success"
else
echo "Benchmark build fails"
exit 1
fi
cd ../..
echo "Finished Building Benchmarks: PBench"
echo "Build-Complete"
echo "If no errors You are ready to run the experiments. See README.md inside primesim"
echo "You are in the primesim path. run [sh run_all.sh simple-test]. But before you run make sure all the paths are corerct and exit in the primesim/env.sh file"
#RUN a simple test
#sh run_all.sh simple-test