对ubuntu不是很懂,别人叫来帮忙装NS2。硬的头皮去了。说说注意事项吧。
1.必要的软件要装,就如windows装游戏都要装的VC++2005什么的
#sudo apt-get remove gcc
# 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
2.解压缩 都是指令操作
# tar xvfz ns-allinone-2.35.tar.gz
3.安装
cd /home/administrator/ns-allinone-2.35(cd后面有空格)
sudo ./install
安装完成后提示
IMPORTANT NOTICES:
(1) You MUST put /home/administrator/ns-allinone-2.35/otcl-1.14, /home/administrator/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 /home/administrator/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
4.修改环境变量
sudo nano /etc/profile
打开后 最下面添加如下指令
export PATH="$PATH:/home/administrator/ns-allinone-2.35/bin:/home/administrator/ns-allinone-2.35/tcl8.5.10/unix:/home/administrator/ns-allinone-2.35/tk8.5.10/unix"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/administrator/ns-allinone-2.35/otcl-1.14, /home/administrator/ns-allinone-2.35/lib"
export TCL_LIBRARY="$TCL_LIBRARY:home/administrator/ns-allinone-2.35/tcl8.5.10/library "
!!!!!!!特别注意 “administrator”是自己电脑的用户名,不要直接复制粘贴,不然不会有用的。(我小白,所以耽误很多时间,唉~~~)!!!!!!
(查看添加成功可以输入 ecth $PATH,添加成功会有显示的)
然后
sudo source /etc/profile
最后输入ns
出现%就表示成功了
(本人小白,望大家谅解!)