-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
82 lines (61 loc) · 1.11 KB
/
build.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
#Check dependencies
tput setaf 4
echo "Checking dependencies..."
tput sgr0
#RScript
sudo apt-get install r-base
#tshark
sudo apt-get install tshark
#Qt
sudo apt-get install libqt4-dev
#Qmake
sudo apt-get install qt4-qmake
nprocs=`grep -c "^processor" /proc/cpuinfo`
#Build ns3
cd NS3
./waf -d optimized --disable-examples --disable-tests configure
./waf
if [ $? != 0 ]
then
tput setaf 1
echo "Error, couldn't build ns3!"
tput sgr0
return 1
else
tput setaf 2
echo "ns3 built succesfully."
tput setaf 4
echo "Building the NVE simulation tool..."
tput sgr0
fi
cd ..
#Build the NVE_simulation tool
qmake
make clean
if [ $? != 0 ]
then
tput setaf 1
echo "Error, couldn't build the simulation tool!"
tput sgr0
return 1
fi
if [ $? != 0 ]
then
tput setaf 1
echo "Error, couldn't build the simulation tool!"
tput sgr0
return 1
fi
make -j $nprocs
if [ $? != 0 ]
then
tput setaf 1
echo "Error, couldn't build the simulation tool!"
tput sgr0
return 1
else
tput setaf 2
echo "Build has finished succesully."
tput sgr0
fi
return 0