在ubuntu上安装ns2,首先需要安装:

#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

# sudo apt-get install libxmu-dev libxmu-headers

 

接着到ns2的SourceForge去下载软件包,目前的最新版是2.35。

把解压缩后的文件夹,搬到想安装的位置去。例如:

# tar xvfz ns-allinone-2.35.tar.gz

 

 

cd /home/administrator/ns-allinone-2.35

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

修改环境变量

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 "

 

完成后在新终端窗口 输入ns

出现% 则安装成功

 

相关文章:

  • 2021-08-21
  • 2021-08-29
  • 2021-11-03
  • 2021-10-17
  • 2021-08-17
  • 2021-12-02
  • 2021-07-13
  • 2021-10-05
猜你喜欢
  • 2022-12-23
  • 2021-08-21
  • 2021-09-17
  • 2021-04-29
  • 2021-08-21
  • 2021-08-21
相关资源
相似解决方案