sharethis:
The ns2 version taken here is 2.31, if you downloaded any other version, please modify your version during installation
1)Uncompress the ns2
tar zxvf ns-allinone-2.31.tar.gz
or
gzip -d ns-allinone-2.31.tar.gz
tar xvf ns-allinone-2.31.tar
2) cd /opt/ns-allinone-2.31 (since /opt is the folder which is unused, so i have selected that folder to install, however you can install that in any folder)
3) ./install (execute the command)
4) If the installation fails in the middle, then try to install the linux packages that are
necessary to run NS2. (In any linux (ubuntu or fedora or redhat or suse), install the TCL/TK, Perl packages during the installation of linux...)
Common errors
While installing ns2, sometimes we get errors some of them are mentioned below (as keywords used to search). Apart from these errors there are many other types of errors also which occurs.
- tcl8.4.18 make failed! exiting…
- tk8.4.18 make failed!
- make: *** [tk3d.o] error 1 tk8.4.18 make
- tk8.4.18 make fail
Here are some steps and precautions to install ns2 in one shot.
- Always install your linux distro with full programming support, this will help you to install ns2 more easily, here programming support means support for perl, tcl, gcc etc.
- Also install this packages
install autoconf
install automake
install gcc-c++
install libX11-devel
install xorg-x11-proto-devel
install libXt-devel
install libXmu-devel
Now try installing ns2, hope it should get install properly
5) Once the installation succeeded, then the path information will be provided by the NS2
6) Set the path in the /root/.bash_profile
(vi /root/.bash_profile)
or
If you are a user home//.bash_profile (for example, if your the username is tsp, then execute this command vi /home/tsp/.bash_profile)
7) set the PATH and the LD_LIBRARY_PATH according to the point number 11.
8) logout and login.
9) go to the terminal and try ns or nam
where is point number 11 dude