Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a script for install ns3
[simgrid.git] / buildtools / pipol / install_ns3.sh
1 #Need python python-dev
2 sudo apt-get install python python-dev
3         
4 SYSTEM=`uname`
5 if [ $SYSTEM = Linux ] ; then
6         if [ x$1 != x ]  ; then
7                 prefix=$1;
8         fi
9         
10         if [ -e $prefix ] ; then
11                 echo -n ""
12         else    
13                 echo "Creating directory $prefix"
14                 mkdir -p $prefix;
15         fi
16         
17         if [ -e $prefix/lib ] ; then
18                 echo -n ""
19         else    
20                 echo "Creating directory $prefix/lib"
21                 mkdir -p $prefix/lib;
22         fi
23         
24         if [ -e $prefix/include/ns3 ] ; then
25                 echo -n ""
26         else    
27                 echo "Creating directory $prefix/include/ns3"
28                 mkdir -p $prefix/include/ns3;
29         fi
30         
31         if [ -e $prefix/doc/html ] ; then
32                 echo -n ""
33         else    
34                 echo "Creating directory $prefix/doc/html"
35                 mkdir -p $prefix/doc/html;
36         fi
37         
38         localdir=`pwd`
39         cd $prefix
40         prefix=`pwd`
41         cd $localdir
42         echo "Install to prefix = $prefix"
43         
44         echo "Downloading NS3"
45         wget http://ns-3.googlecode.com/files/ns-allinone-3.10.tar.bz2
46         
47         echo "Uncompressing package";
48         tar -xvjf ns-allinone-3.10.tar.bz2
49         rm -rf ns-allinone-3.10.tar.bz2
50         cd ns-allinone-3.10/ns-3.10
51         
52         ./waf configure
53         ./waf
54         ./waf --doxygen
55         
56         cp -f build/debug/libns3.so $prefix/lib/libns3.so
57         cp -f build/debug/ns3/* $prefix/include/ns3/
58         cp -f doc/html/* $prefix/doc/html/
59 fi