Solaris 8 Sparc平台下NS的安装
Solaris 8 Sparc平台下NS的安装
柴大鹏
欧米伽科技商务咨询(山东)有限公司
关键字:NS Solaris Sparc
前言
NS是一款非常优秀的网络模拟软件,但我第一次听说它却是在两天前高级网络技术课上。为了更好的练习,我按照老师给的地址从网站上下载了最新的版本(ns-allinone-2.28.tar.gz),并在solaris 8 sparc平台下进行了安装。其实,安装的过程并不复杂,但是安装过程中遇到了一些奇怪的问题,在网上搜索解决方案的时候,发现有很多朋友也遇到类似的问题(在安装其他的软件,如gcc,tcl),所以就简单做了一个总结,希望以后对遇到类似情况的朋友有所帮助。
准备工作
软件名称
下载地址
Gcc
http://mirrors.xmission.com/sunfreeware/sparc/8/gcc-3.0.3-sol8-sparc-local.gz
Autoconf
http://mirrors.xmission.com/sunfreeware/sparc/8/autoconf-2.59-sol8-sparc-local.gz
Automake
http://mirrors.xmission.com/sunfreeware/sparc/8/automake-1.9-sol8-sparc-local.gz
Make
http://mirrors.xmission.com/sunfreeware/sparc/8/make-3.80-sol8-sparc-local.gz
binutils
http://mirrors.xmission.com/sunfreeware/sparc/8/binutils-2.11.2-sol8-sparc-local
Ns2
http://www.isi.edu/nsnam/dist/ns-allinone-2.28.tar.gz
安装NS2
1. 安装gcc、autoconf等软件
gcc、autoconf等软件的安装比较简单,如果您没有这方面的经验,请查找相关的资料,这里仅以gcc为例给出简单的说明。
a) 将下载的软件通过ftp上传到安装有solaris 8的Sun服务器上;
b) 以root身份登陆系统;
c) 打开一个控制台,运行:
gunzip gcc-3.0.3-sol8-sparc-local.gz
pkgadd –d gcc-3.0.3-sol8-sparc-local
注意:binutils-2.11.2-sol8-sparc-local.gz是一定要安装的,很多朋友认为安装好了gcc就可以了,因而在安装NS的时候遇到下面的错误:
/usr/ccs/bin/as: "/var/tmp/ccXrTXhw.s", line 3839: error: unknown opcode ".subsection"
这就是因为没有安装这个软件包引起的。
2. 安装NS2
a) 将下载的软件通过ftp上传到服务器上;
b) 以root身份(或者其他用户身份)登陆系统;
c) 打开一个控制台,运行:
gzip –d ns-allinone-2.28.tar.gz
tar xvf ns-allinone-2.28.tar
cd ns-allinone-2.28
./install
上面的步骤完成后,你会看到控制台中出现很多信息,如果有类似如下的信息,那么恭喜你安装成功,你可以进行后续的配置工作。
Nam has been installed successfully.
Please compile your gt-itm & sgb2ns separately.
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.5: /export/home2/dpchai/tools/ns-allinone-2.28/{bin,include,lib}
tk8.4.5: /export/home2/dpchai/tools/ns-allinone-2.28/{bin,include,lib}
otcl: /export/home2/dpchai/tools/ns-allinone-2.28/otcl-1.9
tclcl: /export/home2/dpchai/tools/ns-allinone-2.28/tclcl-1.16
ns: /export/home2/dpchai/tools/ns-allinone-2.28/ns-2.28/ns
nam: /export/home2/dpchai/tools/ns-allinone-2.28/nam-1.11/nam
xgraph: /export/home2/dpchai/tools/ns-allinone-2.28/xgraph-12.1
打开用户目录下的.cshrc文件(如果你使用的是其他的shell,请打开相应的文件),按照下面的信息进行操作。为了便于说明,我们将信息进行分块,在文章的最后,我们会给出一个完整的cshrc文件的示例,您可以根据情况进行适当的修改。
Please put /export/home2/dpchai/tools/ns-allinone-2.28/bin:/export/home2/dpchai/tools/ns-allinone-2.28/tcl8.4.5/unix:/export/home2/dpchai/tools/ns-allinone-2.28/tk8.4.5/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
将上面粗体标出的路径加入到Path变量中。
IMPORTANT NOTICES:
(1) You MUST put /export/home2/dpchai/tools/ns-allinone-2.28/otcl-1.9, /export/home2/dpchai/tools/ns-allinone-2.28/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 <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>
将粗体的路径加入到LD_LIBRARY_PATH中。
(2) You MUST put /export/home2/dpchai/tools/ns-allinone-2.28/tcl8.4.5/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.
将/export/home2/dpchai/tools/ns-allinone-2.28/tcl8.4.5/library加入到TCL_LIBRARY变量中。
(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.5
and tk8.4.5. They are now installed under /export/home2/dpchai/tools/ns-allinone-2.28/{bin,include,lib}
保存修改的cshrc文件,运行source .cshrc命令使设置生效,或者重新打开一个控制台。进入到安装目录(/export/home2/dpchai/tools/ns-allinone-2.28)下的ns-2.28子目录,运行./validate进行验证。
注意:验证的时间比较长,如果你认为安装没有错误可以跳过这一步,或者在方便的时候进行验证。
附录:
#! /usr/bin/csh
umask 022
set hostname=`/bin/hostname`
set path = (. /export/home2/dpchai/tools/ns-allinone-2.28/bin /export/home2/dpchai/tools/ns-allinone-2.28/tcl8.4.5/unix /export/home2/dpchai/tools/ns-allinone-2.28/tk8.4.5/unix /bin /usr/local/bin /usr/ccs/bin /usr/ucb /usr/sbin /sbin /usr/bin /opt/SUNWspro/bin /usr/openwin/bin )
setenv LD_LIBRARY_PATH /lib:/usr/local/lib:/usr/lib:/export/home2/dpchai/tools/ns-allinone-2.28/otcl-1.9:/export/home2/dpchai/tools/ns-allinone-2.28/lib
setenv TCL_LIBRARY /export/home2/dpchai/tools/ns-allinone-2.28/tcl8.4.5/library
alias cd 'cd \!* ; set prompt="`hostname`:`pwd`> " '
2005年7月26日