Compiling ns-2.1b9a on Ubuntu 8.04 Hardy Heron

Compiling ns-2.1b9a

  1. Install these packages: build-essential gcc-3.3 libpcap-dev libx11-dev libxmu-headers libxt-dev
  2. Download ns-allinone-2.1b9a-gcc32.tar.gz.
  3. Download my patches.
  4. Apply patches 1, 2 and 3.
  5. Run ./install

Adding TENS 1.2 (Optional)

TENS adds many features (like multiple interfaces and directional antenna support) to ns-2. It’s the reason I needed ns-2.1b9a in the first place.

I’ve created a patch that includes all the changes TENS introduces to ns-2, so you don’t need to download TENS.

In the ns-2.1b9a directory:

  1. Apply patches 4 and 5.
  2. Run make clean
  3. Run make depend
  4. Run make

Adding Agent/PBC (Optional)

I needed Agent/PBC for periodic broadcast messages, but Agent/PBC was introduced in ns-2.33. So I copied it from ns-2.33 and made some minor changes to ns-2.1b9a to make Agent/PBC work.

In the ns-2.1b9a directory:

  1. Apply patches 6 and 7.
  2. Run make

Comments

  1. Currently i meet this problem ->

    In file included from diffusion3/lib/nr/nr.cc:27:
    diffusion3/lib/nr/nr.hh:206: error: an explicit specialization must be preceded by 'template '
    diffusion3/lib/nr/nr.hh:221: error: an explicit specialization must be preceded by 'template '
    make: *** [diffusion3/lib/nr/nr.o] Error 1
    Ns make failed!

    Any solution?

    edwin on February 25, 2009 at 12:55
  2. goto the file nr.hh
    line number 206 and 221
    write template before the starting of the function
    and save
    make again

    yogendra on March 18, 2009 at 14:42
  3. Hi. I have problems with building tclcl-1.0b12. The output was:

    http://gist.github.com/327074

    I thought it could be that configure script of tclcl uses gcc to generate the makefile and so gcc would invoke gcc ver 4.2.4. I explicitly changed the configure so that gcc is changed to gcc-3.3 in the makefile. That gave no result. Obviously it wasn’t compiling with the wrong version of gcc. Please help me. Thanks in advance.

    milan on July 7, 2009 at 16:15
  4. Allright, fixed the one with tclcl. Now making ns is outputting this:

    http://gist.github.com/327072

    milan on July 7, 2009 at 18:40
  5. milan, why don’t you try stackoverflow.com for general programming questions?

    I’d love to help with ns2-specific problems, but I think the errors you get aren’t caused by ns2 itself.

    cbg on July 7, 2009 at 20:26
  6. Please help me.

    I do not understand how to apply patches. Because when I apply the patch 1, I am prompted to enter the file to patch. what is it?.
    I do not know what command to apply for this patches and where should put the patches to run them.

    Linda on November 18, 2009 at 17:51
  7. please help me about this problem

    I’ve patched 1,2,3 patch and run ./install
    when it compiles to Otcl three is an error reporting that can’t
    find .configure, but i check my Otcl and there is an .configure
    what i should do to solve this proble
    thanks a lot
    best regards

    http://gist.github.com/327075

    Bobby on January 9, 2010 at 10:39

Leave a Reply