Install ns3-dev through bake on Ubuntu

Bake is an open source integration tool implemented in Python and it is used to automate the build of a number of projects which depend on each other.

First, install ns3 dependencies:

sudo apt-get install gcc g++ python python-dev mercurial gdb valgrind gsl-bin libgsl0-dev flex bison tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev vtun lxc uncrustify doxygen graphviz imagemagick texlive texlive-latex-extra texlive-generic-extra texlive-generic-recommended python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev

Now, download bake and check the dependencies:

mkdir ns3
cd ns3
hg clone http://code.nsnam.org/bake
cd bake
python bake.py check

 > Python - OK
 > GNU C++ compiler - OK
 > Mercurial - OK
 > CVS - is missing
 > GIT - OK
 > Bazaar - is missing
 > Tar tool - OK
 > Unzip tool - OK
 > Unrar tool - is missing
 > 7z  data compression utility - is missing
 > XZ data compression utility - OK
 > Make - OK
 > cMake - is missing
 > patch tool - OK
 > autoreconf tool - is missing

sudo apt-get install cvs unrar p7zip-full cmake dh-autoreconf bzr

Now, we configure our system to install ns-3-dev. By the way, you can choose ns-3.25.

./bake.py configure -e ns-3-dev
./bake.py show

-- System Dependencies --
 > g++ - OK
 > pygoocanvas - Missing
   >> The pygoocanvas is not installed, try to install it.
   >> Try: "sudo apt-get install python-pygoocanvas", if you have sudo rights.
 > pygraphviz - Missing
   >> The pygraphviz is not installed, try to install it.
   >> Try: "sudo apt-get install python-pygraphviz", if you have sudo rights.
 > python-dev - OK
 > qt4 - Missing
   >> Didn't find:   QT 4, download and install it from http://qt.nokia.com/downloads/
   >> Try: "sudo apt-get install qt4-dev-tools libqt4-dev", if you have sudo rights.
 > setuptools - Missing
   >> The python-setuptools package is not installed, try to install it.
   >> Try: "sudo apt-get install python-setuptools", if you have sudo rights.

sudo apt-get install python-pygraphviz qt4-dev-tools libqt4-dev python-setuptools

> pygraphviz - Missing
   >> The pygraphviz is not installed, try to install it.
   >> Try: "sudo apt-get install python-pygraphviz", if you have sudo rights.

To fix pygraphviz, I read in several blogs that the solution is:

sudo apt-get install  python-pip python-virtualenv graphviz-dev graphviz libgraphviz-dev pkg-config

but, I don't know why bake not recognize pygraphviz on the system. By the way, pygraphviz is not essential for ns3.
Now proceed to download ns3 files and compile them:

./bake.py download -vvv
./bake.py build -vvv

Now test your first simulation on ns3:

cd source/ns-3-dev
./waf --run first

Comments

Popular posts from this blog

Exception: Could not find a default OpenFlow controller in Mininet

How to fix Android when developer options are not available for this user

v4l2: open /dev/video0: Permission denied