Monday 7 January 2013

How to install Cygwin and NS2 in windows?


[Cygwin]
1.      Download the cygwin.rar.

2.      Decompress the cygwin.rar
 

1.      Click the setup.exe to install cygwin.

2.      Because the language of operating system is Traditional Chinese. The text of button is shown in Chinese. But you don’t need to worry about this. I think it is shown in English in your computer. Just click “Next”.

3.      Then choose “Install from Local Directory”

4.      Click “Next”.
(Just keep the settings as they are.)

5.      Click “Next”

6.      Click “Browse” to choose where the software is. (Please choose “ftp%3a%2f%2fftp.nctu.edu.tw%2fWindows%2fcygwin”)

7.      Click “OK”.

8.      Click “Next” and you will see the figure shown as follows. In this window, the cygwin setup program let you choose what software you want to install.

9.      Click “View” first to make the word “Category “change to “Full”.

10.   XFree86-base, XFree86-bin, XFree86-prog, XFree86-lib, XFree86-etc, make, patch, perl, gcc, gcc-g++, gawk, gnuplot, tar and gzip must be chosen. For example, if I want to install XFree-86 base (upper figure), click the “Skip” of “New” column. The “Skip” will be changed to “4.3.0-1” (lower figure).

11.  Click “Next”.
(Please be patient. It may take a long time to finish the installation.)

12.   When setup is done, it will be shown as following figure. Click “Finish”.
 

13.   Click “OK” to finish the cygwin setup program.

[myNS2 setup]
1.      Click the icon on the desktop.

2.      For the first time execution, it will generate some environment parameter setting files. In this example, smallko is my login name to windows system. Therefore, the cygwin will create a folder named “smallko” under home directory. (The actual path for smallko folder is: c:\cygwin\home\smallko) It should be noticed that the login name can not have any space in your name. For example, “A  B” may cause errors when you install NS2.

3.      Download myNS2.

4.      Decompress the ns-allinone-2.28.rar.

5.      Move this folder under c:\cygwin\home\smallko. (P.S. smallko is my login name)

6.      Open a cygwin window

7.      Change the path to ns-allinone-2.28/ns-2.28

8.      Run the command “./configure; make clean; make

9.      Please be patient. It will take some time to finish the compilation.

10.  When it is done, it should look like as follows.

11.  To make sure that you have successfully installed myNS2, you need to check whether you can find ns.exe under ns-allinone-2.28/ns-2.28

12.  Copy the .bashrc to c:/cygwin/home/smallko
13.  Run the example script to test whether you have setup the path or not.
 

14.   If you see the error message like “ns command not found”, no worry about this. Sometimes even you have setup the path, but it does not work. You can copy the ns.exe (nam.exe) to the same place as the simulation script. Run the simulation with “./ns.exe” and it will be ok.



1 comment:

  1. ./configure; make clean; make command is not working in my system? please any one tell me the solution for that prob.

    ReplyDelete