【工具】NS2安装记录
献给同样为了NS2抓破了头皮的同志们。
1, Get Started:
http://www.isi.edu/nsnam/ns/ns-build.html#allinone
Build by pieces: 手动编译需要按顺序下载编译以下软件包:
Tcl release 8.5.10 (required component)
Tk release 8.5.10 (required component)
Otcl release 1.14 (required component)
TclCL release 1.20 (required component)
Ns release 2.35 (required component)
Nam release 1.15 (optional component)
Xgraph version 12 (optional component)
CWeb version 3.4g (optional component)
SGB version 1.0 (?) (optional component, builds sgblib for all UNIX type platforms)
Gt-itm gt-itm and sgb2ns 1.1 (optional component)
Zlib version 1.2.3 (optional, but required should Nam be used)
2, download all in once: ns-allinonce-2.35.tar.gz
3, tar zxvf ns-allinonce-2.35.tar.gz;
./install
4, tk8.5.10安装出错。(tk最新版本是8.6.1。)
In file included from /home/chn/Desktop/ns-allinone-2.35/tk8.5.10/unix/../generic/tkInt.h:19,
from /home/chn/Desktop/ns-allinone-2.35/tk8.5.10/unix/../generic/tk3d.c:14:
/home/chn/Desktop/ns-allinone-2.35/tk8.5.10/unix/../generic/tk.h:76:23: error: X11/Xlib.h: No such file or directory
......
5, 网上查到:若在ubuntu上安装ns2要先装几个库文件:
(1)sudo apt-get install build-essential,这样可以安装gcc,make。
(2)安装tk,tcl
sudo apt-get install tcl8.4
sudo apt-get install tcl8.4-dev
sudo apt-get install tk8.4
sudo apt-get install tk8.4-dev
(3)sudo apt-get install libxmu-dev,是和nam有关的东西。
6, sudo apt-get install build-essential
再次尝试./install【相同的失败】
7, sudo apt-get install tk8.5
sudo apt-get install tk8.5-dev
再次尝试./install
【tk安装成功,otcl-1.14 configuration failed!】
8, 网上查到:can't find X includes
otcl-1.11 configuration failed Exiting ...
安装x-window-system-dev可以解决问题
另:
安装libXt-dev可以解决问题
sudo apt-get install libXt-dev
9, apt-cache search x11-dev
libghc6-x11-dev - Haskell X11 binding for GHC
libwx11-dev - library to manage xlib - devel
libgl1-mesa-swx11-dev - A free implementation of the OpenGL API -- development files
libx11-dev - X11 client-side library (development headers)
然后一一安装。(为什么要安装X11 dev?)
【安装NS2成功】
10, 安装出错时,实际上考官方的解决方法:http://www.isi.edu/nsnam/ns/ns-problems.html
11, 环境变量设置:
IMPORTANT NOTICES:
(1) You MUST put /home/chn/Desktop/ns-allinone-2.35/otcl-1.14, /home/chn/Desktop/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 <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>
(2) You MUST put /home/chn/Desktop/ns-allinone-2.35/tcl8.5.10/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.
这些对于Ubuntu,还需要配置PATH变量。总的来说是这样的:
export NS_HOME=/home/chn/Desktop/ns-allinone-2.35
PATH="$PATH:$NS_HOME/bin:$NS_HOME/tcl8.5.10/unix:$NS_HOME/tk8.5.10/unix"
export LD_LIBRARY_PATH="$NS_HOME/otcl-1.14,$NS_HOME/lib"
export TCL_LIBRARY="$NS_HOME/tcl8.5.10/library"
把以上代码加到~/.bashrc中。使用命令source ~/.bashrc可以使上述环境变量立即生效。
After these steps, you can now run the ns validation suite with
cd ns-2.35; ./validate
进入漫长的validating process(漫长,据说1个小时?)
【END】
example
NS2的example在ns-2.35/tcl/ex/中。运行: ns <tcl filename>
12, 运行ns wireless-flooding.tcl【报错!】
nam: Can't find a usable tk.tcl in the following directories:
/home/chn/Desktop/ns-allinone-2.35/tk8.5.10/library /home/chn/Desktop/ns-allinone-2.35/tcl8.5.10/library/tk8.5 /home/chn/Desktop/ns-allinone-2.35/tcl8.5.10/tk8.5 ./lib/tk8.5 /home/chn/Desktop/ns-allinone-2.35/lib/tk8.5 ./library
/home/chn/Desktop/ns-allinone-2.35/tk8.5.10/library/tk.tcl: wrong # args: should be "::source fileName"
wrong # args: should be "::source fileName"
while executing
"::source -encoding utf-8 /home/chn/Desktop/ns-allinone-2.35/tk8.5.10/library/msgs/en.msg"
("uplevel" body line 1)
invoked from within
"uplevel 1 [list ::source -encoding utf-8 $langfile]"
(procedure "::msgcat::mcload" line 10)
invoked from within
"::msgcat::mcload [file join $::tk_library msgs]"
(in namespace eval "::tk::msgcat" script line 23)
invoked from within
"namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {package require msgcat}]} {
# The msgcat package..."
(in namespace eval "::tk" script line 3)
invoked from within
"namespace eval ::tk {
# Set up the msgcat commands
namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {p..."
(file "/home/chn/Desktop/ns-allinone-2.35/tk8.5.10/library/tk.tcl" line 21)
invoked from within
"source.orig /home/chn/Desktop/ns-allinone-2.35/tk8.5.10/library/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/chn/Desktop/ns-allinone-2.35/tk8.5.10/library/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $file]"
/home/chn/Desktop/ns-allinone-2.35/lib/tk8.5/tk.tcl: wrong # args: should be "::source fileName"
wrong # args: should be "::source fileName"
while executing
"::source -encoding utf-8 /home/chn/Desktop/ns-allinone-2.35/lib/tk8.5/msgs/en.msg"
("uplevel" body line 1)
invoked from within
"uplevel 1 [list ::source -encoding utf-8 $langfile]"
(procedure "::msgcat::mcload" line 10)
invoked from within
"::msgcat::mcload [file join $::tk_library msgs]"
(in namespace eval "::tk::msgcat" script line 23)
invoked from within
"namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {package require msgcat}]} {
# The msgcat package..."
(in namespace eval "::tk" script line 3)
invoked from within
"namespace eval ::tk {
# Set up the msgcat commands
namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {p..."
(file "/home/chn/Desktop/ns-allinone-2.35/lib/tk8.5/tk.tcl" line 21)
invoked from within
"source.orig /home/chn/Desktop/ns-allinone-2.35/lib/tk8.5/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/chn/Desktop/ns-allinone-2.35/lib/tk8.5/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $file]"
This probably means that tk wasn't installed properly.
经过半天多辛苦的搜索、尝试,终于在一个google group里找到了办法。现将其扩散:
https://groups.google.com/forum/#!msg/ns-users/HymDffbZW4A/6gF-T4jeBWIJ
export TCL_LIBRARY=/home/username/Desktop/ns-allinone-2.35/tcl8.5.10/library:/home/username/Desktop/ns-allinone-2.35/tk8.5.10/library
And run "source ~./bashrc" in terminal.
【真正的END】
【工具】NS2安装记录的更多相关文章
- linux如何ARP嗅探 Linux下嗅探工具Dsniff安装记录
先来下载依赖包 和一些必须要用到的工具 我这里用的是 dsniff-2.3 的版本 wget http://www.monkey.org/~dugsong/dsniff/dsniff-2.3.ta ...
- 图像标注工具labelImg安装记录
这里仅记载下labelImg的安装过程,因为有坑. 我的安装方式是从源码编译,环境ubuntu16.04,一开始是使用python2安装,从github上下载好源码,然后执行安装命令 sudo apt ...
- 关于node.js和npm,cnpm的安装记录以及gulp自动构建工具的使用
关于node.js和npm,cnpm的安装记录以及gulp自动构建工具的使用 工作环境:window下 在一切的最开始,安装node.js (中文站,更新比较慢http://nodejs.cn/) ...
- Hadoop集群中pig工具的安装过程记录
在Hadoop环境中安装了pig工具,安装过程中碰到了一些问题,在此做一下记录: 主要安装流程参考:http://www.cnblogs.com/yanghuahui/p/3768270.html ...
- [转]linux下iftop工具的安装与使用详解(图文)——实时的网络流量,监控TCP/IP连接(单机)
原文链接:http://www.jbxue.com/LINUXjishu/10735.html 在linux中监控系统资源.进程.内存占用等信息,可以使用top命令.查看网络状态可以使用netstat ...
- Chocolatey 和 Redis windows安装记录
前言 最近研究redis,发现Redis没有官方的windows版本,但MsOpenTech有一直维护对应的Redis版本,其下载地址如下: https://github.com/MSOpenTech ...
- uiautomatorviewer工具的安装与使用
Android自动化测试应用<一><uiautomatorviewer工具的安装与使用> OldKe 关注 2018.01.25 18:00* 字数 488 阅读 2083评论 ...
- [原创] debian 9.3 搭建Jira+Confluence+Bitbucket项目管理工具(二) -- 安装jira 7.5.4
[原创] debian 9.3 搭建Jira+Confluence+Bitbucket项目管理工具(二) -- 安装jira 7.5.4 环境都配置好以后, 开始搭建Jira的环境, 这里参考了一篇文 ...
- [原创] debian 9.3 搭建Jira+Confluence+Bitbucket项目管理工具(一) -- 安装jdk(含jre)及 MySql 5.6.39
[原创] debian 9.3 搭建Jira+Confluence+Bitbucket项目管理工具(一) -- 安装jdk(含jre)及 MySql 5.6.39 回老家已经有一段时间了, 四五线 ...
随机推荐
- 【转载】Asp.net Mvc 入门视频教程
专辑: http://www.youku.com/playlist_show/id_2416830.html 订阅: http://www.youku.com/playlist/rss/id/2416 ...
- BaseAdapter&ArrayAdapter在ListView中应用
一:BaseAdapter:共同实现的基类的适配器,是ArrayAdapter SimpleAdapter等的父类, 一般用于比较复杂的ListView,扩展性强. 详细信息可查看谷歌官方API:ht ...
- WampServer修改Mysql密码的步骤
1.安装成功后,通过 phpmyadmin 进入mysql,点击上面的 [用户] 菜单,在用户[root]主机[localhost]点击编辑权限,下面有一个选项[修改密码],输入您想要的密码,如:12 ...
- C# 获取文件名及扩展名
C# 获取文件名及扩展名 string aFirstName = aFile.Substring(aFile.LastIndexOf("\\") + 1, (aFile.LastI ...
- 页面传值总结Block
// AppDelegate.m // 页面传值总结 // // Created by qianfeng on 15/6/13. // Copyright (c) 2015年 qianfeng. Al ...
- virtualbox安装增强包及配置共享文件夹
因为需要在host及虚拟机间传输数据,想使用共享文件夹.但是单独设置了共享文件夹后在centos里找不到共享文件夹,看了下要安装增强包.好吧,顺 便也解决下鼠标切换的问题,省的老是按右CTL切换 ...
- const char *p、char const *p、char * const p的区别?
const char *p和char const *p是一样的,都表示定义一个指向字符常量的指针,指针的内容(字符)不可变.char * const p表示一个指向字符的指针常量,字符可以改变,但是指 ...
- NDK 通过java调用so文件
首先我们来看so文件的来源 1. 自己写.c文件,然后生成so库 2. 引用别人的静态库,或者动态库来生成新的jni调用库. 我们先来看最简单的编写一个jni调用的so库,包含一个获取字符串的方法,通 ...
- WEB应用中的SESSION知多少?
作为一名WEB开发程序员,对session的理解是最基础的,但是现状是WEB程序员遍地都是,随便一划拉一大把,不过估计能把session能透彻理解的人应该不是很多,起码我之前对此是知之甚少,偶然看到的 ...
- 使用 Time Machine 恢复 .ssh等隐藏文件夹
重装MAC系统后,要恢复.ssh等文件夹内容,而其在“Finder”中又是默认隐藏的,这时我们可以先在“Finder”中使用“前往文件夹功能…”进入指定文件夹,然后再进入“Time Machine”进 ...