This post will help you in installing Network Simulator 2 version NS2.35 in Ubuntu 11.10
Instructions
export PATH=$PATH:<Place your paths here>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: <place the LD_LIBRARY_PATHS> here.
Once done, save the file and close
execute the command
source .bashrc
try ns or nam to see whether your installation succeeded.
Instructions
- Install Ubuntu
- Download NS-2.35 (http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download)
- Unzip or untar it to any folder (recommended is /home/loginname) using the following commands one by one
sudo apt-get update
sudo apt-get install build-essential autoconf automake libxmu-dev
tar zxvf ns-allinone-2.35.tar.gz
cd ns-allinone-2.35
./install
- Once installed the PATH information will be provided to you.
- Copy the PATH and LD_LIBRARY_PATH Variable to .bashrc (see a dot in the beginning)
export PATH=$PATH:<Place your paths here>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: <place the LD_LIBRARY_PATHS> here.
Once done, save the file and close
execute the command
source .bashrc
try ns or nam to see whether your installation succeeded.
Hi dude i have installed ns-allinone-2.35 in ubuntu11.10 but at the time of "Nam" simulation it shows some error..like this
ReplyDeleteerror is given below
------------------------
"
You have installed Tcl 8.5.10 actually
exactly need Tcl8.4 only
"
How i solve this help ? my mail id is :: "mohandassvit@gmail.com"
Thank u for the steps.. i got ns2 installed successfully.. but when i try to install nam it tells package tcl 8.4 is needed
ReplyDeletebut did you tried the informatin what is given in this post. may be you wud have tried ns-2.34
ReplyDeletewhen i give "sudo apt-get build-essential autoconf automake libxmu-dev" it tells
ReplyDeleteE: Invalid operation build-essential
what can i do?
The command missed a word. You ought to give sudo apt-get install build-essential autoconf automake libxmu-dev
Deletesudo apt-get install build-essential autoconf automake libxmu-dev
Deleteinstall is missing in this commad
did you tried sudo apt-get update before doing the above.... or does your internet uses proxy for downloading...
ReplyDeleteHi,
DeleteI have same problem As Jeni..
when i give "sudo apt-get build-essential autoconf automake libxmu-dev" it tells
E: Invalid operation build-essential
I also updated my system,but as you said that ""...or does your internet uses proxy for downloading.""
Yes,I am using proxy for downloading.
So,What can I do now?
see this post for setting proxy in ubuntu
Deletehttp://www.pradeepkumar.org/2010/06/http_proxy-in-ubuntu.html
yes.. the first step sudo apt-get update went successfully.. for the next step it gives me the above error..
ReplyDeletei got ns2 installed.. i gave "sudo apt-get install automake autoconf libxmu-dev build-essential" line now..it worked.. thanks a lot....
ReplyDeletethankss jeni
Deletethanx jenni it worked.
Deletethanx jenni it worked.
DeleteThanks, Jenni
Deletethanx jeni...
Deletesudo apt-get install build-essential autoconf automake libxmu-dev
ReplyDeletei got installed..but when i close the terminal and open and type ns it says ns not installed… is there any final step after the above procedure?
ReplyDeletei have the same problem like jeni... i have tried sudo apt-get update but still like that..
ReplyDeleteHi dude i have tried both package installation(ns2.34,ns2.35)in ...."ubuntu 11.10".... but i got the same error like...
ReplyDelete"You have installed Tcl 8.5.10 actually
exactly need Tcl8.4 only "
help me out from the problem plz.............!
dont instal the build in ns2 package in ubuntu..u wont get that error..
ReplyDeletens is working fine but nam is throwing the below error
ReplyDeletenam:
[code omitted because of length]
: version conflict for package "Tcl": have 8.5.10, need exactly 8.4
while executing
"package require -exact Tcl 8.4"
i ve tried removing the build package like jeni said but it is still throwing the same error
i ve even tried installing older version of TCL
pls help me out...
Please ensure if you have compiled the needed .cc file. I got the same error and included the relevant .o file in Makefile and then did a make and then ran ns, it worked fine.
DeleteI just read some topics that ns2 is not working properly on Ubuntu 11.10 ,, try... Ubuntu 10.4
ReplyDeleteit is almost 56 hours trying to install NS2 on ubuntu 11.10 by inbuilt package it gives error "TCl 8.4 needed " after Mr.pradeepkumar process it give me bash: ./install: Permission denied.Please Help.......
ReplyDeletedont try with the inbuilt package, in that you cannot recompile ns2. try with the method given in my website.
ReplyDeleteIm also getting bash: ./install: Permission denied.
Deletewhat do u mean "inbuilt package" ????
Thanks a lot Sir,your method is very good as well simple .Also it is good to see that some body helps us without any selfishness,
ReplyDeletebut problem is that by ur method it shows message
"/home/gagan/ns-allinone-2.35/tk8.5.10/unix/../generic/tk.h:76:23: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [tk3d.o] Error 1
tk8.5.10 make failed! Exiting ...
For problems with Tcl/Tk see http://www.scriptics.com
did u tried this command
ReplyDeletesudo apt-get update
After religiously running "sudo apt-get update" command ,and updating 200 mb of updates,then i follow your process sir ,but this time error is
ReplyDelete"/home/gagan/ns-allinone-2.35/tk8.5.10/unix/../generic/tk.h:76:23: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [tk3d.o] Error 1
tk8.5.10 make failed! Exiting ...
For problems with Tcl/Tk see http://www.scriptics.com"
.........sir please suggest me any other OS that is best suitable for install NS2.
ReplyDeleteOk Sir then i run command
ReplyDelete"
sudo apt-get install libx11-dev
"
setup move forward then
then again it shows error message
"
checking for X11 header files
can't find X includes
otcl-1.14 configuration failed! Exiting ..."
then i run command "apt-file update
apt-file search X11/Xlib.h
"
Mostly I learnt the lesson that keep your internet connection open while installing Ubuntu
then the error is
checking for X11 header files
can't find X includes
otcl-1.14 configuration failed! Exiting ...
can't find X includes
ReplyDeleteotcl-1.14 configuration failed! Exiting ...
Solutions-------------is-------------here---------------
install ns2 error: checking for X11 header files can't find X includes otcl-1.13 configuration failed! Exiting .. solution: sudo apt-get install libx11-dev sudo apt-get install libxt-dev ============================================================================================================================ mrperf related: sudo apt-get install libxml2 then error: /usr/bin/ld: cannot find -lxml2 solution: sudo apt-get install libxml2-dev error: /usr/bin/ld: cannot find -lz solution: sudo apt-get install zlib1g-dev
Installed successfully as i am greenhorn to ubuntu or Linux please tell me how to Copy the PATH and LD_LIBRARY_PATH Variable to .bashrc
ReplyDeletehi sir m installin ns2.35 via wifi but wile enterin 2nd command it throwing error as build-essential as invalid pls help me
ReplyDelete"You have installed Tcl 8.5.10 actually
ReplyDeleteexactly need Tcl8.4 only "
for guys who get error of this kind...I want to ask one question " Have you installed ns2.34 before installing ns2.35? If that was the case, then you might have used the command "install ns2 nam xgraph" to install ns2.34 Then you might have used the command autoremove to uninstall ns2 But nam is still installed..The solution is now you go to software manager to uninstall nam(it will ask to uninstall dependencies also...no problems remove them also) now try and execute any tcl files, it will work...
Sir,
ReplyDeleteI try to install nsallinone-2.34 in ubuntu 11.10. It gives following error. Please guide me..
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/sesho/ns-allinone-2.34/include -I/home/sesho/ns-allinone-2.34/include -I/home/sesho/ns-allinone-2.34/include -I/include otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch’:
/home/sesho/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local’
otcl.o: In function `Otcl_Init’:
/home/sesho/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local’
ld: libotcl.so: hidden symbol `__stack_chk_fail_local’ isn’t defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting …
I have the same problem as "Anonymous said", if you fixed this problem, pleace, tell me how.
ReplyDeletere,
ReplyDeleteI could fix this problem by executing these instruction:
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"
I suggest to follow these instructions to install NS2.34 on Ubuntu 11.04 http://erl1.wordpress.com/2011/05/12/installing-ns-2-34-on-ubuntu-11-04/
or on Ubuntu 11.10 http://erl1.wordpress.com/2011/10/14/installing-ns-2-34-on-ubuntu-11-10-oneiric-ocelot/#comment-233
Good luck
hello. I'm new to NS. I just installed ns2 on my Ubuntu 11.10 machine by looking at discussions above. And now im tyring to run ex1.tcl but somehow i can't make it run. it gives me the following error. I google-d a little bit, however couldnt find a solution.
ReplyDelete[code omitted because of length]
: version conflict for package "Tcl": have 8.5.10, need exactly 8.4
while executing
"package require -exact Tcl 8.4"
Can anybody please help me?
Thanks
Hello
ReplyDeleteAm new to installing ns2.
I have completed almost all procedures
But when i write this ./install , it shows that “bash: ./install: No such file or directory”
So that i tried to do run this command “root@nsn:/home/nsn/ns-2.35# ./configure”
then i got this error
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking minix/config.h usability… no
checking minix/config.h presence… no
checking for minix/config.h… no
checking whether it is safe to define __EXTENSIONS__… yes
No .configure file found in current directory
Continuing with default options…
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking target system type… i686-pc-linux-gnu
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking for ANSI C header files… (cached) yes
checking for string.h… (cached) yes
checking for main in -lXbsd… no
checking for socket in -lsocket… no
checking for gethostbyname in -lnsl… yes
checking for dcgettext in -lintl… no
checking for getnodebyname in -ldnet_stub… no
checking that g++ can handle -O2… no
checking if C++ libraries work without any namespace… no
checking if C++ libraries work with namespace std… yes
checking if STL works without any namespace… no
checking if STL works with namespace std… yes
checking should use STL… yes
./configure: line 5453: tclsh: command not found
checking for tcl.h… no
checking for tclInt.h… no
checking for libtcl… no
checking for init.tcl… no
checking for http.tcl… no
checking Tcl http.tcl library… configure: error: Couldn’t find http.tcl in /http /http2.5 /http2.4 /http2.3 /http2.1 /http2.0 /http1.0
How to solve this problem?
No .configure file found in current directory
ReplyDeleteContinuing with default options...
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
can anyone help me to resolve this error
i'm trying to install ns2.35 on ubuntu 11.10.
ReplyDeleteafter the ./install , i got this error.
please help me to get over this error.
* Build Tclcl-1.20
============================================================
No .configure file found in current directory
Continuing with default options...
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
./install: 524: ./configure: Permission denied
ReplyDeleteotcl-1.13 configuration failed! Exiting ...
Please check http://www.isi.edu/nsnam/ns/ns-problems.html
for common problems and bug fixes.
error occuring while installing ns-2.34 in ubuntu 11.04
complete installation of ns2.35 in ubuntu can be seen here without any problem
ReplyDeletehttp://dalbirsinghrana.blogspot.in/2012/02/installation-of-ns2-in-ubuntu-ubuntu.html
I just followed the given steps & all went fine. Now ns2 & nam are working properly.
ReplyDeleteThank you very much, Sir !!
I just followed the given steps & all went fine. Now ns2 & nam are working properly.
ReplyDeleteThank you very much, Sir !!
I had a great problem in installing NS2 in ubuntu 11.10. I installed it several time from the the unbuntu software center but it did not work. I visit this blog and solved all my problem. I thank all of you, especially jeny and Paradeep kumar who gave useful suggestions in this blog.. Thanks a lot once again.
ReplyDeletehi, i'm installing ns2.35 and i have tcl8.5.10 configuration failed could you help me please
ReplyDeleteyou can also try micman tutorial but u have to change the tcl ,nam etc versions in bash file...it will work fine.
ReplyDeletehow to uninstall ns2.35 from the system ? .. then have to install ns2.38 .. how to go about it?
ReplyDeletejust delete the folder ns-allinone-2.38 and clear the path information where you have set already. thats it!!!
Deletesir,can you give me the code clearly again...its not working properly....i tried lot...its very complicated to install without proper information...
ReplyDeletevisit http://silentsaikat.com/?cat=21
ReplyDeletethe above website http://www.silentsaikat.com is copying posts from other websites.... please beware of these sites...
ReplyDeletePlease update the post ..about line "sudo apt-get build-essential autoconf automake libxmu-dev"
ReplyDeleteto
"sudo apt-get install build-essential autoconf automake libxmu-dev"
sir i have installed ns-2.35 in ubuntu 11.10 by following your instructions and i checked it by typing nam and ns as after typing ns it shows '%'
ReplyDeletei think it is installed successfully but now how shall i start working on it after installation
sir please reply asap
During Installation
ReplyDeleteIt ask for the below step.
(2) You MUST put /home/kirti/ns-allinone-2.35/tcl8.5.10/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.
How to put this path in the desired environment?
and after installation how to start NS-2.?
tar zxvf ns-allinone-2.35.tar.gz
ReplyDeleteerror is occur after this command that "no such directory is available"
error is not recoverable...
what i will do now????
may be you are trying in a different directory, please use the command "pwd" (without quotes) to find out the path you are working.
Deleteall step is correct and working fine: this is my case ns 2.35 with ubuntu 11.10 :
ReplyDelete//NS2.35 on UBUNTU 11.10
cd /home/myuser
tar zxvf ns-allinone-2.35.tar.gz
sudo apt-get install build-essential
sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
sudo apt-get install libxmu-dev libxmu-headers
sudo apt-get remove gcc
sudo apt-get update
sudo apt-get build-essential autoconf automake libxmu-dev
tar zxvf ns-allinone-2.35.tar.gz
cd /home/myuser/ns-allinone-2.35
./install
// ADD FOLLOWING LINES on .bashrc file (/home/myuser/.bashrc):
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/ns-allinone-2.35/otcl-1.14
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/ns-allinone-2.35/lib
export TCL_LIBRARY_PATH=$TCL_LIBRARY_PATH:/home/myuser/ns-allinone-2.35/tcl8.5.10/library
source ./bashrc
Hi Pradeepkumar T S,
DeleteCould you please give me the exact steps to uninstall ns-2.34 from ubuntu 11.04? I am not well versed with unix commands. Please help!!!
Delete the ns-allinone-2.34/ folder and remove the path settings set in .bash_profile or .bashrc.
DeleteI could not find the path settings in my .bashrc file. I used the command "gedit ~/.bashrc" in the terminal to open the file. Is it the right way to access .bashrc for the removal of the path settings?
Deleteyou can open the .bashrc in the home folder(for example if your login is pradeep, then the file will be located at /home/pradeep
Deletejust to these steps
type this command to find out your home
echo $HOME
and type
cd $HOME
and then
gedit .bashrc
[root@localhost ~]# nam
ReplyDeletenam: Can't find a usable tk.tcl in the following directories:
/root/ns-allinone-2.35/tcl8.5.10/library/tk8.5 /root/ns-allinone-2.35/tcl8.5.10/tk8.5 ./lib/tk8.5 /root/ns-allinone-2.35/lib/tk8.5 ./library
/root/ns-allinone-2.35/lib/tk8.5/tk.tcl: wrong # args: should be "::source fileName"
wrong # args: should be "::source fileName"
while executing
"::source -encoding utf-8 /root/ns-allinone-2.35/lib/tk8.5/msgs/en.msg"
("uplevel" body line 1)
invoked from within
"uplevel 1 [list ::source -encoding utf-8 $langfile]"
(procedure "::msgcat::mcload" line 10)
invoked from within
"::msgcat::mcload [file join $::tk_library msgs]"
(in namespace eval "::tk::msgcat" script line 23)
invoked from within
"namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {package require msgcat}]} {
# The msgcat package..."
(in namespace eval "::tk" script line 3)
invoked from within
"namespace eval ::tk {
# Set up the msgcat commands
namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {p..."
(file "/root/ns-allinone-2.35/lib/tk8.5/tk.tcl" line 21)
invoked from within
"source.orig /root/ns-allinone-2.35/lib/tk8.5/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /root/ns-allinone-2.35/lib/tk8.5/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $file]"
This probably means that tk wasn't installed properly.
please help what to do????
i install ns2.35 over fedora 16 after successful l installation. i got problem when enter nam it,s give me following error plz help how to fix.
ReplyDelete[root@localhost nam-1.15]# nam
nam: Can't find a usable tk.tcl in the following directories:
/root/ns-allinone-2.35/tcl8.5.10/library/tk8.5 /root/ns-allinone-2.35/tcl8.5.10/tk8.5 ./lib/tk8.5 /root/ns-allinone-2.35/lib/tk8.5 ./library
/root/ns-allinone-2.35/lib/tk8.5/tk.tcl: wrong # args: should be "::source fileName"
wrong # args: should be "::source fileName"
while executing
"::source -encoding utf-8 /root/ns-allinone-2.35/lib/tk8.5/msgs/en.msg"
("uplevel" body line 1)
invoked from within
"uplevel 1 [list ::source -encoding utf-8 $langfile]"
(procedure "::msgcat::mcload" line 10)
invoked from within
"::msgcat::mcload [file join $::tk_library msgs]"
(in namespace eval "::tk::msgcat" script line 23)
invoked from within
"namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {package require msgcat}]} {
# The msgcat package..."
(in namespace eval "::tk" script line 3)
invoked from within
"namespace eval ::tk {
# Set up the msgcat commands
namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {p..."
(file "/root/ns-allinone-2.35/lib/tk8.5/tk.tcl" line 21)
invoked from within
"source.orig /root/ns-allinone-2.35/lib/tk8.5/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /root/ns-allinone-2.35/lib/tk8.5/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $file]"
This probably means that tk wasn't installed properly.
please guide and give me step to fix the problem
send me olsr patch for ns-2.35 sir
ReplyDeletehi when i execute this program in ns2 i get this #define object
ReplyDeleteset ns [new simulator]
#defile nam and trace files
set nf [open out.nam w]
$ns namtrace-all $nf
#define proc finish
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
$ns at 5.0 "finish"
$ns run
i get this problem
invalid command name "simulator"
while executing
"simulator create _o3 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new simulator"
invoked from within
"set ns [new simulator]"
plz help.
how to set path and library path variables, please tell?
ReplyDeletesir when i was trying to install ns-allinone-2.35 on ubundu 10.10 i got an error message ./install :499 ./configure
ReplyDeletePermission denied
Please help me to solve this
Sir while adding a new protocol wfrp into ns2.34 i'm getting error 1 while executing make clean or make all commands....
ReplyDeleteSir,
ReplyDeleteI have followed all the steps of ns2 installation for installing ns2.35 in ubuntu 11.10.
after all the steps when I run the command validate it says overall report : all tests passed.
but when I type ns it says ns currently not installed.
I have checked the paths given in bashrc file also.
Please help me sir now what should I do?
I am getting following error on NS2 installation
ReplyDeletechecking for X11 header files
can't find X includes
otcl-1.13 configuration failed! Exiting ...
Please check http://www.isi.edu/nsnam/ns/ns-problems.html
for common problems and bug fixes.
Can anybody suggest how to fix it?
For octl-1.1x issues do this:
ReplyDeletesudo apt-get install libxt-dev
comment faire pour copier le path et ld_library_path
ReplyDeletei installed ns-2 and set path, but when i type ns, it shows command not found
ReplyDelete