Ubuntu Hardy 安装ns2

First, you have to download the NS2 allinone installation file from here and untar the compressed file (I’m using release ns2-2.33). Common to Ubuntu distribution, the OS is lack of developer tools like compilers and stuffs. Thus, make sure you already have installed your build essentials. If you haven’t,

 

sudo apt-get install build-essential
sudo apt-get install libc6-dev g++ gcc

 

Next, you’ll need some dependencies which will allow the installation process to be successful. Else, you’ll probably get a “make : *** [tk3d.o ] Error 1 tk8.4.14 make failed !” error .

 

sudo apt-get install autoconf automake libxmu-dev

 

After installation is successful, it’s time to install the NS2/Nam program

 

cd ns-allinone-2.33
./install

 

The installation process will take several minutes (depending on your machine’s processing power) with lots of installation verbose on your terminal. When the installation has ended, it will tell the user that installation is successful.

Next, you’ll need to change some Environment values in order to make your program work correctly.

 

sudo gedit ~/.bashrc

 

Add these lines to your bashrc file. Replace “your directory” with the installation directory of your ns2 program.


#environment values for NS2/NAM
# LD_LIBRARY_PATH
OTCL_LIB=/your directory/ns-allinone-2.33/otcl-1.13
NS2_LIB=/your directory/ns-allinone-2.33/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=/your directory/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/your directory/ns-allinone-2.33/bin:/your directory/ns-allinone-2.33/tcl8.4.18/unix:/your directory/ns-allinone-2.33/tk8.4.18/unix
NS=/your directory/ns-allinone-2.33/ns-2.33/
NAM=/your directory/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
 

 

Then type,

 

source ~/.bashrc

 

Next, you would want to validate the installation process. Go to the library and,

 

cd ns-2.33
./validate

 

This will take a much longer time than the first installation command (./install). After installation, a validation confirmation “validate overall report: all tests passed” will be shown.

 

To use ns2 simulator, just type,

  $> ns

Hope this help for those who are planning to use the NS-2.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值