Home > NS-3 > Installing NS-3 in Ubuntu 12.04

Installing NS-3 in Ubuntu 12.04

I like to write things down for myself. I am not working with NS-3 these days but if you have more questions, please  refer to the detailed installation guide from the NS website.

If you are reading this post, then I presume you already know what NS-3 is. I have followed the following steps to install and configure NS3 in Ubuntu 12.04.

Open a terminal and run the following commands to install the list of required packages (you may not need all the packages):

sudo apt-get install gcc g++ python              
sudo apt-get install gcc g++ python python-dev
sudo apt-get install mercurial
sudo apt-get install bzr
sudo apt-get install gdb valgrind
sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl
sudo apt-get install flex bison libfl-dev
sudo apt-get install g++-3.4 gcc-3.4
sudo apt-get install tcpdump
sudo apt-get install sqlite sqlite3 libsqlite3-dev
sudo apt-get install libxml2 libxml2-dev
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
sudo apt-get install vtun lxc
sudo apt-get install uncrustify
sudo apt-get install doxygen graphviz imagemagick sudo apt-get install texlive texlive-extra-utils texlive-latex-extra
sudo apt-get install python-sphinx dia
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev
sudo apt-get install libboost-signals-dev libboost-filesystem-dev
sudo apt-get install openmpi*
 

You can either download and build development version or get a tarball directly and untar it.  I would recommend you to choose the second option initially.

Option 1: Using Mercurial

cd
mkdir repos
cd repos
hg clone http://code.nsnam.org/ns-3-allinone

Option 2: Downloading NS-3 using a tarball

cd
mkdir tarballs
cd tarballs wget
http://www.nsnam.org/release/ns-allinone-3.13.tar.bz2
tar xjf ns-allinone-3.13.tar.bz2
 

To build your NS-3, run the following command:

./build.py

Configuration with Waf:

./waf distclean
./waf configure    // (or use this > ./waf configure –enable-examples –enable-tests)
./waf build

Now, test your installation using:

./test.py   // or use this ( if you want to test core modules only) > ./test.py -c core
 

Get ready to run your  program. You need waf (a python based framework designed for configuring, compiling and installing applications). Use the following command to run your program:

./waf – -run filename

Your program must be in /scratch directory, because when you run waf they are build at the same time. For example, I am copying a myfirst.cc from a example directory to scratch directory to run the program. Go to your ns directory and run the command to copy, configure and run:

 
cp examples/tutorial/first.cc scratch/myfirst.cc
./waf
./waf –run scratch/myfirst

If you do everything correctly, you should be able to see the following in your command line.

Waf: Entering directory ‘/home/user/repos/ns-3-allinone/ns-3-dev/build’
Waf: Leaving directory ‘/home/userrepos/ns-3-allinone/ns-3-dev/build’
’build’ finished successfully (1.175s)
Sent 1024 bytes to 10.1.1.2
Received 1024 bytes from 10.1.1.1
Received 1024 bytes from 10.1.1.2

If you have something to visualize run the command : ./waf –run scratch/your_program –visualize, and to plot your output use: ./waf –run scratch/your_program | gnuplot

Cheers 🙂

 
 
 
Advertisements
  1. Cerol
    September 24, 2012 at 10:13 am

    THank you very much for this piece.it almost worked for me apart from this problem “mmcerol@ubuntu:~/repos$ ns-3-allinone/build.py
    ** ERROR: missing .config file; you probably need to run the download.py script first”
    I had run dowload.py file but this error still comes and i have failed to resolve it.I really need your help guys.
    Thank you very much.

    • September 24, 2012 at 7:27 pm

      Hi, It seems like you failed to download the files completely. Re-download the tar files and run the process again.
      Hope this will help.

      Thanks.

  2. Sphinx
    January 14, 2013 at 4:16 pm

    how long it will take for ./build.py

    • January 15, 2013 at 10:26 pm

      You will see lots of compiler output messages when you run build.py… Eventually you should see the following:

      Build finished successfully (00:02:37)
      Leaving directory `./ns-3-dev’

  3. naz diana
    February 19, 2013 at 7:48 am

    Hi, I am a bit confuse here. I’ve downloaded and plan to do NS3 installation using the tarball.

    1. Do I need to run all the sudo commands as u listed in “Open a terminal and run the following commands to install the list of required packages:…………..” ?

    2. Or should I just run “sudo apt-get install gcc g++ python” and then proceed with NS3 tarball installation?
    Thanks in advance for your help.

    • February 19, 2013 at 11:07 pm

      Hi. If you are logged in as root then you don’t have to use sudo. Just install all the dependencies and proceed with NS-3 tarball installation.

      • naz diana
        February 20, 2013 at 12:37 am

        Hi Safiqul, thanks for your reply. When u said “install all the dependencies” does it means I need to install all the pre-requisites packages by running all the 21 commands as above?

        Appreciate your advise.

      • February 20, 2013 at 1:00 am

        Hi again. Yes, Install all the required packages (you may skip some, but I would recommend you to install all of them).

        Good luck 🙂

      • naz diana
        February 20, 2013 at 2:26 am

        thanks 🙂

  4. Jay
    March 11, 2013 at 8:07 pm

    Hi,

    I’m a bit of a novice with linux but need NS3 for university. I have installed the following packages:

    sudo apt-get install gcc g++ python
    sudo apt-get install gcc g++ python python-dev
    sudo apt-get install mercurial
    sudo apt-get install bzr
    sudo apt-get install gdb valgrind
    sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl
    sudo apt-get install flex bison libfl-dev
    sudo apt-get install tcpdump
    sudo apt-get install sqlite sqlite3 libsqlite3-dev
    sudo apt-get install libxml2 libxml2-dev
    sudo apt-get install libgtk2.0-0 libgtk2.0-dev
    sudo apt-get install vtun lxc
    sudo apt-get install uncrustify
    sudo apt-get install doxygen graphviz imagemagick
    sudo apt-get install texlive texlive-extra-utils texlive-latex-extra
    sudo apt-get install python-sphinx dia
    sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev
    sudo apt-get install libboost-signals-dev libboost-filesystem-dev

    But when I run: sudo apt-get install openmpi* I get the following:

    jay@ubuntu:~$ sudo apt-get install openmpi*
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting ‘libmeep-openmpi6’ for regex ‘openmpi*’
    Note, selecting ‘libmeep-openmpi-dev’ for regex ‘openmpi*’
    Note, selecting ‘openmpi1.5-checkpoint’ for regex ‘openmpi*’
    Note, selecting ‘meep-openmpi’ for regex ‘openmpi*’
    Note, selecting ‘openmpipython’ for regex ‘openmpi*’
    Note, selecting ‘yorick-mpy-openmpi’ for regex ‘openmpi*’
    Note, selecting ‘gromacs-openmpi’ for regex ‘openmpi*’
    Note, selecting ‘mpqc-openmpi’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1.3’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-checkpoint’ for regex ‘openmpi*’
    Note, selecting ‘openmpi1.5-bin’ for regex ‘openmpi*’
    Note, selecting ‘openmpi1.5-doc’ for regex ‘openmpi*’
    Note, selecting ‘libhdf5-openmpi-dev’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-libs0’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1.5-2’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-mpidoc’ for regex ‘openmpi*’
    Note, selecting ‘libhdf5-openmpi-1.8.4’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1.5-dbg’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-bin’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-dbg’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1.5-dev’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-dev’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-doc’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-common’ for regex ‘openmpi*’
    Note, selecting ‘openmpi1.5-common’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi-dbg’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi-dev’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi2’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi-dev’ instead of ‘openmpi-dev’
    Note, selecting ‘libopenmpi-dbg’ instead of ‘openmpi-dbg’
    Note, selecting ‘libopenmpi1.3’ instead of ‘openmpi-libs0’
    Note, selecting ‘openmpi-doc’ instead of ‘openmpi-mpidoc’
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    libopenmpi1.5-2 : Conflicts: libopenmpi1.3 but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-libs0
    libopenmpi1.5-dbg : Conflicts: libopenmpi-dbg but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-dbg
    libopenmpi1.5-dev : Conflicts: libopenmpi-dev but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-dev
    openmpi1.5-bin : Conflicts: openmpi-bin but 1.4.3-2.1ubuntu3 is to be installed
    openmpi1.5-checkpoint : Conflicts: openmpi-checkpoint but 1.4.3-2.1ubuntu3 is to be installed
    openmpi1.5-common : Conflicts: openmpi-common but 1.4.3-2.1ubuntu3 is to be installed
    openmpi1.5-doc : Conflicts: openmpi-checkpoint (< 1.5.4-1) but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-doc but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-mpidoc
    E: Unable to correct problems, you have held broken packages.
    jay@ubuntu:~$

    Any ideas on how to fix this? I am running Ubuntu 12.04 within VMware.

    Thanks,

    Jason

    • March 12, 2013 at 12:39 pm

      I’m not sure about this. But, I will let you know if I find something.

  5. Chris
    March 24, 2013 at 6:25 pm

    Hi I got this error when I made the command sudo apt-get install openmpi*

    chris@chris:~$ sudo apt-get install openmpi*
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting ‘libmeep-openmpi6’ for regex ‘openmpi*’
    Note, selecting ‘libmeep-openmpi-dev’ for regex ‘openmpi*’
    Note, selecting ‘openmpi1.5-checkpoint’ for regex ‘openmpi*’
    Note, selecting ‘meep-openmpi’ for regex ‘openmpi*’
    Note, selecting ‘openmpipython’ for regex ‘openmpi*’
    Note, selecting ‘yorick-mpy-openmpi’ for regex ‘openmpi*’
    Note, selecting ‘gromacs-openmpi’ for regex ‘openmpi*’
    Note, selecting ‘mpqc-openmpi’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1.3’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-checkpoint’ for regex ‘openmpi*’
    Note, selecting ‘openmpi1.5-bin’ for regex ‘openmpi*’
    Note, selecting ‘openmpi1.5-doc’ for regex ‘openmpi*’
    Note, selecting ‘libhdf5-openmpi-dev’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-libs0’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1.5-2’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-mpidoc’ for regex ‘openmpi*’
    Note, selecting ‘libhdf5-openmpi-1.8.4’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1.5-dbg’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-bin’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-dbg’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1.5-dev’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-dev’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-doc’ for regex ‘openmpi*’
    Note, selecting ‘openmpi-common’ for regex ‘openmpi*’
    Note, selecting ‘openmpi1.5-common’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi-dbg’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi-dev’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi1’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi2’ for regex ‘openmpi*’
    Note, selecting ‘libopenmpi-dev’ instead of ‘openmpi-dev’
    Note, selecting ‘libopenmpi-dbg’ instead of ‘openmpi-dbg’
    Note, selecting ‘libopenmpi1.3’ instead of ‘openmpi-libs0’
    Note, selecting ‘openmpi-doc’ instead of ‘openmpi-mpidoc’
    libopenmpi1.5-2 is already the newest version.
    libopenmpi1.5-2 set to manually installed.
    openmpi1.5-bin is already the newest version.
    openmpi1.5-bin set to manually installed.
    openmpi1.5-checkpoint is already the newest version.
    openmpi1.5-common is already the newest version.
    openmpi1.5-doc is already the newest version.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    libopenmpi1.5-2 : Conflicts: libopenmpi1.3 but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-libs0
    libopenmpi1.5-dbg : Conflicts: libopenmpi-dbg but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-dbg
    libopenmpi1.5-dev : Conflicts: libopenmpi-dev but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-dev
    openmpi1.5-bin : Conflicts: openmpi-bin but 1.4.3-2.1ubuntu3 is to be installed
    openmpi1.5-checkpoint : Conflicts: openmpi-checkpoint but 1.4.3-2.1ubuntu3 is to be installed
    openmpi1.5-common : Conflicts: openmpi-common but 1.4.3-2.1ubuntu3 is to be installed
    openmpi1.5-doc : Conflicts: openmpi-checkpoint (< 1.5.4-1) but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-doc but 1.4.3-2.1ubuntu3 is to be installed
    Conflicts: openmpi-mpidoc
    E: Unable to correct problems, you have held broken packages.

    Do you know how can this be corrected? Thank you very much.
    I'm using ubuntu 12.04.

  6. Chris
    March 24, 2013 at 6:47 pm

    I tried using sudo aptitude install openmpi* and it showed the following

    chris@chris:~$ sudo aptitude install openmpi*
    Couldn’t find any package whose name or description matched “openmpi*”
    Couldn’t find any package whose name or description matched “openmpi*”
    No packages will be installed, upgraded, or removed.
    0 packages upgraded, 0 newly installed, 0 to remove and 506 not upgraded.
    Need to get 0 B of archives. After unpacking 0 B will be used.

    It seems that this package is not existing but when I searched for it using synaptic package manager i found openmpi1.5. Are these two just the same?

    Thanks.

    • March 25, 2013 at 3:21 pm

      It worked for me. Are you using 64-bit Ubuntu 12.04? I think openmpi1.5 should work.

      You can also try the following:
      sudo apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev

  7. April 27, 2013 at 4:14 pm

    No function –run defined in /home/fixrezzi/tarballs/ns-allinone-3.16/ns-3.16/wscript

    how to fix this?

    • May 1, 2013 at 6:34 pm

      I haven’t worked with NS3 that much, so please refer to the NS-3 website for more details.
      FYI, I followed all the aforementioned steps, and was able to run and visualize properly :(.

  8. Jawad Hussain
    April 30, 2013 at 4:50 pm

    Hi Sir, i’m going through ur wonderful piece of effort but getting a problem 😦
    when i run the command sudo apt-get install g++-3.4 gcc-3.4
    it says unable to locate package g++ and gcc

    any help???

  9. Jawad Hussain
    April 30, 2013 at 4:52 pm

    for all new users, my above question have answer at
    https://groups.google.com/forum/?fromgroups=#!topic/ns-3-users/tS8rOUOhN9Q

    hope the moderator of this page wont mind for any other link given here

  10. Jay
    May 1, 2013 at 10:33 pm

    Hi all,

    the “unable to locate package g++ and gcc” was an issue for me, see above post. My lecturer advised me to use :

    sudo apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev

    I ran the program thereafter regardless of any errors that come up after this stage and I can say that it is actually working fine for me

  11. Riana
    May 6, 2013 at 2:41 am

    Unlike the sudo commands for installing packages, I cannot type ./build.py in the terminal, I run the file ./build.py under ns-3-allinone in terminal and then cannot see the error mesages properly as it goes away. But it says building finished successfully, entering waf but not leaving ns-3-dev. Please let me know how to build ns-3 and do the waf configuration. If I type ./waf –shell, it says no such file or directory.
    Thanks.
    Riana

    • May 6, 2013 at 9:16 am

      Try with the following:

      ./build.py –enable-examples –enable-tests

      Please see http://www.nsnam.org/docs/tutorial/html/getting-started.html for more information.

      • Riana
        May 13, 2013 at 2:20 am

        If I type the following I get :

        “:~/workspace$ ./bake.py configure -e ns-3.17-dev
        bash: ./bake.py: No such file or directory”

        How do I do this?

        “bake works by downloading source packages into a source directory, and installing libraries into a build directory. bake can be run by referencing the binary, but if one chooses to run bake from outside of the directory it was downloaded into, it is advisable to put bake into your path, such as follows (Linux bash shell example):

        export BAKE_HOME=`pwd`/bake
        export PATH=$PATH:$BAKE_HOME
        export PYTHONPATH=$PYTHONPATH:$BAKE_HOME

        However, setting environment variables is not strictly necessary to complete this tutorial, so we’ll call bake directly by specifying the path to it in our shell commands.

        Step into the workspace directory and type the following into your shell:

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

        Next, we’l ask bake to check whether we have enough tools to download various components. Type:”

        thanks.
        riana

  12. nesrine
    November 8, 2013 at 10:24 am

    hi,
    I got this error when i made this command : ./build.py
    Waf: Leaving directory `/home/sahloul/ns-allinone-3.7.1/ns-3.7.1/build’
    Build failed
    -> task failed (err #1):
    {task: cxx map-scheduler.cc -> map-scheduler_1.o}
    -> task failed (err #1):
    {task: cxx time.cc -> time_1.o}
    Traceback (most recent call last):
    File “./build.py”, line 117, in
    sys.exit(main(sys.argv))
    File “./build.py”, line 108, in main
    build_ns3(config)
    File “./build.py”, line 56, in build_ns3
    run_command([“python”, “waf”])
    File “/home/sahloul/ns-allinone-3.7.1/util.py”, line 24, in run_command
    raise CommandError(“Command %r exited with code %i” % (argv, retval))
    util.CommandError: Command [‘python’, ‘waf’] exited with code 1

    thanks
    nesrine

    • November 8, 2013 at 2:41 pm

      HI Nesrine,

      Maybe, you haven’t installed all the required packages.. I am not working with NS-3 anymore, however if you have more questions, please refer to the detailed installation guide.

      /Mithun

  13. nesrine
    November 11, 2013 at 8:07 am

    hi Mithun
    thank you for your response
    i have installed all the required packages and i followed the installation guide step by step
    nesrine

  14. charles u
    November 21, 2013 at 2:06 am

    Pls can sombody help me I am having problem installing ns3,the statement sudo apt-get install g++-3.4 gcc-3.4 is giving me an error message.

  15. abc
    November 30, 2013 at 1:51 pm

    nesrine :
    hi,
    I got this error when i made this command : ./build.py
    Waf: Leaving directory `/home/sahloul/ns-allinone-3.7.1/ns-3.7.1/build’
    Build failed
    -> task failed (err #1):
    {task: cxx map-scheduler.cc -> map-scheduler_1.o}
    -> task failed (err #1):
    {task: cxx time.cc -> time_1.o}
    Traceback (most recent call last):
    File “./build.py”, line 117, in
    sys.exit(main(sys.argv))
    File “./build.py”, line 108, in main
    build_ns3(config)
    File “./build.py”, line 56, in build_ns3
    run_command([“python”, “waf”])
    File “/home/sahloul/ns-allinone-3.7.1/util.py”, line 24, in run_command
    raise CommandError(“Command %r exited with code %i” % (argv, retval))
    util.CommandError: Command [‘python’, ‘waf’] exited with code 1
    thanks
    nesrine

  16. abc
    November 30, 2013 at 1:52 pm

    abc :

    nesrine :
    hi,
    I got this error when i made this command : ./build.py
    Waf: Leaving directory `/home/sahloul/ns-allinone-3.7.1/ns-3.7.1/build’
    Build failed
    -> task failed (err #1):
    {task: cxx map-scheduler.cc -> map-scheduler_1.o}
    -> task failed (err #1):
    {task: cxx time.cc -> time_1.o}
    Traceback (most recent call last):
    File “./build.py”, line 117, in
    sys.exit(main(sys.argv))
    File “./build.py”, line 108, in main
    build_ns3(config)
    File “./build.py”, line 56, in build_ns3
    run_command([“python”, “waf”])
    File “/home/sahloul/ns-allinone-3.7.1/util.py”, line 24, in run_command
    raise CommandError(“Command %r exited with code %i” % (argv, retval))
    util.CommandError: Command [‘python’, ‘waf’] exited with code 1
    thanks
    nesrine

    me too got same problem can any one help me plzzzzzz

  17. savita
    February 11, 2014 at 7:04 pm

    for installing netanim m using make clean cmd..,m getting this error–> make: *** No rule to make target `clean’. Stop.
    If anybody nos abt it plz do reply

  18. Nazrin
    April 22, 2014 at 4:48 pm

    Salam brother, im trying to install this ns3,but i get stuck during the build.py phase. Please help me out. Thank so much. 🙂

    • April 22, 2014 at 4:52 pm

      Hi Nazrin.. I don’t work with ns-3 anymore. Check the official ns-3 page for more information. Also read the previous comments regarding build.py related problems.

  19. wided
    May 13, 2014 at 8:19 am

    hi
    i like to simulate a network architecture but i can’t know haw????
    the installation is finished succesfully with the installation guide step by step

  20. Abhishek
    November 5, 2014 at 8:17 pm

    Respected Sir
    I am a student from Birla Institute of Technology and Science(BITS,Pilani) India. I am working on a project related to Cooperative Caching and I read your blog on installing ns3. It was very helpful. I need to run some simulations to measure cache hit ratio of nodes for my project. I plan to use ns3/ns2 for the same. Could you give me some advice as to how to simulate the caching part so as to measure the cache hit ratios ?
    Yours Sincerely
    Abhishek

    • January 13, 2015 at 12:25 pm

      Sorry for such a late response. Please refer to the detailed installation guide from the NS website.

  21. samad riaz
    November 28, 2014 at 5:59 am

    samad@samad-desktop:~/tarballs$ ./build.py
    bash: ./build.py: No such file or directory

    found this error. can some one guide me why i got errot in build.py ??

  22. sathya
    April 19, 2015 at 7:54 pm

    I followed the steps you have given here… while giving ./build.py command i got some error. build failed. please help me..

    i got this error :

    [ 697/1385] cxx: src/stats/model/packet-data-calculators.cc -> build/src/stats/model/packet-data-calculators.cc.1.o
    Waf: Leaving directory `/home/sathya/sathya/ns3/ns-allinone-3.13/ns-3.13/build’
    Build failed
    -> task failed (exit status 1):
    {task 139943093911696: cxx tap-bridge.cc -> tap-bridge.cc.1.o}
    [‘/usr/bin/g++’, ‘-O0’, ‘-ggdb’, ‘-g3’, ‘-Wall’, ‘-Werror’, ‘-Wno-error=deprecated-declarations’, ‘-fstrict-aliasing’, ‘-Wstrict-aliasing’, ‘-fPIC’, ‘-pthread’, ‘-Ibuild’, ‘-I.’, ‘-DNS3_ASSERT_ENABLE’, ‘-DNS3_LOG_ENABLE’, ‘-DSQLITE3=1’, ‘-DHAVE_IF_TUN_H=1’, ‘-DPYTHONDIR=”/usr/local/lib/python2.7/dist-packages”‘, ‘-DPYTHONARCHDIR=”/usr/local/lib/python2.7/dist-packages”‘, ‘-DHAVE_PYTHON_H=1’, ‘-DENABLE_GSL’, ‘../src/tap-bridge/model/tap-bridge.cc’, ‘-c’, ‘-o’, ‘src/tap-bridge/model/tap-bridge.cc.1.o’]
    Traceback (most recent call last):
    File “./build.py”, line 147, in
    sys.exit(main(sys.argv))
    File “./build.py”, line 138, in main
    build_ns3(config, build_examples, build_tests, args, build_options)
    File “./build.py”, line 61, in build_ns3
    run_command([sys.executable, “waf”, “build”] + build_options)
    File “/home/sathya/sathya/ns3/ns-allinone-3.13/util.py”, line 24, in run_command
    raise CommandError(“Command %r exited with code %i” % (argv, retval))
    util.CommandError: Command [‘/usr/bin/python’, ‘waf’, ‘build’] exited with code 1

    please help me.. i am waiting for your reply…

  23. ulrichjaferson
    June 30, 2015 at 10:02 am

    Good day and thanks forr this very helpfull piece. I would like to know if there is a risk in installing both NS2 and NS3. thanks for your answer.

    • June 30, 2015 at 12:03 pm

      I think you can install both. All the best.

      • ulrichjaferson
        June 30, 2015 at 9:08 pm

        thank you very much.

  24. Ihsan
    March 5, 2016 at 6:45 pm

    Hi,
    Where can we see the .pcap files after running the command
    “./waf –run scratch/myfirst”

  25. Diana
    March 22, 2016 at 7:52 pm

    Hi im trying to build ns3 but when i enter the command ./build.py im having the following error:

    File “waf”, line 159, in
    import waflib.extras.compat15
    ImportError: No module named waflib.extras.compat15

    Appearently the module waf is missing. Can anybody tell me how to fix this?

  1. September 26, 2015 at 11:39 pm
  2. December 4, 2015 at 6:33 am
  3. March 8, 2016 at 4:47 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: