Tuesday, January 30, 2018

How To Install Ns 2.34 Inward Ubuntu 16.04?

Install NS 2.34 inwards Ubuntu 16.04 

 guys inwards this post I am gonna demo yous that how to  How to Install NS 2.34 inwards Ubuntu 16.04?
NS-2.34
Hi, guys inwards this post I am gonna demo yous that how to install NS 2.34 inwards Ubuntu 16.04 step past times stepWhile Installing Network Simulator 2 (NS2) yous postulate to commencement brand few changes inwards around files. Also, you postulate an active mesh connexion because yous postulate to update Ubuntu commencement as well as to download the required few packages to live pre-installed.

Step: 1

Open a lastly as well as type the next ascendance i past times one. Wait until the procedure gets consummate as well as and then types around other command. Also, brand certain receive got an active mesh connection.
sudo apt-get update
sudo apt-get install build-essential autoconf automake libxmu-dev
At the fourth dimension of writing this tutorial, gcc-4.9 was the latest version.
sudo apt-get install gcc-4.9

Step: 2

You volition postulate to Download NS 2.34. (Download Here). After downloading this file Extract it into your root directory using the next command. Don't forget to supervene upon your user name.
tar xvzf ns-allinone-2.34.tar.gz -C /home/YOUR-USER-NAME-HERE
or yous tin practise this directly. Just Right click on the file as well as click on Extract here.

Step: 3

Now opened upwards  ns-allinone-2.34/otcl-1.13/configure
Replace the next line
Linux*)
SHLIB_CFLAGS="-fpic"
SHLIB_LD="ld -shared"
SHLIB_SUFFIX=".so"
DL_LIBS="-ldl"
SHLD_FLAGS=""

amongst the following

Linux*)
SHLIB_CFLAGS="-fpic"
SHLIB_LD="gcc -shared"
SHLIB_SUFFIX=".so"
DL_LIBS="-ldl"
SHLD_FLAGS=""
Step: 4

Now opened upwards  ns-allinone-2.34/ns-2.34/tools/ranvar.cc In trouble 219, brand the next changes.
Replace this line

supply GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

amongst the following

supply GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

Step: 5

Now opened upwards  ns-allinone-2.34/ns-2.34/mac/mac-802_11Ext.h In line 65, add the next header.
#include "cstddef"
Step: 6

Now opened upwards  ns-allinone-2.34/ns-2.34/mobile/nakagami.cc
Find the next code
if (int_m == m) {
resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
} else {
resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
}
return resultPower;
}

And supervene upon amongst the following

if (int_m == m) {
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
} else {
resultPower = GammaRandomVariable(m, Pr/m).value();
}
return resultPower;
}
}

Step: 7

Now opened upwards  ns-allinone-2.34/ns-2.34/linkstate/ls.h
In trouble 137, alter the next line

void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

And supervene upon amongst the following

void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }
Step: 8

Now opened upwards  Navigate to the ns-allinone-2.34 folder:
Open lastly as well as and then type the following
cd /ns-allinone-2.34
./install
That's it. . . Now await for NS2 it volition accept x to fifteen minutes or peradventure more.

Step: nine (Last step)
Open lastly as well as and then type the following
gedit .bashrc
And as well as then Paste the next code at the END simply don't forget to alter your User-Name

# LD_LIBRARY_PATH
OTCL_LIB=/home/
Your-User-Name/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/
Your-User-Name/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/
Your-User-Name/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/
Your-User-Name/ns-allinone-2.34/bin:/home/Your-User-Name/ns-allinone-2.34/tcl8.4.18/unix:/home/Your-User-Name/ns-allinone-2.34/tk8.4.18/unix
NS=/home/
Your-User-Name/ns-allinone-2.34/ns-2.34/
NAM=/home/
Your-User-Name/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM
Meanwhile, inwards the Terminal, if the installation completes without whatever error, as well as then closed the terminal, as well as reopen it as well as type the next command:
ns
if % sign appears agency the installation has been successful. Sharing is Caring. If yous similar this must portion it amongst your friends.