全部博文(180)
分类: 系统运维
2010-03-16 16:31:37
sudo apt-get install build-essentialsudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev sduo apt-get install libxmu-dev libxmu-headers |
sudo apt-get update sudo apt-get install build-essentials |
sudo mkdir /usr/local/NS2 tar xvfz ns-allinone-2.34.tar.gz sudo mv ns-allinone-2.34/* /usr/local/NS2 cd NS2 sudo ./install |
(这一步是我出错最多的, 希望你能够顺利!)
(由于官网上的allinone包中install文件中对于各组件版本的描述有错,所以我安装的过程中碰到了很多错误, 最后没办法,自己动手打开了install文件,根据对应的组件版本把其中的参数改过来, 最后安装才成功!!)
安装完后,注意提示:
IMPORTANT NOTICES: (1) You MUST put /usr/local/NS2/otcl-1.13, /usr/local/NS2/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/local/NS2/tcl8.4.18/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.34; ./validate |
export PATH=$PATH:/usr/local/NS2/bin:/usr/local/NS2/tcl8.4.184/unix:/usr/local/NS2/tk8.4.18/unix export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/NS2/otcl-1.13:/usr/local/NS2/lib export TCL_LIBRARY=$TCL_LIBRARY:/usr/local/NS2/tcl8.4.18/library |
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin /usr/local/NS2/bin /usr/local/NS2/tcl8.4.18/unix /usr/local/NS2/tk8.4.18/unix) setenv LD_LIBRARY_PATH /usr/local/NS2/otcl-1.13:/usr/local/NS2/lib setenv TCL_LIBRARY /usr/local/NS2/tcl8.4.18/library |
cd /usr/local/NS2/ns-2.34 ./validate |
验证OK;
或者直接敲命令:#ns
出现 %
则 OK
再或者进入 ns-2.34/tcl/ex目录下
运行提供的例程!
祝你好运!
以下是一网友在Ubuntu下安装过程的一个备忘录
1. 下载ns-allinone-2.33。() 2. 解压到要安装的目录下,在这里是 /home/xxx/NS2/ $ tar tar -xzvf ns-allinone-2.33.tar.gz /home/xxx/NS2/ 3. 进入ns2目录 $ cd /home/xxx/NS2/ns-allinone-2.33 4. $ sudo apt-get install build-essential $ sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev $ sduo apt-get install libxmu-dev libxmu-headers 5. $ cd /home/xxx/NS2/ns-allinone-2.32 $ ./install $ gedit ~/.bashrc Add the following lines to the end of it. Remember replace "/your/path" by something like "/home/xxx" (将以下代码加到文件末尾,并用你的路径代替"/home/purple")
|