Centos7安装NS-2.35

NS-2.35的安装

1.首先下载安装包

下载地址:http://www.isi.edu/nsnam/ns/ns-build.html

Centos7安装NS-2.35_第1张图片

下载压缩包名并对其进行解压:

tar -zxvf ns-allinone-2.35.tar.gz

下载相关包:

yum install libX11-devel*

yum install xorg-x11-proto-devel*

yum install libXt-devel*

yum install libXmu-devel*

2.创建目录文件

mkdir /usr/ns-2/NS-2 -p

将解压出来的ns-allinone-2.35移到/usr/ns-2/NS-2下

mv ns-allinone-2.35 /usr/ns-2/NS-2

3.修改文件

vim /usr/ns-2/NS-2/ns-allinone-2.35/ns-2.35/linkstate/ls.h

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

改为:void eraseAll() { this->erase(baseMap::begin(), baseMap::end());

4.开始安装

cd /usr/ns-2/NS-2/ns-allinone-2.35

./install

如出现以下内容则表示安装成功

----------------------------------------------------------------------------------

Please put /usr/ns-2/NS-2/ns-allinone-2.35/bin:/usr/ns-2/NS-2/ns-allinone-2.35/tcl8.5.10/unix:/usr/ns-2/NS-2/ns-allinone-2.35/tk8.5.10/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /usr/ns-2/NS-2/ns-allinone-2.35/otcl-1.14, /usr/ns-2/NS-2/ns-allinone-2.35/lib,
    into your LD_LIBRARY_PATH environment variable.
    If it complains about X libraries, add path to your X libraries
    into LD_LIBRARY_PATH.
    If you are using csh, you can set it like:
        setenv LD_LIBRARY_PATH
    If you are using sh, you can set it like:
        export LD_LIBRARY_PATH=

(2) You MUST put /usr/ns-2/NS-2/ns-allinone-2.35/tcl8.5.10/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.


After these steps, you can now run the ns validation suite with
cd ns-2.35; ./validate

For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.

5.添加环境变量

进入配置文件

gedit .bashrc

添加
export PATH="$PATH:/usr/ns-2/NS-2/ns-allinone-2.35/bin:/usr/ns-2/NS-2/ns-allinone-2.35/tcl8.5.10/unix:/usr/ns-2/NS-2/ns-allinone-2.35/tk8.5.10/unix"

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/ns-2/NS-2/ns-allinone-2.35/otcl-1.14:/usr/ns-2/NS-2/ns-allinone-2.35/lib"

export TCL_LIBRARY="$TCL_LIBRARY:/usr/ns-2/NS-2/ns-allinone-2.35/tcl8.5.10/library"

保存退出

生效

source ~/.bashrc

6.检测NS-2环境

在终端输入ns,若出现%,并且输入nam后可以打开NAM程序,说明环境构建成功:

Centos7安装NS-2.35_第2张图片

 

你可能感兴趣的:(Linux)