tag:blogger.com,1999:blog-79624989303244443932024-02-08T08:25:20.383-08:00NS2 2.34 install on ubuntu 10.04Anonymoushttp://www.blogger.com/profile/03371629401554376520noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7962498930324444393.post-6956650986272296932014-01-24T06:14:00.001-08:002014-02-01T03:54:02.548-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">NS2.34 installation</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><br /></span></span>
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><br /></span></span>
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><br /></span></span>
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">1. Download ns-allinone-2.34
<br />
2.Extract it to any folder, I generally do it on home</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">3. Install the libraries</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">(before install ns-2 you will need the packages that are shown below )</span></span><br />
<b><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><span class="il">$ sudo</span> apt-get update</span></span></b><br /><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><b>$ <span class="il">sudo</span> apt-get install build-essential autoconf automake libxmu-dev</b></span></span><b>
</b><br />
<div>
<b><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><span class="il">$ sudo</span> apt-get install libx11-dev libxmu-dev libxmu-headers libxt-dev libtool<br /><span class="il">$ sudo</span> apt-get install dpkg-dev g++ libc6-dev make<br /><span class="il">$ sudo</span> apt-get install tcl8.4 tk8.4<br /><span class="il">$ sudo</span> apt-get install build-essential</span></span></b></div>
<div style="text-align: left;">
<b><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><span class="il">$sudo</span> apt-get install build-essential autoconf automake libxmu-dev gcc-4.3 </span></span></b></div>
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"> 3. Open terminal (cntrl+alt+t) and type cd ns-allinone-2.34</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">4. type ./install
Now you will get some errors probably.<br />
5. Go to ns-allinone-2.34/otcl-1.13/configure, line number 6304
remove thde line</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">SHLIB_LD="ld -shared"</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">and make it<br />
<b>SHLIB_LD="gcc -shared"</b>
<br />
6. Now go to </span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">ns-allinone-2.34/ns-2.34/
tools/ranvar.cc: In member function ‘virtual double GammaRandomVariable::value()’:<br />
In ns-2.34/tools/ranvar.cc, line 219
replace the line</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">to<br />
<b>return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);</b>
<br />
7. In ns-allinone-2.34/ns-2.34/mac/mac-802_Ext.h, line 65
add</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><b>#include<cstddef></b>
<br />
8.<br />
In ns-allinone-2.34/ns-2.33/mobile/nakagami.cc</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">Find the lines
<br />
if (int_m == m) {<br />
resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();<br />
} else {<br />
resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();<br />
}<br />
return resultPower;<br />
}
And replace with<br /> <b>
if (int_m == m) {<br />
resultPower = ErlangRandomVariable(Pr/m, int_m).value();<br />
} else {<br />
resultPower = GammaRandomVariable(m, Pr/m).value();<br />
}<br />
return resultPower;<br />
}</b></span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">In Makefile.in </span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">find the line </span></span><br />
<pre><span style="font-size: large;"><span style="font-family: Georgia,"Times New Roman",serif;">CC= @CC@</span></span></pre>
<span style="font-size: large;"><span style="font-family: Georgia,"Times New Roman",serif;">
</span></span>
<pre><span style="font-size: large;"><span style="font-family: Georgia,"Times New Roman",serif;">and change it to</span></span></pre>
<span style="font-size: large;"><span style="font-family: Georgia,"Times New Roman",serif;">
</span></span>
<pre><b><span style="font-size: large;"><span style="font-family: Georgia,"Times New Roman",serif;">CC= gcc-4.3</span></span></b></pre>
<br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">Now
go to </span></span><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">ns-allinone-2.34</span></span> </span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">and type</span></span><br />
<b><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">$./configure</span></span></b><br />
<b><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">$make clean</span></span></b><br />
<b><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">$make</span></span></b><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">Path Setup:</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">Open your terminal again and type<br /> <b>gedit ~/.bashrc</b></span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">Then in the end of the page update the env variables append the following lines. Change the path to your path
***************************************************************************<br />
<b># LD_LIBRARY_PATH<br />
OTCL_LIB=/home/anupama/ns-allinone-2.34/otcl-1.13<br />
NS2_LIB=/home/anupama/ns2/ns-allinone-2.34/lib<br />
X11_LIB=/usr/X11R6/lib<br />
USR_LOCAL_LIB=/usr/local/lib<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB
<br />
# TCL_LIBRARY<br />
TCL_LIB=/home/anupama/ns-allinone-2.34/tcl8.4.18/library<br />
USR_LIB=/usr/lib<br />
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
<br />
# PATH<br />
XGRAPH=/home/anupama/ns-allinone-2.34/bin:/home/anupama/ns-allinone-2.34/tcl8.4.18/unix:/home/anupama/ns-allinone-2.34/tk8.4.18/unix<br />
NS=/home/anupama/ns-allinone-2.34/ns-2.34/<br />
NAM=/home/anupama/ns-allinone-2.34/nam-1.14/<br />
PATH=$PATH:$XGRAPH:$NS:$NAM</b></span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">****************************************************************************** </span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">Now , close your terminal</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">Open a new terminal again and type ns</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">U ll see a % coming up which means ns is installed.</span></span><br />
<span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;"><br /></span></span></div>
Anonymoushttp://www.blogger.com/profile/03371629401554376520noreply@blogger.com0