[SOLVED] Can modified patch of OLSR developed on NS-2.29 , successfully run on NS-2.35?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can modified patch of OLSR developed on NS-2.29 , successfully run on NS-2.35?
Hi All,
I have patch of OLSR protocol, which has been modified and successfully run on NS-2.29. So, what changes are required in which files to successfully run the same modified patch on NS-2.35.
Thanks
Last edited by shelja.fet@mriu.edu.in; 07-30-2015 at 10:17 PM.
I have already patched and installed "um-olsr-1.0.tgz" on ns-2.35, ubuntu 12.04 and able to successfully simulate it. I, have another patch of "um-olsr", in which some changes have been made in algorithm of the protocol but it's implemented on ns-2.29. Now, i want to run the same modified patch on ns-2.35, but trying to find out, what changes are to be made, in which files to make it working on ns-2.35.
I want to keep both olsr patches in the same ns-2.35 folder.
Initially, i copied the modified code of um-olsr for version ns-2.29 in the folder ns-2.35 but unsuccessful in running the command:
Code:
s@s-Vostro-1440:~/experiment/ns-allinone-2.35/ns-2.35$ tar zxvf new-olsr.tgz
so, i manually placed the folder containing all relevant files in ns-2.35 and named that folder "new-olsr".
after that i tried to patch but getting errors.
Code:
s@s-Vostro-1440:~/experiment/ns-allinone-2.35/ns-2.35$ patch -p1<new-olsr/um-olsr_ns-2.35_v0.8.8.patch
patching file Makefile.in
Hunk #1 FAILED at 250.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.in.rej
patching file common/packet.h
Hunk #1 FAILED at 166.
Hunk #2 FAILED at 263.
2 out of 2 hunks FAILED -- saving rejects to file common/packet.h.rej
patching file queue/priqueue.cc
Hunk #1 FAILED at 90.
1 out of 1 hunk FAILED -- saving rejects to file queue/priqueue.cc.rej
patching file tcl/lib/ns-agent.tcl
Hunk #1 succeeded at 204 with fuzz 2 (offset 12 lines).
patching file tcl/lib/ns-default.tcl
Hunk #1 FAILED at 1369.
1 out of 1 hunk FAILED -- saving rejects to file tcl/lib/ns-default.tcl.rej
patching file tcl/lib/ns-lib.tcl.........
Please suggest, what changes have to be done, in which files... so that modified code of um-olsr, implemented on one version-ns-2.29 can be successfully patched, installed and run on ns-2.35.
Last edited by shelja.fet@mriu.edu.in; 08-05-2015 at 10:38 AM.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #3.
Please read the files ...
ns-2.35/Makefile.in.rej
ns-2.35/common/packet.h.rej
ns-2.35/queue/priqueue.cc.rej
ns-2.35/ns-default.tcl.rej
.... and compare with the files to be used :
Makefile.in, packet.h, priqueue.cc, ns-default.tcl
... to check if there really are any differences / issues.
Please read the files ...
ns-2.35/Makefile.in.rej
ns-2.35/common/packet.h.rej
ns-2.35/queue/priqueue.cc.rej
ns-2.35/ns-default.tcl.rej
.... and compare with the files to be used :
Makefile.in, packet.h, priqueue.cc, ns-default.tcl
... to check if there really are any differences / issues.
Rejections files as a resultant of patching, contain some statements from the files
Makefile.in, packet.h, priqueue.cc, ns-default.tcl...
Not getting what is to be done exactly.
The modified code of OLSR is successfully implemented on ns-2.29. I have UM-OLSR running on NS-2.35, UBUNTU 12.04. Now, i am planning to have lower version ns-2.29.3 on the same machine to run that modified patch of OLSR on my machine. So, please reply if two different versions of ns namely ns-2.29 and ns-2.35 can reside and work simultaneously on the same machine.
Last edited by shelja.fet@mriu.edu.in; 08-16-2015 at 11:35 AM.
OTCL File make error in installing ns-2.29.3 on Ubuntu 12.04
hi,
I am getting the following make error upon running $./install command in ns-allinone-2.29 on ubuntu 12.04. I have already running installation of ns-2.35 on the same machine.
Code:
//Error on running $./install in ns-allinone-2.29 directory
config.status: creating Makefile
rm -f libotcl.so otcl.o so_locations
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/s/ns-allinone-2.29/include -I/home/s/ns-allinone-2.29/include -I/home/s/ns-allinone-2.29/include -I/include otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch':
/home/s/ns-allinone-2.29/otcl-1.11/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/s/ns-allinone-2.29/otcl-1.11/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.11 make failed! Exiting ...
./ Install is successful in ns-allinone-2.29 with the following message:
Code:
//successful ./install in ns-allinone-2.29 directory
$ ./install
Please put /home/s/ns-allinone-2.29/bin:/home/s/ns-allinone-2.29/tcl8.4.11/unix:/home/s/ns-allinone-2.29/tk8.4.11/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put /home/s/ns-allinone-2.29/otcl-1.11, /home/s/ns-allinone-2.29/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>
(2) You MUST put /home/s/ns-allinone-2.29/tcl8.4.11/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.
(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.11
and tk8.4.11. They are now installed under /home/s/ns-allinone-2.29/{bin,include,lib}
After these steps, you can now run the ns validation suite with
cd ns-2.29; ./validate
For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.
but without adding any path information, ./validate is not successful in ./ns-2.29, some tests failed
Code:
//After running validate in ns-2.29
Test output agrees with reference output
All test output agrees with reference output.
Mon Aug 31 14:47:08 IST 2015
These messages are NOT errors and can be ignored:
warning: using backward compatibility mode
This test is not implemented in backward compatibility mode
validate overall report: some tests failed:
./test-all-session ./test-all-red
to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME
Notice that some tests in webcache will fail on freebsd when -O is turned on.
This is due to some event reordering, which will disappear when -g is turned on.
I already have working installation of NS-2.35 on the same machine on same OS-UBUNTU-12.04.should I add paths as mentioned as a result of ./install command in ns-allinone-2.29?? as previously you have mentioned in post #7
Quote:
Re #6.
You can have as many ns-allinone-2.xx as you want, installed at the same time.
But : Do never add any *PATH text to .bashrc . Not required.
Simply copy all the "ns-<any-name>" to /usr/local/bin/.
but when i installed NS-2.35 for the first time i have added path information and used $ sudo gedit bash.bashrc and set path information for PATH=$PATH:<....>, LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<....>-for otcl1.14 file and TCL_LIBRARY=$TCL_LIBRARY:<....>-for tcl8.5.10.
Now what should i do? I want to keep both running installations of ns-2.35 and ns-2.29 on ubuntu 12.04.
Should i remove path information from ns-2.35? or what is to be done to successfuly validate ns-2.29??
please suggest....
Thanks & Regards
Last edited by shelja.fet@mriu.edu.in; 08-31-2015 at 12:03 PM.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #10.
Quote:
when I installed NS-2.35 for the first time,
I have added path information and used $ sudo gedit bash.bashrc
Just delete the entries you have made to .bashrc .
.. Or replace the file bashrc with the original one : https://groups.google.com/forum/?fro...E/OVrwQLKwVlMJ >>> 30 Mar 2015.
Besides that : Do not use sudo for any ns2 commands.
'sudo' is for administrative tasks outside /home/ only.
Like copying ns-** to /usr/local/bin/.
* Note :
* The executable 'ns' or "ns-<any-name>" is hard coded to know the location of it`s libraries:
* ns-allinone-2.35/{ lib/*/*, bin/tcsh8* }.
* The old year ~1999 text ....
* "" Please put .... ,, IMPORTANT NOTICES: You MUST put .. ""
* ... was meant only for a "University Computer" : You had no write permissions to /usr/local/.
Quote:
validate overall report: some tests failed:
./test-all-session ./test-all-red
That's an exceptional good result.
Please remember that the original ns-2.29 was tested with CentOS4, 10 years ago !
A dozen of failed group tests is quite common with a modern OS, some ns2 versions.
@Knudfl, Hi
Thanks for your time amd useful information.
I have used sudo outside /home/ only.
Quote:
Just delete the entries you have made to .bashrc .
.. Or replace the file bashrc with the original one : https://groups.google.com/forum/?fro...E/OVrwQLKwVlMJ >>> 30 Mar 2015.
Besides that : Do not use sudo for any ns2 commands.
'sudo' is for administrative tasks outside /home/ only.
Like copying ns-** to /usr/local/bin/.
From the link you have mentioned in your post #11 , I have got the original bashrc-Ubuntu1404.txt file for UBUNTU14.04, but I am using UBUNTU 12.04 so, same file is to be used for Ubuntu 12.04?
As per your first suggestion
Quote:
Just delete the entries you have made to .bashrc
I have deleted the following lines from ~/.bashrc:
As per your suggestion to similar thread, then I run
Quote:
$ cd ns-allinone-2.34/ns-2.34/ && sudo make install
Code:
s@s-Vostro-1440:~/OLSR/ns-allinone-2.35/ns-2.35$ ns
The program 'ns' is currently not installed. You can install it by typing:
sudo apt-get install ns2
s@s-Vostro-1440:~/OLSR/ns-allinone-2.35/ns-2.35$ sudo make install
[sudo] password for s:
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install -c -m 644 ns.1 /usr/local/man/man1
s@s-Vostro-1440:~/OLSR/ns-allinone-2.35/ns-2.35$ ns
application-specific initialization failed: Can't find a usable init.tcl in the following directories:
:/home/s/ns-allinone-2.35/tcl8.5.10/library /home/s/ns-allinone-2.35/lib/tcl8.5 /usr/local/lib/tcl8.5 /usr/lib/tcl8.5 /usr/local/library /usr/library /usr/tcl8.5.10/library /tcl8.5.10/library
This probably means that Tcl wasn't installed properly.
s@s-Vostro-1440:~/ns-allinone-2.29$ ns
application-specific initialization failed: Can't find a usable init.tcl in the following directories:
:/home/s/ns-allinone-2.35/tcl8.5.10/library /home/s/ns-allinone-2.35/lib/tcl8.5 /usr/local/lib/tcl8.5 /usr/lib/tcl8.5 /usr/local/library /usr/library /usr/tcl8.5.10/library /tcl8.5.10/library
This probably means that Tcl wasn't installed properly.
Is it going right way?
Last edited by shelja.fet@mriu.edu.in; 09-01-2015 at 12:18 PM.
Can't find a usable init.tcl in the following directories: ....
? May be you moved the directory "ns-allinone-2.35/" away from the build location ?
'ns-allinone-2.xx' must be built in /home/<name>/<ns2>/ . (! Not the Desktop/.)
And if you move it to another location :
A copy of ns-allinone-2.xx/{lib/, bin/} must be present in the build location.
Besides that : Do not use plain 'ns' in a command. See post #7 :
$ cd ns-allinone-2.3x/ns-2.3x/ && sudo cp ns ns23x-olsr
$ sudo cp ns23x-olsr /usr/local/bin/
.. And for ns235 do the simulation like $ ns235-olsr ddebbie90-scenario.tcl
.. Etc. etc. from the examples : umolsr-examples-04.04.2015.tar.gz https://drive.google.com/file/d/0B7S...ew?usp=sharing
? May be you moved the directory "ns-allinone-2.35/" away from the build location ?
'ns-allinone-2.xx' must be built in /home/<name>/<ns2>/ . (! Not the Desktop/.)
No, I have not moved any NS installation on the desktop. Both ns-allinone-2.35 and ns-allinone-2.29 resides in /home/anyName/ns-allinone-2.x.x/.
I have just replaced the .bashrc file with yours in post # 13: "bashrc-Ubuntu1204.txt" and both ns-2.35 and ns-2.29 are running successfuly.
Moreover, as per your suggestion I have created copies of executable ns with different names in /usr/local/bin/. Now, I am able to successfuly run commands:
Quote:
$ns or $ns235-olsr or $ns229
Now, I have to patch and configure modified-olsr patch to already running installation of ns-2.29. So, as per your replies to similar threads, is it necessary to again run ./install in ns-allinone-2.29 directory after patching and configuring the protocol??
Thanks & Regards
Last edited by shelja.fet@mriu.edu.in; 09-02-2015 at 12:44 PM.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #14.
Quote:
Is it necessary to again run ./install in ns-allinone-2.29
.. after patching and configuring the protocol ? ?
Would not be $ ./install, but $ export CC=gcc41 CXX=g++41 && ./install
Or in ns-2.29/ :
$ export CC=gcc41 CXX=g++41 && ./configure && make clean && make
But why not set up a new ns-allinone-2.29.3 in a new directory,
then you still have the original.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.