LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   ns2.33 intallation and path setting (https://www.linuxquestions.org/questions/fedora-35/ns2-33-intallation-and-path-setting-818634/)

vahitha 07-08-2010 01:24 AM

ns2.33 intallation and path setting
 
hello,
i want clear installation and path setting steps for installing ns2.33 in linux fedora 12.please any one of linux experts help me.thankyou.
vahitha

knudfl 07-08-2010 03:39 AM

Welcome to LQ. .. .. :)

All ns2 threads at LQ are tagged ns2.
LQ Search → Tag Name = ns2

Fedora 10 - 11 - 12 : post #3 here
http://www.linuxquestions.org/questi...11-a-817322/#3

Path : Either try with the path settings suggested, when
you have finished ' ./install ' for ns-allinone-2.33,
Or : install some very few files to a system path :
cd ns-allinone-2.33/otcl-1.13/ &&
./configure --prefix=/usr --enable-release --enable-devel
&& make , # make install
cd ../tclcl-1.19/ &&
./configure --prefix=/usr --enable-release --enable-devel
&& make , # make install
cd ../ns-2.34/
# make install
cd ../nam-1.14/
# make install
..

vahitha 07-21-2010 01:00 AM

hello sir,
thank you sir.
your instructions were helpful.
i followed following instructions to install ns2.33 in fedora 12

cd ns-allinone-2.33
./install

sudo gedit ~/.bashrc
#environment values for NS2/NAM
# LD_LIBRARY_PATH
OTCL_LIB=/your directory/ns-allinone-2.33/otcl-1.13
NS2_LIB=/your directory/ns-allinone-2.33/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/your directory/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/your directory/ns-allinone-2.33/bin:/your directory/ns-allinone-2.33/tcl8.4.18/unix:/your directory/ns-allinone-2.33/tk8.4.18/unix
NS=/your directory/ns-allinone-2.33/ns-2.33/
NAM=/your directory/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM

source ~/.bashrc
cd ns-2.33
./validate

now i cleared ns in installation.when i type ns whereever in commandpropt i can get %. but i m struggling with nam.when i type nam i got instruction like following.
[code omitted because of length]
: no event type or button # or keysym
while executing
“bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}”
invoked from within
“if {[tk windowingsystem] eq “classic” || [tk windowingsystem] eq “aqua”} {
bind Listbox {
%W yview scroll [expr {- (%D)}] units
}
bind Li…”

what steps should be follow to rectify this inconvinent.
please help sir
vahitha

knudfl 07-21-2010 01:17 AM

1 Attachment(s)
Please read post #2
REPEAT : Fedora 10 - 11 - 12 : post #3 here
http://www.linuxquestions.org/questi...11-a-817322/#3

QUOTE :
ns-allinone-2.3x also requires the tk-8.4-lastevent.patch :
http://bugs.gentoo.org/attachment.cgi?id=161242
..

cd ns-allinone-2.33/tk-8.4.18/
patch -p0 < tk-8.4-lastevent.patch

And run ./install again : Only tk4.8.18 and nam-1.xx will change,
and you should now get a 'nam' that works. _ _ _ :) _

vahitha 07-21-2010 09:17 PM

ns2.33 installation and path setting in fedora12
 
sir,
thankyou sir
i patch the tk-8.4-lastevent.patch file from /ns-allinone/tk8.4.18/
nam is also worked well.

now i executed one tcl program.i can view the result in nam sucessfully.
then,when i execute it with ns program_name.tcl from command prompt the part of my program is executed and i can see the calculated through put and delay etc...in terminal window.

i couldn't get it in graph.
error :ns: proc_name: couldn't execute "xgraph": no such file or directory

what are the steps should be followed and what are the possibilities to get these?

i check well in path setting for xgraph also.
please help me to execute my program successfully.

thankyou.
vahitha

knudfl 07-22-2010 01:26 AM

'xgraph' is not considered important, and was never created.
It's a old tool, 2001 and will usually not build on a new Linux.

But you can use a binary from a Debian package :
http://packages.debian.org/stable/math/xgraph
http://ftp.de.debian.org/debian/pool....1-10_i386.deb
> xgraph_12.1-10_i386.deb
Unpack with : 1) ar -x xgraph_12.1-10_i386.deb
2) tar xvf data.tar.gz , and copy 'xgraph' to /usr/local/bin/

Can be tested with ns-allinone-2.34/xgraph-12.1/examples/...
..

vahitha 07-22-2010 11:41 PM

sir,
thankyou.
i followed your suggestions to install xgraph.
it is installed sucessfully.
when i execute builtin xgraph from /xgraph-12.1/example/
it is executed sucessfully.
but when i execute my program,i received "problem in input" message.
in which part i should concentrate?

part of my program
# Plot Recorded Statistics

exec xgraph n5-pkt_rec.tr n12-pkt_rec.tr n11-pkt_rec.tr n14-pkt_rec.tr n0-pkt_rec.tr -geometry 800x400 -t "NO OF PACKET RECIVED AT SINK" -x "Time" -y "Receive packets" &

exec xgraph n5-pdr.tr n12-pdr.tr n11-pdr.tr n14-pdr.tr n0-pdr.tr -geometry 800x400 -t "Throughput-Perfomance-Evaluation" -x "Time" -y "Receive packets" &

exec xgraph n5-Bw.tr n12-Bw.tr n11-Bw.tr n14-Bw.tr n0-Bw.tr -geometry 800x400 -t "Bandwith" -x "Time" -y "Received bytes" &

exec xgraph n5-delay.tr n12-delay.tr n11-delay.tr n14-delay.tr n0-delay.tr -geometry 800x400 -t "End-to-End-Delay" -x "Time" -y "Received bytes" &



please help me.
vahitha

knudfl 07-23-2010 03:34 AM

Not a subject I know much about, but is xgraph supposed to use
.tr files directly ?
Or should "out.tr" be filtered into a new file = "out.xgr" ?

Google .. ns2 display out.tr .. ( 1,000,000 hits ) Examples :
http://nile.wpi.edu/NS/example_srm.html

http://spectral.mscs.mu.edu/Net2008I...TML/node2.html
QUOTE : "awk filters the trace file out.tr using filter fil2.awk and
directs the output to out2.xgr (to be displayed with xgraph later on).
Same with fil4.awk and fil6.awk."
..

vahitha 08-25-2010 02:39 AM

sir,
thankyou sir.
i need to know how to uninstall ns2.33 from fedora 12. i cannot delete ns-allinone-2.33 folder from root directory.
if i delete the message displays as "permission denied"
please tell me how to delete ns2 permanantly.
thankyou,
vahitha

DukeSSD 08-25-2010 06:55 PM

Hang on a minute...
Why is this thread on the AIX forum?

Shouldn't it be over here:
http://www.linuxquestions.org/questions/fedora-35/

dev_crazy56 03-12-2011 12:52 AM

hello Sir knudfl,

Your solution was fantastic and my nam worked perfectly well with your patch file. But after a few runs it failed to work again. It gave some weird message like.....


________________________________________________
nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."
___________________________________________________


And when i tried.....


/ns-allinone-2.33/tk8.4.18$ patch -p0 < tk-8.4-lastevent.patch.txt


it gave a message like......
_________________________________________________________________

patching file generic/tk.h
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 635.
1 out of 1 hunk FAILED -- saving rejects to file generic/tk.h.rej
__________________________________________________________________


Sir i am using Ubuntu 9.10 and in the middle of my college project. I will be always grateful to you if you could help me.


thank you
dev

knudfl 03-12-2011 02:11 AM

Post # 11, @dev_crazy56 : Welcome to LQ. .. .. :) ..

Nam is a separate application : Any 'nam' can be used.
E.g. https://docs.google.com/uc?id=0B7S25...=CLPiyxo&hl=en
> > nam-1.14.i586.tar.gz

Untar the package to /usr/local/bin/ : And it is in a system path.
Or 'tar xvf nam-1.14.i586.tar.gz' anywhere and : sudo cp nam /usr/local/bin/
> > Tested on Ubuntu 9.10 → → Works perfect.

More info here, post # 8
http://www.linuxquestions.org/questi...9/#post4287321

..

dev_crazy56 03-12-2011 03:30 AM

thank you so much sir for your interest.


I did as per your instruction and then......

______________________________________________________________________

debasish@debasish-laptop:~/Downloads/nam$ tar xvf nam-1.14.i586.tar.gz
nam-1.14.i586/
nam-1.14.i586/nam
debasish@debasish-laptop:~/Downloads/nam$ sudo cp nam /usr/local/bin/
[sudo] password for debasish:
cp: cannot stat `nam': No such file or directory
debasish@debasish-laptop:~/Downloads/nam$ sudo cp nam/usr/local/bin/
cp: missing destination file operand after `nam/usr/local/bin/'
Try `cp --help' for more information.
_______________________________________________________________________


and now whenever i try to run nam in my terminal it shows the same result.

_______________________________________________________________________

debasish@debasish-laptop:/usr/local/bin$ nam
nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

____________________________________________________________________________

But when i graphically go to usr/local/bin/ and double click on the 'nam' executable icon, it runs which is a little bit unsatisfactory.

sir i m purely a newbie, apologies for the trouble i m causing.....

sincerely dev

knudfl 03-12-2011 04:08 AM

# 13

tar xvf nam-1.14.i586.tar.gz && cd nam-1.14.i586/ && sudo cp nam /usr/local/bin/


..

dev_crazy56 03-12-2011 04:24 AM

that worked perfectly sir,

thank you very much for you time,

dev

helok 09-06-2012 11:26 AM

Quote:

Originally Posted by knudfl (Post 4040310)

cd ns-allinone-2.33/tk-8.4.18/
patch -p0 < tk-8.4-lastevent.patch

And run ./install again : Only tk4.8.18 and nam-1.xx will change,
and you should now get a 'nam' that works. _ _ _ :) _

sorry to bother you sir,
where do I run './install' ?
in home/jeffrey/ns-allinone-2.33/tk-8.4.18 ?
or
in home/jeffrey ?

thank you

knudfl 09-06-2012 01:49 PM

Post # 16, @helok : I think you already know where to run ./install
.. that's in the top directory, i.e. home/jeffrey/ns-allinone-2.33/.

AFAIK, you already have a 'nam' version 1.14 in /usr/local/bin/,
and you only need one nam for all versions of ns2.

Please read the above posts # 12 and # 14.

.

helok 09-06-2012 08:48 PM

Quote:

Originally Posted by knudfl (Post 4774372)
Post # 16, @helok : I think you already know where to run ./install
.. that's in the top directory, i.e. home/jeffrey/ns-allinone-2.33/.

AFAIK, you already have a 'nam' version 1.14 in /usr/local/bin/,
and you only need one nam for all versions of ns2.

Please read the above posts # 12 and # 14.

.

im using nam 1.13 sir
its included in ns-allinone-2.33

and ive just re-installed after patched tk8.4, and i tried to run 'ns simple.tcl'
it works really well Sir.
thank you so much Sir for your help

nirvruti 09-18-2012 11:35 AM

found error after installing s2
/home/happy1/ns-allinone-2.33/bin/ns: cannot execute binary file

Ehtiba 02-04-2013 05:35 AM

Hello Sir,

I installed ns2.29 on Fedora 12. Unfortunately, NAM doesn't work.
I got same error. moreover, when I tried to download patch file, it doesn't work.
Could you please help me and send me a patch file and steps to implement it as well.

Thank you in advance and your help is appreciated.

this is me email. fehtiba@gmail.com

knudfl 02-04-2013 06:54 AM

# 20

Better : Use the more advanced nam-1.14, post #4 here ..
http://www.linuxquestions.org/questi...04-a-842109/#4
I.e. : # cp nam /usr/local/bin/


If you anyway want to fix an old nam, the tk-8.4-lastevent.patch is here
ftp://ftp.swin.edu.au/gentoo-portage...astevent.patch

-

reemlus 01-10-2014 11:42 AM

Quote:

Originally Posted by vahitha (Post 4041360)
sir,
thankyou sir
i patch the tk-8.4-lastevent.patch file from /ns-allinone/tk8.4.18/
nam is also worked well.

now i executed one tcl program.i can view the result in nam sucessfully.
then,when i execute it with ns program_name.tcl from command prompt the part of my program is executed and i can see the calculated through put and delay etc...in terminal window.

i couldn't get it in graph.
error :ns: proc_name: couldn't execute "xgraph": no such file or directory

what are the steps should be followed and what are the possibilities to get these?

i check well in path setting for xgraph also.
please help me to execute my program successfully.

thankyou.
vahitha

command for patching please

---------- Post added 01-10-14 at 12:43 PM ----------

Quote:

Originally Posted by knudfl (Post 4884051)
# 20

Better : Use the more advanced nam-1.14, post #4 here ..
http://www.linuxquestions.org/questi...04-a-842109/#4
I.e. : # cp nam /usr/local/bin/


If you anyway want to fix an old nam, the tk-8.4-lastevent.patch is here
ftp://ftp.swin.edu.au/gentoo-portage...astevent.patch

-

how to open binary nam

knudfl 01-10-2014 02:35 PM

#22, @reemlus.

Quote:

couldn't execute "xgraph": no such file or directory
.
command for patching please
I guess you mean "How to achieve a working 'xgraph' ?
The answer is : $ sudo apt-get install xgraph
... If your OS isn't Debian / Ubuntu / Mint, please specify your OS :
a) $ uname -m
b) $ cat /etc/*release*


Quote:

how to open binary nam
How to unpack a <package>.tar.gz : $ tar xvf <name>.tar.gz
... Or use your default 'Archive Manager'.

-

marwa88 11-21-2015 03:14 PM

Hi,
after the installation ns2.31 on fedora12, i had this same problem of nam (in the last line bind Li), to correct it i used the method of the patch. i downloaded the tk-8.4-lastevent.patch and i put it on tk-8.4.14 folder.

then i did this:

cd ns-allinone-2.33/tk-8.4.14/
patch -p0 < tk-8.4-lastevent.patch

and i ran ./install again.

after this i called the nam by nam command in the terminal, and i had this error:

Quote:

-bash:nam: command not found
how can i solve it, please?

knudfl 11-21-2015 03:47 PM

Re #24.

First : Check if you created a usable nam : cd nam-1.14/ && ./nam
If nam is working : # make install
( 'make install' will copy 'nam' to /usr/local/bin/
... just like # cd ns-2.33/ && make install will copy 'ns' to /usr/local/bin/.
Therefore : No *PATH settings are required. No adding no *PATH to .bashrc ).

Else : Install a nam package. Much easier than a build. Is what most people do :

Download an el6 package for your architecture, i686 or x86_64.
i686 https://drive.google.com/file/d/0B7S...ew?usp=sharing
x86_64 https://drive.google.com/file/d/0B7S...ew?usp=sharing

And : # cd Downloads/ && yum install nam-1.14-*



-

marwa88 11-21-2015 04:19 PM

Ok thank you, nam works now after using make install.

please, about the .bashrc file, when i am installing the ns2 after the ./install, it asked me to add path in .bashrc file, so i did it.

now when i added the patch of the nam(lastevent.patch) i did install agin so it asked me to add the path again while the path already exists.

This is my .bashcr file:
Quote:

.bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions
PATH=$PATH:/home/marwa/ns-allinone-2.31/bin:/home/marwa/ns-allinone-2.31/tcl8.4.14/unix:/home/marwa/ns-allinone-2.31/tk8.4.14/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/marwa/ns-allinone-2.31/otcl-1.13:/home/marwa/ns-allinone-2.31/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/marwa/ns-allinone-2.31/tcl8.4.14/library
~
~
~
~
~
~
~
~
~
~
"home/marwa/.bashrc" 11L, 450C

since you told me that i must not add path, so what i understand that i must delete those lines:
Quote:

PATH=$PATH:/home/marwa/ns-allinone-2.31/bin:/home/marwa/ns-allinone-2.31/tcl8.4.14/unix:/home/marwa/ns-allinone-2.31/tk8.4.14/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/marwa/ns-allinone-2.31/otcl-1.13:/home/marwa/ns-allinone-2.31/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/marwa/ns-allinone-2.31/tcl8.4.14/library

then i must do source .bashrc or something else or only delete them?

Thank you so much.

knudfl 11-21-2015 05:16 PM

Re #26.
Quote:

it asked me to add path in .bashrc file, so i did it.
No. You are not asked to add any *PATH text to .bashrc .
It's just a ~15 year old text from those days when students used a University Computer.
The executable 'ns' or "ns-<any-name>" is hard coded to know the location of it`s libraries:
ns-allinone-2.3x/{ lib/*/*, bin/tcsh8* }. And 'nam' is partly statically compiled.
You can actually run 'nam' OK on a computer with no ns2 and no {tcl8*, tk8*}.

".bashrc" is a text file : Easy to edit.
Just select : View > Show Hidden Files in Nautilus / Konqueror.

The original .bashrc :
Code:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions


marwa88 11-21-2015 05:41 PM

when i say it asked me to add path i mean this message tha appears at the end of ./install
Quote:

Please put /home/marwa/ns-allinone-2.31/bin:/home/marwa/ns-allinone-2.31/tcl8.4.14/unix:/home/marwa/ns-allinone-2.31/tk8.4.14/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/marwa/ns-allinone-2.31/otcl-1.13, /home/marwa/ns-allinone-2.31/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/marwa/ns-allinone-2.31/tcl8.4.14/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.


After these steps, you can now run the ns validation suite with
cd ns-2.31; ./validate
sorry for asking again, but what i need now is only to remove the path from the .bashcr file? then i run this command again or not
"source .bashrc" ?

thank you.

knudfl 11-21-2015 10:29 PM

Re #28 , the last century text, ~1999 ...
Please put .... ,, IMPORTANT NOTICES: You MUST put ..
.. was meant only for a "University Computer" :
.. i.e. when you had no write permissions to /usr/local/ : No # make install .

NS-2 is old. A lot of files still have leftover from the ninetieth.
So don't believe everything you read in the files or on the Internet.


$ source .bashrc
... is for adding stuff. Editing :
$ gedit .bashrc
.... ( Or whatever editor you prefer.)


-

marwa88 11-22-2015 10:15 AM

Thank you for the explanation.

I thought that the commande source is necessary after any modification in the .bashrc file ( i mean for the changes to take effect) .
So it is sufficient to do gedit .bashrc and save the file.

Thank you again.


All times are GMT -5. The time now is 02:46 PM.