Wednesday, October 5, 2011

NS2 Installation on Fedora 15

1.Before your ns-2 installation following packages must be already installed:
(Type these commands in terminal)
yum install tcl-devel
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


2.Some errors Encountered in Installation with solutions:

.1 Errors relating to GammaRandomVariable.
solution:
Following files need to be edited(in Fedora) for successful installation.
 1.    ~/ns-allinone-2.34/ns-2.34/mobile/nakagami.cc

   In line number 183 replace-
     resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
     with    resultPower = ErlangRandomVariable(Pr/m, int_m).value();
       
    In line number 185 replace-
      resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
      with    resultPower = GammaRandomVariable(m, Pr/m).value();

 2.   ~/ns-allinone-2.34/ns-2.34/tools/ranvar.cc
       
   In line number 219 replace-
   return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
  with   return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

2. Error with following lines:
mac/mac-802_Ext.h:In member function 'u_int32_t PHY_MIBExt::getHdrLen11()':
mac/mac-802_Ext.h:175:19: error: expected primary-expression before 'srtuct'
mac/mac-802_Ext.h:175:41: error: 'dh_body' was not declared in this scope
mac/mac-802_Ext.h:175:51: error: 'offsetof' was not declared in this scope
mac/mac-802_Ext.h:177:3: warning: control reaches end of non-void function [-Wreturn-type]

Solution:

Include the header file "stddef.h" in  the file ~/ns-allinone-2.34/ns-2.34/mac/mac-802_11Ext.h


3. error while loading shared libraries: libotcl.so: cannot open shared object file: No such file or directory

Solution:
The environment variables need to be set. An example is as shown (edit Path according to your system)
export PATH=$PATH:/home/unicorn/ns-allinone-2.34/bin:/home/unicorn/ns-allinone-2.34/tcl8.4.18/unix:/home/unicorn/ns-allinone-2.34/tk8.4.18/unix

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/unicorn/ns-allinone-2.34/otcl-1.13:/home/unicorn/ns-allinone-2.34/lib:/home/unicorn/ns-allinone-2.34/tk8.4.18/unix:/home/unicorn/ns-allinone-2.34/tcl8.4.18/unix/

export TCL_LIBRARY=$TCL_LIBRARY:/home/unicorn/ns-allinone-2.34/tcl8.4.18/library

No comments:

Post a Comment