Installing ns2 on Fedora Core 4

ns2 is a popular, free package for simulating computer networks and protocols, e.g. TCP, satellite links, ad hoc networks, routing protocols.

  1. Download the following packages from the ns2 website and extract them into your working directory. For example in my case /home/sgordon/ns2 is my install directory, therefore all the .tar.gz files are saved in this directory and apply tar xzvf filename.tar.gz on each:
    • tcl8.4.5-src.tar.gz
    • tk8.4.5-src.tar.gz
    • otcl-1.11.tar.gz
    • tclcl-1.17.tar.gz
    • ns-src-2.29.tar.gz
    • nam-src-1.11.tar.gz
    • xgraph-12.1.tar.gz
  2. The X11 development libraries are needed and since they may not be included by default in your installation, download the xorg-x11-devel-6.8.2-21.i386.rpm RPM (e.g. from the pacfic.net.au mirror) and install is the Package Manager.
  3. Install the software in this order: TCL, TK, OTCL, TCLCL, ns2, nam, xgraph. Assuming you are in your working directory (e.g. /home/sgordon/ns2):
    cd tcl8.4.5/unix
    ./configure
    make
    su 
    make install
    exit
    cd ../..
    cd tk8.4.5/unix
    ./configure
    make
    su
    make install
    exit
    cd ../..
    cd otcl-1.11
    ./configure --with-tcl=/home/sgordon/ns2/tcl8.4.5 --with-tk=/home/sgordon/ns2/tk8.4.5
    make
    su
    make install
    /sbin/ldconfig /home/sgordon/ns2/otcl-...
    exit
    cd ..
    cd tclcl-1.17
    ./configure --with-tcl=/home/sgordon/ns2/tcl8.4.5 --with-tk=/home/sgordon/ns2/tk8.4.5
    make
    su
    make install
    
    exit
    cd ..
    cd ns-2.29
    ./configure
    make
    su
    make install
    exit
    ./validate
    cd ..
    cd nam-1.11
    ./configure 
    edit the file agent.h, line 73: replace NULL with 0
    make
    su
    make install
    exit
    cd ..
    cd xgraph-12.1
    ./configure
    make
    su
    make install
    exit
    cd ..
    
  4. The software should now be ready to use.