LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 12-29-2011, 04:53 AM   #1
kuldip acharya
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Rep: Reputation: Disabled
Cool ns2.33 in ubuntu 11.04


$ sudo apt-get install build-essential autoconf automake libxmu-dev libxt-dev gcc-4.3

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-4.3
E: Couldn't find any package by regex 'gcc-4.3'

I have make necessary changes : CC= gcc-4.3 in Makefile.in , SHLIB_LD="gcc -shared" in configure file in otcl-1.13 of ns2.33 folder....!

but no effect,
then I give ./install
kuldip@kuldip-G41T-M7:~/ns-allinone-2.33$ ./install

============================================================
* Testing for Darwin (OS X) environment
============================================================
============================================================
* Testing for Cygwin environment
============================================================
Cygwin not detected, proceeding with regular install.
============================================================
* Testing for FreeBSD environment
============================================================
FreeBSD not detected
============================================================
* Build XGraph-12.1
============================================================
./install: 431: autoconf: not found
./install: 432: ./configure: Permission denied
tcl8.4.18 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.
============================================================

* Build Stanford GraphBase
============================================================
Making sgb
routines seem to work!
./test_graph
.................................................................................................... Hey, I allocated 10000000 bytes successfully. Terrific...
OK, the gb_graph routines seem to work!
...
gcc -I../include -L../lib -o ../bin/sgb2ns sgb2ns.o -lm -lgb
sgb2ns has been installed successfully.
============================================================
Doing other changes and exiting...again opening terminal:
kuldip@kuldip-G41T-M7:~$ ns
% nam

NETWORK ANIMATOR IS RUNNING & Example files r also running...Tcl scripts r also running okay...!
is my ns2.33 installed 100 % or still there something is Wrong..........Suggest Me..... !
 
Old 12-30-2011, 02:55 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Quote:
sudo apt-get .................. gcc-4.3
A g++ compiler is essential.


And : No Ubuntu gcc-4.3 / g++-4.3 will work in Ubuntu 11.04.


gcc-4.2.4 packages for Ubuntu 11.04, 32bits i386 are available :
a) gcc42-compat-4.2.4_i386.deb
https://docs.google.com/uc?id=0B7S25...nload&hl=en_US
b) g++42-compat-4.2.4_i386.deb
https://docs.google.com/uc?id=0B7S25...nload&hl=en_US


gcc41- / g++41-compat for Ubuntu 11.04, post #6 here
http://www.linuxquestions.org/questi...mand-916594/#6

.

Last edited by knudfl; 12-31-2011 at 07:18 AM.
 
Old 01-01-2012, 09:18 AM   #3
kuldip acharya
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Smile NS2.33 IN UBUNTU11.04 "otcl-1.13 configuration failed! Exiting"

Thanks, for reply ...!
ns2.33 in Ubuntu 11.04 support gcc-4.5....so I did the following steps...and gcc not found problem is solved...!!

$ sudo apt-get install gcc-4.5 g++-4.5

$ export CC=gcc-4.5 CXX=g++-4.5 && ./install


Edit Makefile.in found at this location ns-allinone-2.33/otcl-1.13/Makefile.in as follows:

Find the line that says:
CC= @CC@
and change it to:
CC= gcc-4.5

NOW CURRENT STATUS IS :

tk8.4.18 installation succeeded.
============================================================
* Build OTcl-1.13
============================================================
./configure: line 986: config.log: Permission denied
otcl-1.13 configuration failed! Exiting ...

Please check http://www.isi.edu/nsnam/ns/ns-problems.html
for common problems and bug fixes.

But, Nam is running okay....!
Give your View...................!!
 
Old 01-01-2012, 05:56 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Quote:
./configure: line 986: config.log: Permission denied
A "permission denied error" can happen, if a command was done with :
sudo <command>

The recommended build location is /home/<name>/ns2/ns-allinone-2.33/
( Or other folder in /home/<name>/ ).
And then execute all commands as unprivileged user. No sudo.

Also : ns-allinone-2.33 cannot be compiled with gcc / g++ version 4.5 or 4.4,
hence the links to g++42-compat, etc.
This will do : export CC=gcc42 CXX=g++42 && ./install

..
 
Old 01-24-2012, 01:27 PM   #5
kuldip acharya
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
hi,
I have installed olsr in ns2.34 in ubuntu 11.04 successfully , but when I am running olsr script the following error is showing....

kuldip@kuldip-G41T-M7:~$ ns olsr_ex.tcl
invalid command name "Agent/OLSR"
while executing " Agent/OLSR set use_mac_ true"
(file "ol2.tcl" line 43)

please, suggesst me how to solve it

Thanks
 
Old 01-26-2012, 01:58 AM   #6
Gunasekaran
LQ Newbie
 
Registered: Nov 2011
Location: tamilnadu,vellore
Distribution: ns2
Posts: 13

Rep: Reputation: Disabled
ns2.34 installation problem

hi kuldip acharya & knudfl

i also trying to install ns2.34 or 3,1 in ubuntu 11.04 but no one get install successfully.errors are same yours, otcl make failed,gcc failed, do u have any complete and clear ns2.34 installation steps...please post it....thanks in advance...
 
Old 01-26-2012, 02:12 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Post #6 , @Gunasekaran :
No Ubuntu compiler will do for ns2 in Ubuntu 11.04 .

Generally : Do not use Ubuntu 11.04 and 11.10 for development
of special applications like ns2.

However : Special compat compilers were created for Ubuntu 11.04 ..
Please follow the links in post #2.

.

Last edited by knudfl; 01-26-2012 at 05:51 AM.
 
1 members found this post helpful.
Old 01-26-2012, 02:56 AM   #8
Gunasekaran
LQ Newbie
 
Registered: Nov 2011
Location: tamilnadu,vellore
Distribution: ns2
Posts: 13

Rep: Reputation: Disabled
Sir

Which ubuntu is best for ns2 ubuntu11.04 or10.04...i am going to install 10.04...for that which gcc i have to install for ns2.31....i think im having trouble when im istalling gcc and otcl....
 
Old 01-26-2012, 03:14 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 8 : Recommended is Ubuntu 10.04 .

The g++-4.1 compiler will compile ns-2.31 :
cd ns-allinone-2.31/ && export CC=gcc-4.1 CXX=g++-4.1 && ./install



.

Last edited by knudfl; 01-26-2012 at 03:16 AM.
 
1 members found this post helpful.
Old 01-26-2012, 03:37 AM   #10
Gunasekaran
LQ Newbie
 
Registered: Nov 2011
Location: tamilnadu,vellore
Distribution: ns2
Posts: 13

Rep: Reputation: Disabled
Sir

thanks for u r quick reply...
Sir how to calculate shortest path between two nodes in ns2.......and how to maintain a routing table in a node...bcoz my project i have to maintain the no of nodes connected to the home agent....depent upon no of nodes i have to select least one....wat i hav to do
 
Old 01-26-2012, 12:50 PM   #11
kuldip acharya
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
To install ns2.34 in ubuntu11.04
This method , pls, read carefully...!

Step 1 : Download the ns-allinone-2.34 from this site:
http://bit.ly/downloadns

Step 2 : Place the ns-allinone-2.34.tar.gz package in your home folder(/home/micman in my case). Right click the package and extract the contents in the same folder.

Step 3: Next, open the Terminal (Applications --> Accessories --> Terminal)

Step 4: Change to ns-allinone2.34 directory
$ cd /home/kuldip/ns-allinone-2.34

Step 5: First install all the dependencies

$ sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.5



Edit Makefile.in found at this location ns-allinone-2.34/otcl-1.13/Makefile.in as follows:

Find the line that says:
CC= @CC@
and change it to:
CC= gcc-4.5

Concerning ns-2, Ubuntu and other stuff.
Installing ns-2.34 on Ubuntu 11.04


Install the development files for X Windows plus the g++ compiler:
$ sudo apt-get install xorg-dev g++ xgraph

Fix the error in the linking of otcl by editing line 6304 of otcl-1.13/configure so that it reads
SHLIB_LD="gcc -shared"
instead of
SHLIB_LD="ld -shared"

Change the line 270 in tcl8.4.18/unix/Makefile.in that reads
CC = @CC@
so it appends the version parameter for version 4.4:
CC = @CC@ -V 4.4
Make sure it is a capital V.

Then, edit the file ns-2.34/tools/ranvar.cc and change the line 219 from
return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
to
return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

Next, change the lines 183 and 185 in file ns-2.34/mobile/nakagami.cc to read
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
and
resultPower = GammaRandomVariable(m, Pr/m).value();

Now the code will compile if you run ./install. However, you may not be able to run the ns executable. If you get an error stating that there has been a buffer overflow *** buffer overflow detected ***: ./ns terminated including a backtrace, you need to do the following to make it work:

$ sudo apt-get install gcc-4.5 g++-4.5

Change the line 270 in tcl8.4.18/unix/Makefile.in that reads
CC = @CC@
so it appends the version parameter for version 4.4:
CC = @CC@ -V 4.4
Make sure it is a capital V.

Finally, run ./install from the ns-allinone-2.34 top folder again.

Step 6 : Begin ns2.34 installation
$ sudo su
# ./install

step7: Once the installation is successful i.e without any errors, we need to add the path information to the file /home/micman/.bashrc

$ sudo gedit /home/kuldip/.bashrc

$ sudo gedit /home/kuldip/.bashrc
Append the following lines to the file /home/micman/.bashrc (after replacing the instances where you find micman with your username)

# LD_LIBRARY_PATH
OTCL_LIB=/home/kuldip/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/kuldip/ns-allinone-2.34/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=/home/kuldip/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/kuldip/ns-allinone-2.34/bin:/home/kuldip/ns-allinone-2.34/tcl8.4.18/unix:/home/kuldip/ns-allinone-2.34/tk8.4.18/unix

#the above two lines beginning from xgraph and ending with unix should come on the same line

NS=/home/kuldip/ns-allinone-2.34/ns-2.34/
NAM=/home/kuldip/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM

For the changes to take effect immediately, do the following:

$ sudo su
# source /home/kuldip/.bashrc

$ ns
$ %
means mission complete
for tcl file testing
$ ns example.tcl
$ nam



OTHER PACKAGES IF Missing U CAN USE :


$ sudo gedit /home/kuldip/.bashrc
$ sudo gedit ns-2.34/tools/ranvar.cc
$ sudo gedit ns-2.34/mobile/nakagami.cc
$ sudo apt-get install tcl-dev
$ sudo apt-get update
$ sudo apt-get install tcl-dev
$ sudo apt-get install libx11-dev
$ sudo apt-get install x-dev
$ sudo apt-get install gcc-4.5 g++-4.5
$ sudo apt-get install libxt-dev
$ sudo apt-get install nam
$ sudo apt-get install xorg-dev g++ xgraph
$ export CC=gcc-4.5 CXX=g++-4.5 && ./install
 
1 members found this post helpful.
Old 03-24-2012, 02:51 PM   #12
lucky89
LQ Newbie
 
Registered: Mar 2012
Posts: 19

Rep: Reputation: Disabled
hi,
I have installed olsr in ns2.29 in ubuntu 11.10 successfully , but when I am running olsr script the following error is showing....

invalid command name "Agent/OLSR"
while executing
"Agent/OLSR set use_mac_ true"
(file "olsr_example.tcl" line 44)


please, help me
 
Old 03-24-2012, 05:05 PM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 12
Quote:
I have installed olsr in ns2.29 in ubuntu 11.10 successfully
Interesting. How did you do that ? ?


Quote:
invalid command name "Agent/OLSR"
Indicates that something went wrong with the OLSR patch.
Which patch did you use ?
Or : Are you using an UMOLSR tcl file for MPOLSR ?


Instructions for ns-2.29 / (um)olsr : Post # 17 here ..
http://www.linuxquestions.org/questi...345/page2.html
(Except that for Ubuntu the compiler would usually be g++-4.1 ).

.

Last edited by knudfl; 03-24-2012 at 05:42 PM.
 
Old 03-25-2012, 05:40 AM   #14
lucky89
LQ Newbie
 
Registered: Mar 2012
Posts: 19

Rep: Reputation: Disabled
hi
thanks
i am using the umolsr from site of jiazy, i install it sucessuful
i don't understand the problem??
please help me
 
Old 03-25-2012, 06:38 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 14

Which file.tcl are you trying to use ?
( Your post #12 says "olsr_example.tcl". Where did you find it ? ? )
The only one from http://jiaziyi.com/MP-OLSR.php
... that I know, is "simulation.tcl"
http://www.jiaziyi.com/documents/SER...simulation.tcl


http://jiaziyi.com/MP-OLSR.php , Quote :
"The MP-OLSR is implemented for NS2 simulations. It is an extension of um-OLSR."

Which could mean, that umolsr
https://docs.google.com/open?id=0B7S...bjU4OFQtY2dQUQ
.. should be implemented first, and then next the mpolsr.
Solution : Use the package, that contains both : ns-2.29_mpolsr.rar
http://www.jiaziyi.com/documents/SER....29_mpolsr.rar

.

Last edited by knudfl; 03-25-2012 at 06:48 AM.
 
  


Reply

Tags
g++41-compat, g++41-compat-1204, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ns2.34 installation help in Ubuntu 10.10 xptional Ubuntu 37 02-05-2014 05:01 AM
how to install ns2 in ubuntu 11.10 miu Linux - Networking 20 10-31-2013 02:50 PM
ns2.29 installation in ubuntu bolmeteus Ubuntu 4 02-08-2011 01:46 PM
NS2 2.34 Ubuntu abc Linux - Networking 14 09-16-2010 05:58 PM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM


All times are GMT -5. The time now is 06:36 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration