Monday, December 28, 2009

Victory over ns2


So many updates, so many packages, so many hit and trials, 5 days, 2 systems, one software: NS2.34 !!! Tried to installed the software on my lab computer with Ubuntu 8.10 and lappy with Ubuntu 9.10 but both failed with the error:

tcl8.3.2 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.

The two standard methods given on the site:
http://www.isi.edu/nsnam/ns/ns-build.html
didn't work either... neither did! :(

Also the site:
http://www.mannasim.dcc.ufmg.br/index.htm

If these work for you right away, do tellme what did! :) thanks.

...then some issues came to light like

1. " you need to install the X libraries (to compile xgraph, nam, tk and otcl):
$ sudo apt-get install xlibs-dev
"

but "Package xlibs-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package xlibs-dev has no installation candidate
"

2. " If your ubuntu version is 9.10, you must change the variable of environment CC
$ export CC=gcc-4.3
"

3. A blog wrote: " Firstly otcl doesn't compile with the latest gcc-4.4 (available with ubuntu 9.10). You need to compile it with gcc -4.3. If you get through this then also your problem is not solved, the ns-allinone-2.3x skips installing nam & xgraph as ubuntu 9.10 is not friendly with these packages available in ns-allinone-2.3x package.


Following are the simple steps to install ns2 on Ubuntu 9.10 through launchpad ppa.
A> Firstly remove all ns-allinone-2.3x directory (if you put it anywhere to install ns2) and revert back all the path changes you made in ~/.bashrc related to ns2.

B> Now export the Wouter Horré's ppa repository key by typing the following command on terminal and enter:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B3F3334F

C> Now add the following ppa repository to source list [?]
deb http://ppa.launchpad.net/wouterh/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/wouterh/ppa/ubuntu karmic main

Reload repository information when prompted by "The information about available software is out-of-date" notification or reload it manually by following command on terminal:
$ sudo apt-get update

D> Now type the following command on terminal to install ns from the launchpad ppa repository:
$ sudo apt-get install ns nam xgraph
"

Don't know if that worked magic for me or not, though i doubt it could have as i got the message:
$ sudo apt-get install nam
[sudo] password for gurmeet:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package nam

May be the package xgraph did!!!?

4. Yet another hit and trial... during which i discovered
A)
$ yum install autoconf
can be used in ubuntu after
$ sudo apt-get install yum
but obviously not before that... i thought yum is for fedora!?!
B)
PATH variable is not defined in /etc/profile or .profile... its .bashrc ! :)

" STEP 1

From terminal login as super user and do the following.(internet must also be connected in order to install the package dependencies.

yum install autoconf
yum install automake
yum install gcc-c++
yum install libX11-devel
yum install xorg-x11-proto-devel
yum install libXt-devel
And for nam installation (optional):
yum install libXmu-devel

STEP 2

From terminal go to the folder where the ns-allinone patch is placed and type the following to extract
$ tar -xzf ns-allinone-2.31.tar.gz
$ cd ns-allinone-2.29
$. /install

STEP 3

Now go to /etc folder and type

gedit ~/.bashrc

Add the following lines to the end of it. Remember replace "/your/path" by something like "/home/kazim". And accordingly also change the version numbers. This is for ns 2.31.
"

I stopped after STEP 1 only to look for ns 2.3x package for fresh download as some of the tarred files i had showed:
"gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
"
Meanwhile i found:

5. Finally the saviour:
http://nsnam.isi.edu/nsnam/index.php/Installing_ns2.31_on_Ubuntu7.04
worked for me on 9.10 :)

Following this i immidiately had everything in place! :)

2 comments:

Unknown said...

hey plz tel how to extarct as i'm not able to .
i'm gettng error as:

tar: ns-allinone-2.33.atr.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Exiting with failure status due to previous errors

Gurmeet Singh said...

hi!
are you sure you chose the correct link to download ns
i used:
http://nsnam.isi.edu/nsnam/index.php/Installing_ns2.31_on_Ubuntu7.04#Download_and_install

and this is what i get while and after download and unzip:
Saving to: `ns-allinone-2.34.tar.gz'

100%[++++++++++++++++++++++++++++++++++++++>] 5,70,48,038 12.3K/s in 41s

2010-03-05 16:29:11 (12.3 KB/s) - `ns-allinone-2.34.tar.gz' saved [57048038/57048038]

gurmeet@gurmeet-laptop:/media/c$ ls
ns-allinone-2.34.tar.gz
gurmeet@gurmeet-laptop:/media/c$ tar -xzf ns-allinone-2.34.tar.gz
gurmeet@gurmeet-laptop:/media/c$ ls ns-allinone-2.34 ns-allinone-2.34.tar.gz

you mentioned you used: ns-allinone-2.33.tar.gz

try this one!

About Me

My photo
Silent Spectator, Tolerant, Observant, Emo, Easy going, Boring to some, Shy, what do u think? Professional Sites: 1) http://iitg.academia.edu/GurmeetSingh 2) http://sites.google.com/site/gurmeetcv/curriculum-vitae

Followers