-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathactive_harmony.sh
55 lines (51 loc) · 1.55 KB
/
active_harmony.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
function prepare_ah()
{
mkdir -p ${BASE_PATH}/source
cd ${BASE_PATH}/source
if [ ! -f ah-4.5.tar.gz ]
then
echo -n "Downloading active harmony ..."
wget -q http://www.dyninst.org/sites/default/files/downloads/harmony/ah-4.5.tar.gz
echo "done"
else
echo "Downloading active harmony ...done"
fi
if [ ! -d activeharmony-4.5 ]
then
echo -n "Unpacking active harmony ..."
tar xf ah-4.5.tar.gz
echo "done"
else
echo "Unpacking active harmony ...done"
fi
cd ${BASE_PATH}
}
function make_ah()
{
mkdir -p $BASE_PATH/source/activeharmony-4.5-$1
cp -r $BASE_PATH/source/activeharmony-4.5/* $BASE_PATH/source/activeharmony-4.5-$1/
cd $BASE_PATH/source/activeharmony-4.5-$1
TMP_LOG=$BASE_PATH/source/activeharmony-4.5-$1/$$.log
echo -n "Building active harmony ..."
make -j8 MPICC=mpicc_disabled CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" &> $TMP_LOG
if [ $? != 0 ]
then
echo "failed"
tail -n 100 $TMP_LOG
exit 1
fi
echo "done"
echo -n "Installing active harmony ..."
if [ ! -f $BASE_PATH/packages/$1/lib/libharmony.a ]
then
make -j8 MPICC=mpicc_disabled CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" PREFIX=$BASE_PATH/packages/$1 install &> $TMP_LOG
if [ $? != 0 ]
then
echo "failed"
tail -n 100 $TMP_LOG
exit 1
fi
fi
echo "done"
cd $BASE_PATH
}