zoukankan      html  css  js  c++  java
  • Fedora15或Ubuntu11.04版本安装ns2.34

     1、下载ns(network simulation)安装包

    到网站http://www.isi.edu/nsnam/ns/ns-build.html下载最新的ns-allinone套件,现在使用的是ns-allinone-2.34.tar.gz

    2、配置系统环境

    安装依赖包

    #yum install gcc-c++
    #yum install libX11-devel
    #yum install xorg-x11-proto-devel
    #yum install libXt-devel
    #yum install libXmu-devel
    

     3、安装ns-allinone-2.34.tar.gz

    3.1、安装目录为:主文件夹”/home/jean"(用户名为jean)

    #解压
    sudo tar xvfz ns-allinone-2.34.tar.gz
    #进入tk8.4.18文件夹
    cd ns-allinone-2.34/tk8.4.18/
    #wget用ftp下载包
    wget ftp://ftp.swin.edu.au/gentoo-portage...astevent.patch
    #重新安装
    patch -p0 < tk-8.4-lastevent.patch
    #返回ns-allinone-2.34
    cd ../
    #设定CC为需要的gcc版本,和CXX为需要的g++版本(ns-allinone-2.34里面的C语言编译版本是4.0以下的)
    export CC=gcc34 CXX=g++34
    #安装
    ./install
    

    最后出现:

    IMPORTANT NOTICES:
    
    (1) You MUST put /home/jean/ns-allinone-2.34/otcl-1.13, /home/jean/ns-allinone-2.34/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>
    
    (2) You MUST put /home/jean/ns-allinone-2.34/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
    
    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
    

    4、设置环境变量

    #在/home/jean目录下,运行
    sudo gedit .bashrc
    #在第8行输入
    PATH="$PATH:/home/jean/ns-allinone-2.34/bin:/home/jean/ns-allinone-2.34/tcl8.4.18/unix:/home/jean/ns-allinone-2.34/tk8.4.18/unix"
    LD_LIBRARY_PATH="/home/jean/ns-allinone-2.34/otcl-1.13:/home/jean/ns-allinone-2.34/lib"
    TCL_LIBRARY="$TCL_LIBRARY:/home/jean/ns-allinone-2.34/tcl8.4.18/library"

    如图:

    5、运行

    打开新的终端:输入

    ns

    若出现%号,则安装成功

    用一个例子试试:

    ns ns-allinone-2.34/ns-2.34/tcl/ex/simple.tcl
    

     出现如图所示:

    Top
    关注
    评论

    博文分享:



    许可协议:

    Creative Commons License

    本文基于署名-非商业性使用 3.0许可协议发布,欢迎转载,演绎,且不得用于商业目的。如您有任何疑问或者授权方面的协商,请与我联系

  • 相关阅读:
    Appium(一):java环境、AndroidSDK环境
    SQL Server Merge语句的使用
    ASP.NET MVC下判断用户登录和授权的方法
    javascript的错误处理
    javascript的封装实例
    Javascript的封装
    ASP.NET MVC的请求生命周期
    Asp.Net页面生命周期
    SQL注入原理
    ASP.NET MVC:窗体身份验证及角色权限管理示例
  • 原文地址:https://www.cnblogs.com/yongfeng/p/2222287.html
Copyright © 2011-2022 走看看