UBuntu 12.10 + NS2.34下leach协议添加

来源:互联网 发布:手机看图集软件 编辑:程序博客网 时间:2024/04/28 00:53
在NS2.34下添加leach协议花了太多时间,总结了各路大神发的帖子,终于安装成功了,特此分享,希望各位少走弯路。

NS2.34安装准备工作

sudo apt-get install build-essential autoconf automake
sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
sudo apt-get install libxt-dev libxmu-headers libx11-dev libxmu-dev
sudo apt-get install xorg-dev perl xgraph

NS2.34+leach 安装
下载NS2.34,这个不用多说。
1) tar xvf ns-allinone-2.34.tar.gz
2) cd ns-allinone-2.34/
3) tar xvf leach+pegasis-ns234-files-2.tar.gz
4) sudo dpkg -i gcc41-compat-4.1.2.ubu1204_i386.deb g++41-compat-4.1.2_i386.deb   
(在命令行输入which gcc41出现 /usr/gcc41/bin/gcc41表示安装成功)
5) sudo dpkg -i pegasis-ns-2.34-ubuntu10_i386.deb
6) export CC=gcc41 CXX=g++41
7) ./install
8) cd ns-2.34/ && sudo make install
9) cd ../nam-1.14 && sudo make install
10) cd ../../ && sudo gedit .bashrc
在最后添加:export RCA_LIBRARY=/home/fusion/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/fusion/ns-allinone-2.34/ns-2.34/mit/uAMPS 
将其中fusion更改为自己的用户名
11) 将./test和./lech_test文件中‘ns’命令更改为'ns-pegasis'否则leach会出现错误
即分别将
ns wireless-demo-csci694.tcl 改为 ns-pegasis wireless-demo-csci694.tcl
ns tcl/ex/wireless.tcl  \ 改为  ns-pegasis tcl/ex/wireless.tcl  \
11) cd ns-allinone-2.34/ns-2.34 && ./test


替换掉下面文件中“tomas”为自己的用户名
Finding all files with ``tomas´´ in tcl/ :
$ grep -Rn tomas tcl/
tcl/mobility/leach-c.tcl:9:source /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-leach.tcl
tcl/mobility/leach-c.tcl:10:source /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-leach-c.tcl
tcl/mobility/mte.tcl:8:source /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-mte.tcl
tcl/mobility/pegasis.tcl:11:source /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-pegasis.tcl
tcl/mobility/stat-clus.tcl:12:source /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-leach.tcl
tcl/mobility/stat-clus.tcl:13:source /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-leach-c.tcl
tcl/mobility/stat-clus.tcl:14:source /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-stat-cluster.tcl


gcc41下载地址
https://drive.google.com/file/d/0B7S...it?usp=sharing
g++41下载地址
https://drive.google.com/file/d/0B7S...it?usp=sharing
leach+pegasis下载
https://drive.google.com/file/d/0B7S...it?usp=sharing
pegasis-ns-2.34-ubuntu10_i386.deb下载地址
https://drive.google.com/file/d/0B7S255p3kFXNWlBnd0xMUWRhYzQ/edit?usp=sharing

另外推荐一个好的网址,如果有不能解决的问题可以去发帖,里面牛人很多
http://www.linuxquestions.org/questions/tags/leach/
0 0