Installing Tracegraph2.02 application in Ubuntu

Tracegraph is a great application that comes handy to ns2 users. It eliminates the need to configure and run perl/awk scripts over the trace file. Trace file analysis simplified. Though I feel that Tracegraph is still in its infancy, its  existing scope just provides all that a researcher using ns2 needs.

The steps mentioned in this post were tested to be successful in Ubuntu 10.10 and I believe it would work in other Linux distros and Ubuntu versions too.(Remember that the command sudo doesn’t work in non-debian distributions of Linux.)

First, Download the following packages:

<Download Tracegraph>

<Download Mglinstaller>

Tracegraph seems to have been developed using Matlab and therefore supporting code is needed make it run in Linux. This is the reason behind installing mglinstaller.

Extract tracegraph202linux.tar.gz in  your homefolder. In my case this would result in /home/micman/tracegraph202

Next extract mglinstaller.gz into /home/micman/tracegraph202
A single executable named mglinstaller would appear in the tracegraph202 folder.

Next, provide executable permission to mglinstaller and run it using the following command:

$sudo chmod 777 mglinstaller

 

$./mglinstaller

You would then be prompted with an information, all you have to do is to hit ENTER.

This would create a new folder named glnx86 in the following location: /home/micman/tracegraph202/bin/

Next, copy all the folders and files in /home/micman/tracegraph202/  location and paste them into /home/micman/tracegraph202/bin/glnx86/

Finally, enter the following line in Terminal:

 $ sudo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/micman/tracegraph202/bin/glnx86

Remember, micman in the above line is my account name, replace it with your account name(user name).

Exit the Terminal and Re-invoke it.

Now, navigate to this location: /home/micman/tracegraph202/bin/glnx86/

$ cd /home/micman/tracegraph202/bin/glnx86 

List all the files in this location

$ ls 

you would see an executable named trgraph in this location.Provide executable permission to this file and execute it.

$ sudo su 

 

# chmod 777 trgraph

 

# ./trgraph

To run tracegraph every time, just navigate to /home/micman/tracegraph202/bin/glnx86 in Terminal and execute trgraph as follows:

$ ./trgraph 

UPDATES:

Tip by Siddharth

Place the trgraph executable in the location /usr/bin/ so that you can execute it from the Terminal without having to “cd” into the installation directory everytime.  The command to copy the trgraph executable into /usr/bin/  looks like this:

$ sudo cp /home/micman/tracegraph202/bin/glnx86/trgraph /usr/bin

Update

If you encounter an error something like the following:

bash: ./trgraph: No such file or directory
It is probably because you are trying to run this tracegraph on a 64-bit machione.

To fix this issue, you need to install 32bit libraries, by running the following command in the Terminal:

sudo apt-get install ia32-libs 

after this you can just execute ./trgraph as mentioned in the tutorial.
This link helped me find this solution.

Was this post helpful? Then thank me by clicking <this link>

[ns error] Parsing error in event.

Question: After I run a network simulation in nam(Network Animator) on the nam file generated by my tcl script, I get the following errors in my terminal:

Missing required flag -x in: W -t 500
Missing required flag -y in: W -t 500

Parsing error in event.

What could be wrong?

Answer: It isn’t a problem with the ns script.It is a problem associated with nam.It has turned out to be that if I use the slide-bar (TIME) to go to  a period of time instead of running the whole simulation time until it reaches the desired period of time NAM places (at least in my computer) the nodes in a wrong position that doesn’t match the reality. I’ve discovered it because when I slide the bar these messages appear in the console:

Missing required flag -x in: W -t 500
Missing required flag -y in: W -t 500
Parsing error in event.

So, the solution is clear: Let the simulation run until the desired time instead of using the slide-bar.

Was this post helpful? Then thank me by clicking <this link>


Customising Gedit for tcl scripting

I spent a whole evening trying to find out some IDE or editor that would help me in coding tcl scripts as a part of ns simulations. The major feature I expected was autocompletion and keyword highlighter. Every editor/IDE that I stumbled upon contained one or the other, but not all. I tried Komodo Edit, Visual TCL,Alpha(tk) etc. Some of these even tested my patience in installing them.

Frustrated, I took recourse to Gedit and by chance I noticed that there are certain plugins available for Gedit, which I found would help satisfy my requirements I had mentioned in the para above. One notable plugin is the “Autocompletion” plugin. While you type the code/some word, this plugin shows a popup of words which were used before in the same document. In simple, it “autosuggests”. This one was interesting.

Along with this, you can enable some more plugins like “Bracket Completion”,”Embedded Terminal” and “Session saver”, whose purpose is pretty much self explained. And thus you almost have an IDE customised to code tcl or almost any language, needless to say that gedit provides better code highlights.

This is where you find the plugins….

Gedit–>Edit–>Preferences–>Plugins

For more on installing gedit plugins in Ubuntu, see my previous post.

<Here> is a complete list of Gedit plugins and don’t miss out the Latex plugin 🙂


********************************************************************

~TiP~

Move Window Buttons Back to the Right in Ubuntu 10.04 / 10.10

********************************************************************