-
Notifications
You must be signed in to change notification settings - Fork 14
/
compile.sh
executable file
·51 lines (48 loc) · 1.03 KB
/
compile.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
#!/bin/bash
MULTIPIMVERSION=1.0
MULTIPIMPATH="$(pwd)"
PINPATH="$MULTIPIMPATH/pin"
BOOKSIMPATH="$MULTIPIMPATH/common/booksim2/src"
DRAMPOWERPATH="$MULTIPIMPATH/common/DRAMPower/src"
LIBCONFIGPATH="$MULTIPIMPATH/common/libconfig"
# XMLPARSERPATH="$MULTIPIMPATH/common/xmlparser"
NUMCPUS=$(grep -c ^processor /proc/cpuinfo)
NUMCPUS=2
export PINPATH
export LIBCONFIGPATH
export BOOKSIMPATH
export DRAMPOWERPATH
# export XMLPARSERPATH
export MULTIPIMVERSION
#--d, --o, --r, --p
if [ "$1" = "debug" ]
then
BUILDTYPE=--d
elif [ "$1" = "opt" ]
then
BUILDTYPE=--o
fi
if [ "$2" = "clean" ]
then
rm -rf MULTIPIMPATH/build/$1
elif [ "$2" = "MultiPIM" ]
then
echo "Compiling only MultiPIM ..."
scons -j$NUMCPUS $BUILDTYPE
else
echo "Compiling all ..."
cd $DRAMPOWERPATH/../
echo "Compiling DRAMPower ..."
make
cd -
cd $BOOKSIMPATH
echo "Compiling booksim ..."
make
cd -
cd $LIBCONFIGPATH
echo "Compiling libconfig ..."
./configure --prefix=$LIBCONFIGPATH && make install
cd -
echo "Compiling MultiPIM ..."
scons -j$NUMCPUS $BUILDTYPE
fi