LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-01-2014, 08:39 AM   #1
Retta
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Rep: Reputation: Disabled
How to install and run more than one version of ns2 at the same machine


Hi All,

I want to install NS2.31-patch1 and NS2.31-patch2 both the versions and would like to work on both versions.

I've installed two versions of NS2 in two different directories (locations) on Linux CentOS (i use PuTTY to get access to the uni server which run the CentOS):
1- /home/...../"username"/dir1/ns2/
2- /home/...../"username"/dir2/ns2/

I define tow path.sh for each ns-version, and when i want to work on one of them i use the command source ./pathx.sh to activate the path for the desired version.

My problem is even when i using the second version the simulator use the folders and files of the first version.

I did lot of search in NS2 old posts and google but did not find much satisfactory answer. Kindly help me in this or redirect me to some links which can help me to solve these issues.

If i mistaken then,
1) How shall i install both the versions (i already have NS2.31-patch1 installed and now want to install NS2.31-patch2 as well).
2) After installation, While executing any script, how the simulator will
understand which version to use.

Regards,
 
Old 05-01-2014, 09:10 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
You can have as many ns-allinone-2.xx as you want ( I have 90 ),
installed at the same time.
But do not add any *PATH text to .bashrc : Usually not required.
( Unless it's the "University Computer" : No write access to /usr/.)
* The executable `ns*ī is hard coded to know the location of itīs libraries.
( Which means you cannot move or rename the "ns-allinone-*/{bin/, lib/}" ).

How to setup / use, example :
//dir1/// ns-2.31/ : $ cp ns ns-orig ; # cp ns-orig /usr/local/bin/ .
//dir2/// ns-2.31/ : $ cp ns ns-tfrc ; # cp ns-tfrc /usr/local/bin/ .
//dir3/// ns-2.31/ : $ cp ns ns-crahn ; # cp ns-crahn /usr/local/bin/ .
//dir4/// <any ns2 version> , etc. etc.
Ref. @Retta http://www.linuxquestions.org/questi...or-4175503446/

All simulations will usually work perfect with $ ns-<name> file.tcl ,
like $ ns-crahn test-random-topology.tcl .

In occasions where a bash script uses plain 'ns' :
Copy the appropriate 'ns' to /usr/local/bin/ . Or edit the shell script.

-

Last edited by knudfl; 05-01-2014 at 12:28 PM.
 
Old 05-01-2014, 11:51 AM   #3
Retta
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thank you very much knudfl,

unfortunately i do not have privilege (access) to the directory "/usr/local/bin/" cause i work on the university server and i have access only to my account directories starting from username "/home/...../"username"/dir1/ns2/"; Therefore, i have to setup (define) it locally in each ns-ver dir.

May i ask your help.

many thanks

Last edited by Retta; 05-01-2014 at 12:06 PM.
 
Old 05-01-2014, 12:26 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 3 .

Suggest :
Use like "$ ./ns*" , i.e. use a copy of ns-<name> in each example folder :
$ ./ns-crahn test-random-topology.tcl

Or copy those different nsīs into /home/retta/bin/{ns-crahn ns-orig},
and use the full path :
$ /home/retta/bin/ns-orig file.tcl
$ /home/retta/bin/ns-crahn test-random-topology.tcl
... Or / and add /home/retta/bin/ to .bashrc .

The PATHīs in the .bashrc can also take care of 'nam' and 'xgraph',
when they are called.

-

Last edited by knudfl; 05-01-2014 at 12:32 PM.
 
1 members found this post helpful.
Old 05-02-2014, 08:09 AM   #5
Retta
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thanks knudfl, you are more than genius.

I used your first suggestion #4, and i finally succeeded in building more than ns-version at the same time.

Many thanks.
 
Old 05-16-2014, 05:59 AM   #6
Retta
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Modifying the ns source-code

Please be aware each time you modify the ns source-code,
you have to create a new executable `ns*ī just like post #2
i.e. cd to your ~/../ns-2.XX then
~/../ns-2.XX/: $ cp ns ns-XXX;
finally copy ns-xxx to your script's dir and then execute it.

Last edited by Retta; 05-16-2014 at 06:17 AM.
 
  


Reply

Tags
centos, linux, ns2, putty



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to install ns2.27 on Ubuntu 9.10 64-bits version bnkdul Linux - Software 20 03-10-2013 04:14 PM
[SOLVED] NS2 installation problem: no rule to make target 'VERSION' , needed by gen/version.c bilabongster Linux - Newbie 23 12-07-2011 11:54 AM
Which version of linux is best to install NS2(network simulator) subicutipe Linux - Newbie 3 02-17-2011 05:46 AM
How to install NS2 simulator(version 2.29) in Fedora 7. mrbhush General 1 05-06-2009 01:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration