ns2 installation in Ubuntu 18.04
Unlike earlier version of ubuntu, the 18,04 version does not support the direct installation of ns2, because of the latest C/C++ compiler (7.x), but the latest C/C++ compiler supported by ns2 is gcc-4.8. So this post and video tells you about the installation of gcc-4.8 version, then ns2 and then configuration.
Here are the steps, Please follow the video given below for more information.
$] tar zxvf ns-allinone-2.35.tar.gz
$] sudo apt install gcc-4.8 g++-4.8
if you have installed ubuntu just now, you can try these commands also in the beginning
$] sudo apt update
$] sudo apt install build-essential autoconf automake libxmu-dev
$] cd ns-allinone-2.35/ns-2.35
$] gedit Makefile.in
$] gedit linkstate/ls.h
line number 137, change erase to this->erase
$] cd ..
$] ./install
export PATH=$PATH:/home/pradeepkumar/ns-allinone-2.35/bin:/home/pradeepkumar/ns-allinone-2.35/tcl8.5.10/unix:/home/pradeepkumar/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/pradeepkumar/ns-allinone-2.35/otcl-1.14:/home/pradeepkumar/ns-allinone-2.35/lib
Subscribe to my Youtube Channel
Unlike earlier version of ubuntu, the 18,04 version does not support the direct installation of ns2, because of the latest C/C++ compiler (7.x), but the latest C/C++ compiler supported by ns2 is gcc-4.8. So this post and video tells you about the installation of gcc-4.8 version, then ns2 and then configuration.
Here are the steps, Please follow the video given below for more information.
$] tar zxvf ns-allinone-2.35.tar.gz
$] sudo apt install gcc-4.8 g++-4.8
if you have installed ubuntu just now, you can try these commands also in the beginning
$] sudo apt update
$] sudo apt install build-essential autoconf automake libxmu-dev
$] cd ns-allinone-2.35/ns-2.35
$] gedit Makefile.in
$] gedit linkstate/ls.h
line number 137, change erase to this->erase
$] cd ..
$] ./install
export PATH=$PATH:/home/pradeepkumar/ns-allinone-2.35/bin:/home/pradeepkumar/ns-allinone-2.35/tcl8.5.10/unix:/home/pradeepkumar/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/pradeepkumar/ns-allinone-2.35/otcl-1.14:/home/pradeepkumar/ns-allinone-2.35/lib
Subscribe to my Youtube Channel
Installation of ns2 in Ubuntu 18.04
T S Pradeep Kumar
Great job for publishing such a nice article about Installation of ns2 in Ubuntu and found useful awk command oneliner here. Hope it useful for other users.
ReplyDeleteCome on man ... you can do this .. just 2 lines ....
ReplyDeletehttps://www.geeksforgeeks.org/basics-of-ns2-and-otcltcl-script/
when i m installing ns2 it give some text fail
ReplyDeletesudo apt-get install ns2
ReplyDelete(type this on the terminal)
and then sudo apt-get install nam
Ns make failed!
ReplyDeleteAfter following all the steps perfectly I am getting this error and I couldn't install ns2. Can you resolve it sir
I have tried all these commands Sir. but unable to install ns2 in my laptop. why? one doubt is that you didn't mention what to edit in the makefile. please answer quickly sir
ReplyDeleteIn the Makefile.in you need to set the
DeletePATH and LD_LIBRARY_PATH Variable.
export PATH=$PATH:/all/the/paths/provided/by/ns2installation
export LD_LIBRARY_PATH=/the/paths/provided/by/nsinstallation