Pages

Sunday 18 December 2011

NS-2 Installation on FEDORA and REDHAT

NS-2 INSTALLATION ON FEDORA AND REDHAT:
The installation method of NS-2 on both fedora14 and redhat are same:



 PREPARING THE ENVIRONMENT:
The first step was to check that the development environment was complete and
install any missing tools.
rpm -q wget
rpm -q gcc-c++
rpm -q libX11-devel
rpm -q xorg-x11-proto-devel
rpm -q libXt-devel
rpm -q libXmu-devel

From terminal login as super user type:
yum install autoconf
yum install automake
yum install gcc-c++
yum install libX11-devel


yum install xorg-x11-proto-devel
yum install libXt-devel
yum install libXmu-devel


Download a copy of ns-allinone-2.34.tar.gz by the command

wget http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz/download

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

PROBLEM IN INSTALLATION IN FEDORA 14:
While installation the following error will occur:
---------------------------------------------------------------------------------------------------------------------
tools/ranvar.cc: in member function `virtual double gammarandomvariable::value()':
tools/ranvar.cc:219:70: error: cannot call constructor `GammaRandomVariable::GammaRandomVariable'
tools/ranvar.cc:219:70: error: for a function-style cast, remove the redundant
`::GaammaRandomVariable'
make: *** [tools/ranvar.o] Error 1
ns make failed
------------------------------------------------------------------------------------------------------------------------
To remove it:
------------------------------------------------------------------------------------------------------------------------
Edit this file-- ./ns-allinone-2.34/ns-2.34/mobile/nakagami.cc
In line number 183 instead of--
resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
write--
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
In line number 185 instead of--
resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
write--
resultPower = GammaRandomVariable(m, Pr/m).value();

And also edit the file-- ./ns-allinone-2.34/ns-2.34/tools/ranvar.cc
In line number 219 instead of--
return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
write--
return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
---------------------------------------------------------------------------------------------------------------------------
Also ns-2.30 cannot install on fedora 14 it will give the following errors
----------------------------------------------------------------------------------------------------------------------------
make: g++: Command not found
make: *** [tcl2c++] Error 127
tclcl-1.19 make failed! Exiting ...
-----------------------------------------------------------------------------------------------------------------------------
It is because of the OS which is so new and the rest of the software has not caught up to it yet
Install the bit older gcc 4.3 or 4.1 and export it.
 The install command must be :
export CC=gcc34 CXX=g++34 && ./install

Set the environment variable
# cd /etc/
# vi /etc/.bashrc
Press i for the insert mode and Put the path as mentioned above, press esc and write :wq
# source ~/.bashrc

And then validate it
# cd ./validate

In fedora by default xgraph is not installed first make some changes in the .cc file of xgraph, replace the getline with mygetline then congifure it and make it.

No comments:

Post a Comment