Install NS2 on Ubuntu

本文提供了一种简单的五步安装NS2的方法。步骤包括下载NS2 all-in-one版本、配置依赖项、编译源代码、设置环境变量及验证安装成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://blog.ceglug.org/venkat/?p=26


Installing NS2 in simple 5 steps

Posted on August 23 2009 by Venkatanathan

Step 1: Download the source for NS2 all in one (I used this version ns-allinone-2.34.tar.gz ) from the link http://sourceforge.net/projects/nsnam/files/

Step 2: Extract the tar.gz file downloaded into your home folder by right-clicking the tag.gz file

Step 3: Open terminal (Applications–>Accessories–>Terminal) and change the directory (using cd command) to the extracted folder and execute the following:

sudo apt-get install build-essential autoconf automake libxmu-dev

This will install the dependencies required to compile NS2 from the source.

The following command is used to compile the source.

./install

It will take long time to compile all the required packages for ns to work…

Step 4: Setting Environmental Variables

Type in terminal:

gedit ~/.bashrc

and append the following text to the opened file (Please note that the path contains the path in my system, replace “venkat” in path with your username)

# LD_LIBRARY_PATH
OTCL_LIB=/home/venkat/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/venkat/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/venkat/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/venkat/ns-allinone-2.34/bin:/home/venkat/ns-allinone-2.34/tcl8.4.18/unix:/home/venkat/ns-allinone-2.34/tk8.4.18/unix
NS=/home/venkat/ns-allinone-2.34/ns-2.34/
NAM=/home/venkat/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM

Step 5: Now, after editing the file, save and close it. Then in terminal type:

source ~/.bashrc

Try “ns” command, it shud go to the “%” prompt then it just means the installation was successful! Enjoy :D

Note: These steps have been tested and worked like breeze in Ubuntu and is expected work in all the debian based linux.

Reference:

1.) http://nsnam.isi.edu/nsnam/index.php/Installing_ns2.31_on_Ubuntu7.04
2.) http://alkautsarpens.wordpress.com/2008/02/05/install-ns231-for-ubuntu-gutsy-710/
3.) http://www.isi.edu/nsnam/ns/ns-build.html (Might not be needing this, but just in case)



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值