Installation of ns2 in RedHat Linux

Installing ns2.27 in RedHat Linux
  • tar -xzf *
  • ./install
  • change .bash_profile and add some environment variables. put

/home/admin/ns-allinone-2.27/bin:/home/admin/ns-allinone 2.27/tcl8.4.5/unix:/home/admin/ns-allinone-2.27/tk8.4.5/unix
into your PATH environment; so that you’ll be able to run
itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:
  • You MUST put /home/admin/ns-allinone-2.27/otcl-1.8, /home/admin/ns-allinone- 2.27/lib, into your LD_LIBRARY_PATH environment variable. 

    You MUST put /home/admin/ns-allinone-2.27/otcl-1.8, /home/admin/ns-allinone- 2.27/lib, into your LD_LIBRARY_PATH environment variable.

  • You MUST put /home/admin/ns-allinone-2.27/tcl8.4.5/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.
  • [OPTIONAL] To save disk space, you can now delete directories tcl8.4.5 and tk8.4.5. They are now installed under /home/admin/ns-allinone-2.27/{bin,include,lib}
  • so, finally the bash_profile is like this

    PATH=$PATH:$HOME/bin:/home/admin/ns2/ns-allinone- 2.27/bin:/home/admin/ns2/ns-allinone-2.27/tcl8.4.5/unix:/home/admin/ns2/ns-allinone-2.27/tk8.4.5/unix

    export LD_LIBRARY_PATH=/home/admin/ns2/ns-allinone-2.27/otcl-1.8:home/admin/ns2/ns-allinone-2.27/lib

    export TCL_LIBRARY=/home/admin/ns2/ns-allinone-2.27/tcl8.4.5/library

  • cd ns-2.27; ./validate
  • Note: The ns installation needs x-develop package. Otherwise, it will fail to build TCL TK