Wednesday, July 2, 2008

Install NS-2.31 on Ubuntu 8.04

Hello everyone... I have done my installation using console mode on my Ubuntu 8.04. Of course your PC should connect to internet to download the source file and update some part of Ubuntu, here are the basic steps of the installation :

  • Download ns-allinone-2.31 from sourceforge.net
$wget http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.31.tar.gz

  • Un-tar the source file
$tar -xzfv ns-allinone-2.31.tar.gz
  • Install build-essential, autoconf, automake & libxmu-dev
$sudo apt-get install build-essential autoconf automake libxmu-dev
  • Run installation by using this script below. User should in ns-allinone-2.31 directory of ns-allinone
$./install



  • Setting environment variable
$gedit ~./bashrc

Add this script bellow on your bashrc file (the last line), remember to rename "/home/nra" based on your computer name.

-------------------------------------------------------------------------------------------
# LD_LIBRARY_PATH
OTCL_LIB=/home/nra/ns-allinone-2.31/otcl-1.13 NS2_LIB=/home/nra/ns-allinone-2.31/lib X11_LIB=/usr/X11R6/lib USR_LOCAL_LIB=/usr/local/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_ LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/nra/ns-allinone-2.31/tcl8.4.14/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/nra/ns-allinone-2.31/bin:/home/nra/
ns-allinone-2.31/tcl8.4.14/unix:/home/nra/ns-allinone-2.31/tk8.4.14/unix
NS=/home/nra/ns-allinone-2.31/ns-2.31/
NAM=/home/nra/ns-allinone-2.31/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
----------------------------------------------------------------------------------------------------

Run this script to affect the setting

$source ~./bashrc

  • Test NS2 installation, run this script. If '%' mark appear it mean your installation is complete. If not, you should reboot your system.
$ns
$%
  • Validate NS2. Under directory ns-allinone-2.31/ns-2.31 run this script. It will take several time to complete the validation.
$./validate

Reference : Alkautsarpens

1 comment:

Anonymous said...

hi. i got this error during installation. can u help me?

In file included from linkstate/ls.cc:67:0:
linkstate/ls.h: In instantiation of ‘void LsMap::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: ‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations in dependent base ‘std::map, std::allocator > >’ are not found by unqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’ instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!