Compile Repeatation
After doing any changes in .cc file;
From terminal:
go to:-> cd ns-allinone2.35/ns-2.35
run:-> make clean
./configure
make
sudo make install
=================================================
Detail Procedures are in Following :
=================================================
How to re-compile NS2:
http://nshubforum.com/post/how-to-recompile-ns2
NS2 need to be recompiled in two cases.
1. When modifying the existing algorithm
By using same header and source files
2. When adding new files/Protocols
By adding new header and source files
Modifying the Existing Algorithm:
Step 1: Change the existing algorithm.
Step 2: execute the following command
make clean
make depend
make
Compilation will be success if there are no errors in the modified code and NS will be created.
Step 3: Run TCL script for the modified algorithm.
Adding New Protocol:
Step 1: Create new header and source files for new proposed algorithm.
Step 2: Put these files inside respective folder /home/user/ns-allinone-2.--/ns-2.--/
Step 3: Need to place that information in Makefile.in (in ns-allinone-2.--/ns-2.--/). Open Makefile.in using any editor (usually vi or gedit) and add the folder information to the OBJ_CC variable)
Step 5: Put new proposed algorithm information anywhere inside the OBJ_CC variable
For example: "propalgo/propalgo.o \"
Step 6: After editing the file entry, follow these steps:
1. Go to /home/user/ns-allinone-2.--/ns-2.--/
2. ./configure // replace Makefile with modified one.)
3. make clean //(*optional) use this, If you want to recompile the whole ns2.
4. make //this will make all object files which are missing
Compilation will be success if there are no errors in the modified code and NS will be created.
Step 7: Run TCL script for the new protocol.
=================================================
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install
=================================================
$ cd ns-allinone-2.35/
$ ./install
$ cd ns-2.35
$ ./configure (replace Makefile with modified one.) or next line
$ sudo make install
if any problem, then
$ make clean (*optional - use this, If you want to recompile the whole ns2.)
$ make (this will make all object files which are missing)
$ sudo make install