Patch NS2 & Install on Fedora 14
NS2 Pops up errors during Install on Fedora 14 due to change in GCC version 3.5, has major changes like it accept X() rather than X::X(), which affected ns2.
Only 2 files needs to be changed
~ns-allinone-2.34/ns-2.34/mobile/nakagami.cc &
~ns-allinone-2.34/ns-2.34/tools/ranvar.cc
patch
~ns-allinone-2.34/ns-2.34/mobile/nakagami.cc ( Line 183 & 185 )
--resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
++resultPower = ErlangRandomVariable(Pr/m, int_m).value();
--resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
++resultPower = GammaRandomVariable(m, Pr/m).value();
~ns-allinone-2.34/ns-2.34/tools/ranvar.cc ( Line 118 )
--return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
++return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
Now to install
The ns2 version taken here is 2.34 (ns-allinone-2.34) .Please modify to suit your version
Pre-Installation:
Before NS2 installation somepackages must be installed. Required packages are:
yum install gcc tcl-devel libX11-devel libXt-devel
Installation:
> Uncompress the ns2 use GUI or Terminal
tar zxvf ns-allinone-2.34.tar.gz
orion
gzip -d ns-allinone-2.34.tar.gz
tar xvf ns-allinone-2.34.tar
> cd /home/user/Desktop/ns-allinone-2.34
> ./install (execute the script)
> If the installation fails in the middle, then try to install the linux packages that are missing
> Once the installation succeeded, then a set of path information will be provided by the NS2
> Set the path in the /root/.bash_profile
(vi /root/.bash_profile)
or
If you are a user home//.bash_profile (for example, if your the username is tsp, then execute this command vi /home/tsp/.bash_profile)
You MUST put /home/~/Desktop/ns-allinone-2.31/otcl-1.13, /home/~/Desktop/ns-allinone-2.31/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=
> go to the terminal and try ns or nam
> for running the examples comes along with the distribution of NS2
cd ns-allinone-2.31/ns-2.31/tcl/ex
After these steps, you can now run the ns validation suite with
cd ns-2.31; ./validate

Comments
Post new comment