Showing posts with label how to install NS2. Show all posts
Showing posts with label how to install NS2. Show all posts

Thursday, 10 November 2011

Install NS2 in Cygwin

How to Install NS2?
How to install NS2 in Cygwin?
How to install NS2 in Windows?
NS2 installation Problems ?
Environmental Variables in NS2


Installation Steps


  •   Download your Required NS2 verison HERE
  •  Open Cygwin and type "Startxwin.bat" command which will open cygwin server used for running nam and xgraph files.
  •  Place your ns-allinone file to your desired location and extract the file using the command   tar "xvfz ns-allinone-(version).tar.gz" (ex: xvfz ns-allinone-2.33.tar.gz) .it will extract all files to folder ns-allinone-(version_no)
  • Now specify the folder path in cygwin (ex: cd c:/ns-allinone-2.33/)
  • Type ./install
  • Generally, the compilation process will cost about 2 hours (depended on your computer).
  • You may get Errors like OTcl ,Tcl,Ns-2 build failed due to the problem of cygwin package libraries.,you can solve those by installing Required packages through Internet . the procedure is same as installing cygwin . 
  •  Refer to post"INSTALLATION OF CYGWIN ON WINDOWS"
  • You can get   help regarding your error HERE
Setting  Environmental Variables

  • Edit the file “.bashrc” which is a hidden file in your “home/{username}” folder and insert these sentences:
export NS_HOME=`pwd`/ns-allinone-(ns_version_no)
export PATH=$NS_HOME/tcl(tcl_verison_no)/unix:$NS_HOME/tk(version_no)/unix:$NS_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NS_HOME/tcl(version_no)/unix:$NS_HOME/tk(tk_version_no)/unix:$NS_HOME/otcl-(otcl_version_no):$NS_HOME/lib:$LD_LIBRARY_PATH
export TCL_LIBRARY=$NS_HOME/tcl(tcl_version_no)/library

     EX: (Setting  Environmental Variables for ns-2.27)
    
export NS_HOME=`pwd`/ns-allinone-2.27
export PATH=$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/otcl-1.8:$NS_HOME/lib:$LD_LIBRARY_PATH
export TCL_LIBRARY=$NS_HOME/tcl8.4.5/library

  Testing Ns-2
  •   In cygwin go to folder  ~/ns-allinone-(ns2-version_no)/ns-(ns2-version_no)/     ex: ~/ns-allinone-2.33/ns-2.33/
  • Type  ns command [ex:  $ ns]
  • If Installation is success with out any Error you will get  symbol  %   
Thats it Installation of ns-2 in your system is successfull. 
                 Let's start your Research now