sudo apt-get update
sudo apt-get upgrade -y
Download NS2-all-in-one from website
http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download
Then extract and type ./install
Found Problem while installing: X11/Xutil.h: No such file or directory:
→Sol:
sudo apt-get install libx11-dev -y
retry install
Found Problem while installing: otcl-1.14 configuration failed! Exiting ...
→Sol:(?)
Found Problem while installing: ...use ‘this->erase’ instead...
→Sol:(ref)
goto ./ns-2.35/linkstate/ls.h line 137
change
void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
to
void eraseAll() {
this->
erase(baseMap::begin(), baseMap::end()); }
If you see the following figure,the installation has done.(YEAH~~~)
And for safety,let's validate the installation
Error happened...
I need to install gcc-4.4 for compiling
but now gcc-4.4 is not provided from the list
so you need to add url manually
sudo vim /etc/apt/sources.list
deb http://dk.archive.ubuntu.com/ubuntu/ trusty main universe
deb http://dk.archive.ubuntu.com/ubuntu/ trusty-updates main universe
sudo apt-get update
sudo apt-get install gcc-4.4 g++-4.4
add environment variables:
# LD_LIBRARY_PATH
OTCL_LIB=/home/john/ns-allinone-2.35/otcl-1.14
NS2_LIB=/home/john/ns-allinone-2.35/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/john/ns-allinone-2.35/tcl8.5.10/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/john/ns-allinone-2.35/bin:/home/john/ns-allinone-2.35/tcl8.5.10/unix:/home/john/ns-allinone-2.35/tk8.5.10/unix
#the above two lines beginning from xgraph and ending with unix should come on the same line
NS=/home/john/ns-allinone-2.35/ns-2.35/
NAM=/home/john/ns-allinone-2.35/nam-1.15/
PATH=$PATH:$XGRAPH:$NS:$NAM
Found Problem in validation: ...Can't locate getopts.pl in @INC (@INC contains:...
→Sol:
sudo apt-get install libperl4-corelibs-perl
Another reference:
Someone's blog
install gcc-4.4
getopts.pl
Installaiton