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:
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.


Instead of ‘cd’ing to the
every time when you want open trgraph, you may put the trgraph file into /usr/bin/ directory. As a consequence of doing this you will be able to execute the trgraph application from any directory.
The shell command to do this will look like :
Now you may execute trgraph from anywhere. Also as you have put the file ( trgraph) in /usr/bin, any user in the system will be able to run the application. Please correct me if the last statement that I have made is wrong ( ’cause I really not sure whether that is right )
Hope that was helpful. I did what I just told for firefox4 in my computer. I put the executable file in /usr/bin/ directory and I run firefox4 when I am ‘siddharth‘ and also when I am ‘janitor‘. I work as two users in my computer. One as a ‘normal’ user ( that is siddharth) and other with administrative privilege ( janitor)
R.Siddharth.
Thats a very useful tip Siddarth:)
I strongly feel we need to give the GNU project some credit. Linux is just the kernel and approximately is only 3 % of the whole operating. The operating systems ( the distros) which use Linux as it’s kernel contains a lot of programs which belong to the GNU project. Therefore it is appropriate to call the respective distro as “DISTRIBUTION_NAME GNU/Linux”. For instance, Debian is referred to as Debian GNU/Linux in debian’s website. Take a look : http://www.debian.org
Read an article by Richard Stallman on this issue :
What’s in a Name ?
Ok I will follow this in my future posts. The reason I avoid such jargons is to not to frighten people who are new to Linux!
It is not jargon, it is just about the acknowledgment that the GNU project deserves. Also it is very important to make people know about GNU because most people are still under the impression that Linux is a operating system which is a blatant fallacy.
Please make people aware of GNU, it is from which everything started. I thank you.
R.Siddharth.
Hi,
I want to know how to use this trace graph. As whenever i open a trace file using the tracegraph, it just freezes…
angel@ubuntu:~/tracegraph202/bin/glnx86$ ls
copyright.txt doc mglinstaller stats.fig trgraph.cfg
dataread.mexglx graphs.fig sortcellchar.mexglx trgraph trgraph.fig
angel@ubuntu:~/tracegraph202/bin/glnx86$ sudo su
root@ubuntu:/home/angel/tracegraph202/bin/glnx86# chmod 777 trgraph
root@ubuntu:/home/angel/tracegraph202/bin/glnx86# ./trgraph
./trgraph: error while loading shared libraries: libmwsgl.so: cannot open shared object file: No such file or directory
…………………………………………………………………………..
Now what should i Do.. ??
I don’t know about it?
Next, copy all the folders and files in /home/micman/tracegraph202/ location and paste them into /home/micman/tracegraph202/bin/glnx86/
when i uesd this line ” $ sudo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/micman/tracegraph202/bin/glnx86 ”
i get this error
sudo: export: command not found
can you please tell me why i get this and how to fix it
@hz87:
You don’t use “sudo”, your line:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/micman/tracegraph202/bin/glnx86
Good luck!
@phrairin:
You can copy, paste by hand or by command:
cp /home/micman/tracegraph202/ /home/micman/tracegraph202/bin/glnx86/
Hope it can use for you!
when i uesd this line ” $ sudo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/micman/tracegraph202/bin/glnx86 ”
i got this error
sudo: export: command not found
i have changed micman with my account name but still found this error
sudo: export: command not found
can you please tell me why i get this and how to fix it
hi i m installing trgraph by using the same steps but it is giving me an error while running trgraph like:
./trgraph
bash: ./trgraph: No such file or directory
I get also this error
sudo: export: command not found
I solved export error not writing sudo but this time I got ./trgraph: error while loading shared libraries: l ibmwsgl.so: cannot open shared object file: No such file or directory
Hi Nidhi Malhotra ! U just dont need to type command “sudo su”
Also hz87 : dont need sudo, just only :
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/micman/tracegraph202/bin/glnx86
Pingback: Help error Ns2
i followed the steps given by you
but i gt I got ./trgraph: error while loading shared libraries: l ibmwsgl.so: cannot open shared object file: No such file or directory
how can i resolve this problem?