Showing posts with label ns-2. Show all posts
Showing posts with label ns-2. Show all posts

Thursday, August 29, 2013

Easy steps to install ns-2 in Ubuntu 12.04

For some reason I have started working in ns-2 again and I recently installed ns-2 on Ubantu 12.04LTS. I am writing this blog for the newbies in ns-2. 

Tuesday, April 12, 2011

Something confusing to new NS2 users.

bandwidth_: bandwidth of the physical layer.
basicRate_: transmission rate for control packets such as RTS, CTS, ACK and Broadcast.
dataRate_: transmission rate for mac layer data packets.
for more:
Visit best website for ns, Kliu's website
http://www.cs.binghamton.edu/~kliu/research/ns2code/note.pdf

Thursday, December 9, 2010

Error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

This error comes while installing some applications in Fedora.
It comes because libstdc++.so.5 is installed in other library folders, rather than /usr/lib. If you make symbolic link to /usr/lib from the folder where libstdc++.so.5 is installed. It's solved.

Dommand

ln -s /opt/gcc33/lib/libstdc++.so.5 /usr/lib/libstdc++.so.5

Remember that in my computer /opt/gcc33 is the folder where I have installed new gcc. It can be different in your computer. Just search the libstdc++.so.5.

Monday, December 6, 2010

How to install gcc-3.3 in Ubuntu 9.04

Today I tried to install gcc-3.3 in Ubuntu9.04 in my PC. I followed following steps. I found 2 patches to solve the errors in the Internet.
(NOTE: - means delete, and + means add as in Patch file)

1. Download gcc-core3.3.tar.bz2 and gcc-g++-3.3.tar.bz2
2. bzip2 -cd gcc-core3.3.tar.bz2 | tar xvf -
bzip2 -cd gcc-g++-3.3.tar.bz2 | tar xvf -
3. mkdir build
4. cd build
5. /home/xxxx/gcc/gcc-3.3/configure --prefix=/opt/gcc33 --program-suffix=33 --enable-languages=c,c++

6. If there are errors from /usr/include/bits/studio-lock.h file
then comment the /*#include */
- #include
+ /*#include */
7. If there are errors from gcc/gcc-3.3/include/obstack.h file ("/read-rtl.c:653: error: lvalue required as increment operand")
Change line#423 in
gcc/gcc-3.3/include/obstack.h
- *((void **)__o->next_free)++ = ((void *)datum); \
+ *((void **)__o->next_free) = ((void *)datum);
+ __o->next_free += sizeof(void *); \
8. If there are errors from decl.c file
Apply gcc42-patch-gcc-3.3.1_gcc_cp_decl.c patch from ftp.nsysu.edu.tw/FreeBSD/FreeBSD-current/ports/palm/prc-tools/files/gcc42-patch-gcc-3.3.1_gcc_cp_decl.c
9. If there is an error "gcc/collect2.c:1779:/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared"
Then, in the line number 1776 of gcc/collect2.c
- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
+ redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0666);
10. make
11. Follow http://www.mjmwired.net/resources/mjm-fedora-gcc.html

Few useful commands
:
sudo apt-get install gcc
find /usr/bin |grep gcc
find /usr/bin |grep g++
stat /usr/bin/gcc

$ cd /usr/bin
The default gcc version
$ gcc --v

Delete the old symbolic links
$ sudo rm cpp gcc g++

Change the symbolic links to 3.3: (Find where the gcc33 is installed. In this example we installed in /opt/gcc33/bin (we gave the command while installing gcc as: --prefix=/opt/gcc33).

$sudo ln -s /opt/gcc33/bin/g++33 /usr/bin/g++
$sudo ln -s /opt/gcc33/bin/gcc33 /usr/bin/gcc
$sudo ln -s /opt/gcc33/bin/cpp33 /usr/bin/cpp

Check the default gcc version

$ gcc --v

It should show new gcc version.

Tuesday, November 16, 2010

Problem with NS-2

Problem: Makefile:314 *** commands commence before first target. Stop.
Solution: DO NOT use tab or copy/paste spaces from previous line when you add .o in makefile. Use only space.

Wednesday, June 9, 2010

NS2.31 NAM problem - "[code omitted because of length]"

Problem: While executing NAM in NS2 following error appears. 

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

Solution: 

  1. Download  "tk-8.4-lastevent.patch" patch file from http://bugs.gentoo.org/show_bug.cgi?id=225999
  2. Save the file in tk8.4.x floder (remember that there could be tk8.4.14 or tk8.4.18)
  3. Patch the file with this command

                         patch -p1 < ./tk-8.4-lastevent.patch

    4.  install again (with ./install command)

Now it works perfectly. 

(If there is a problem on patching, change -p1 to -p0. )