Installing ns-2.29 in Ubuntu 12.04

 
 

Off late, we try to use(install) a old software in a new Operating System for want of backward compatibility or to survey.  This following post shows you how to install ns-2.29 in Ubuntu 12.04.

Unlike other ns2 installations, this installation has so many errors, warnings and patchings. Once everything is overcome, ns installs successfully

Step 1: Download and untar ns-2.29 from this link (http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.29/ns-allinone-2.29.3.tar.gz/download)

Step 2: install the necessary dependancy packages using the command "sudo apt-get install build-essential libxmu-dev autoconf automake" (without quotes). This will install the necessary developmental packages

Step 3: Since ns-2.29 is older software, some of the pointer conversion have to be changed inside ns-2.29

Step 4: go to terminal, point to the location of ns-allinone-2.29 using the command "cd ~/ns-allinone-2.29/" and type "./install"

Step 5: there may be the following errors during the installation, please correct one by one

1. OTcl-1.11 error make failed.

for this error, open the file under the folder otcl-1.11/configure.in and go to line number

Change the following block to

Linux*)

SHLIB_CFLAGS="-fpic"

SHLIB_LD="ld -shared"

SHLIB_SUFFIX=".so"

DL_LIBS="-ldl"

SHLD_FLAGS=""

;;

Linux*)
        SHLIB_CFLAGS="-fpic"
        SHLIB_LD="gcc -shared"
        SHLIB_SUFFIX=".so"
        DL_LIBS="-ldl"
        SHLD_FLAGS=""
        ;;
 
2. tclcl-1.17 error, in line number 566 of Tcl.cc file (~tclcl-1.17/Tcl.cc) (See the upper case Tcl.cc)
change the following to 
char *p = strchr(localName, '(');
this following line
char *p =const_cast<char*>( strchr(localName, '('));
 
3. there will be so many errors in the queue/ folder (~ns-allinone-2.29/ns-2.29/queue/), there may be some pointer conversion errors
Error 1:
------
queue/red.cc:877:41: error: invalid conversion from ‘const char*’ to ‘char*’
make: *** [queue/red.o] Error 1
In queue/red.cc at 874 line
Change the following to
 
if (((p = strstr(v->name(), "ave")) == NULL) &&
    ((p = strstr(v->name(), "prob")) == NULL) &&
    ((p = strstr(v->name(), "curq")) == NULL) &&
    ((p = strstr(v->name(), "cur_max_p"))==NULL) ) {
this 
if (((p = const_cast<char*>(strstr(v->name(), "ave"))) == NULL) &&
       ((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&
        ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL) &&
       ((p = const_cast<char*>(strstr(v->name(), "cur_max_p")))==NULL) ) {
 
 
Error 2:
queue/rio.cc:568:36: error: invalid conversion from ‘const char*’ to ‘char*’
queue/rio.cc:569:39: error: invalid conversion from ‘const char*’ to ‘char*’
queue/rio.cc:570:40: error: invalid conversion from ‘const char*’ to ‘char*’
queue/rio.cc:571:36: error: invalid conversion from ‘const char*’ to ‘char*’
make: *** [queue/rio.o] Error 1
 
in queue/rio.cc and in line number 565 
 find the following lines

if (((p = strstr(v->name(), "ave")) == NULL) &&
    ((p = strstr(v->name(), "in_ave")) == NULL) &&
    ((p = strstr(v->name(), "out_ave")) == NULL) &&
    ((p = strstr(v->name(), "prob")) == NULL) &&
    ((p = strstr(v->name(), "in_prob")) == NULL) &&
    ((p = strstr(v->name(), "out_prob")) == NULL) &&
    ((p = strstr(v->name(), "curq")) == NULL)) {
 
and replace these lines
if (((p = const_cast<char*>(strstr(v->name(), "ave"))) == NULL) &&
       ((p = const_cast<char*>(strstr(v->name(), "in_ave"))) == NULL) &&
        ((p = const_cast<char*>(strstr(v->name(), "out_ave"))) == NULL) &&
       ((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&
        ((p = const_cast<char*>(strstr(v->name(), "in_prob"))) == NULL) &&
        ((p = const_cast<char*>(strstr(v->name(), "out_prob"))) == NULL) &&
        ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL)) {
 
 
Error 3: 
queue/pi.cc:316:36: error: invalid conversion from ‘const char*’ to ‘char*’
queue/pi.cc:317:36: error: invalid conversion from ‘const char*’ to ‘char*’
make: *** [queue/pi.o] Error 1

in queue/pi.cc at line number 316

Find these lines and 
 
if (((p = strstr(v->name(), "prob")) == NULL) &&
    ((p = strstr(v->name(), "curq")) == NULL)) {
 
replace with these lines
 
 if (((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&
        ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL)) {
 
Error 4:

queue/vq.cc: In member function ‘virtual void Vq::trace(TracedVar*)’:
queue/vq.cc:333:35: error: invalid conversion from ‘const char*’ to ‘char*’
make: *** [queue/vq.o] Error 1

Find the following line and

if ((p = strstr(v->name(), "curq")) == NULL) {
replace this line

if ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL) {
 
Error 5

queue/rem.cc:337:36: error: invalid conversion from ‘const char*’ to ‘char*’
queue/rem.cc:338:36: error: invalid conversion from ‘const char*’ to ‘char*’
make: *** [queue/rem.o] Error 1
In queue/rem.cc: in line number 336
Find the following lines and

if (((p = strstr(v->name(), "ave")) == NULL) &&
    ((p = strstr(v->name(), "prob")) == NULL) &&
    ((p = strstr(v->name(), "curq")) == NULL)) {
 
replace these lines
if (((p =const_cast<char*>(strstr(v->name(), "ave"))) == NULL) &&
       ((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&
       ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL)) {
 
 
Error 6: 
queue/gk.cc:207:35: error: invalid conversion from ‘const char*’ to ‘char*’
make: *** [queue/gk.o] Error 1

In queue/gk.cc in line number 207

find the following line and 
if ((p = strstr(v->name(), "curq")) == NULL) {
 replace this line
if ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL) {
 
Step 6: Once the errors are corrected, go back to ns-allinone-2.29 and press ./install and see whether the installation is successful
Step 7: Set the PATH information in /home/pradeep/.bashrc and  execute "source .bashrc"
Check whether ns and nam are working (for me nam was not working, Since mine is ubuntu I installed NAM separately using "sudo apt-get install nam"
 
Thats all!!!!.

【NS2】Installing ns-2.29 in Ubuntu 12.04的更多相关文章

  1. 【ejabberd】安装XMPP服务器ejabberd(Ubuntu 12.04)

    ejabberd ejabberd is a free and open source instant messaging server written in Erlang/OTP. ejabberd ...

  2. 【转】Windows 7下硬盘安装Ubuntu 14.04图文教程--不错

    原文网址:http://www.linuxidc.com/Linux/2014-04/100369p3.htm Ubuntu 官方已经发布了正式版的 Ubuntu 14.04 LTS,并宣称这是为云计 ...

  3. 【转】Installing OpenCV on Debian Linux

    In this post I will describe the process of installing OpenCV(both versions 2.4.2 and 2.4.3) on Debi ...

  4. 【转】用VMware 8安装Ubuntu 12.04详细过程(图解)

    图解演示环境版本: 本机系统: WIN7 虚拟机:VMware Workstation 8 (英文版) 安装目标:Ubuntu Desktop 12.04 LTS  (请点击这里)先下载好iso镜像文 ...

  5. 【菜鸟学习Linux】-第三章- Linux环境搭建-使用VMware9安装Ubuntu 12.04系统

    上一步,我们安装了VMware9虚拟机,现在我们就是用它来安装Ubuntu12.04系统,至于Ubuntu是什么,我就不废话了,大家google一下,比我讲的清楚,好了,开始干活! Ubuntu官网下 ...

  6. OpenStack Havana 部署在Ubuntu 12.04 Server 【OVS+GRE】(三)——计算节点的安装

    序:OpenStack Havana 部署在Ubuntu 12.04 Server [OVS+GRE] 计算节点: 1.准备结点 安装好ubuntu 12.04 Server 64bits后,进入ro ...

  7. OpenStack Havana 部署在Ubuntu 12.04 Server 【OVS+GRE】(二)——网络节点的安装

    序:OpenStack Havana 部署在Ubuntu 12.04 Server [OVS+GRE] 网络节点: 1.安装前更新系统 安装好ubuntu 12.04 Server 64bits后,进 ...

  8. OpenStack Havana 部署在Ubuntu 12.04 Server 【OVS+GRE】(一)——控制节点的安装

      序:OpenStack Havana 部署在Ubuntu 12.04 Server [OVS+GRE] 控制节点: 1.准备Ubuntu 安装好Ubuntu12.04 server 64bits后 ...

  9. OpenStack Havana 部署在Ubuntu 12.04 Server 【OVS+GRE】——序

    OpenStack Havana 部署在Ubuntu 12.04 Server [OVS+GRE](一)——控制节点的安装 OpenStack Havana 部署在Ubuntu 12.04 Serve ...

随机推荐

  1. python打包成为exe文件

    pyinstaller 库的使用 PyInstaller是一个十分有用的第三方库,它能够在Windows.Linux.Mac OS X 等操作系统下将 Python 源文件打包,通过对源文件打包,Py ...

  2. 基础篇-1.4Java流程语句的基础

    1 条件语句 条件语句,即类似 if...else... 的语句,一个if语句包含了一个布尔表达式,以及一个或多个语句. if语句语法 if(布尔表达式) { // 布尔表达式为true时执行的语句块 ...

  3. 2018-8-10-安装-wordpress-出现-抱歉,我不能写入wp-config.php文件

    title author date CreateTime categories 安装 wordpress 出现 抱歉,我不能写入wp-config.php文件 lindexi 2018-08-10 1 ...

  4. centos部分网站无法访问问题的解决

    CentOS 5内核对TCP的读缓冲区大小有缺省设置,缺省为:net.ipv4.tcp_rmem = 4096 87380 4194304 解决办法就是将最后一个数字改小一点,具体操作就是在文件/et ...

  5. golang之if

    1.if语句 (1)if (2)if else (3)if esle ...else

  6. Thinkphp 调试方法

    1.入口文件index.php配置APP_DEBUG,能直接发现页面上的错误 define('APP_DEBUG',True); 2.配置页面调试SHOW_PAGE_TRACE,可以在config里面 ...

  7. CentOS8/RHEL8--恢复root用户密码及简易加固GRUB

    CentOS8/RHEL8--简易加固GRUB 今天突然想到放在数据中心的虚拟化平台下的Linux服务器,都是采用默认方式安装的,没有设置太多的安全选项,如果有恶意用户重启服务器后,通过GRUB调整启 ...

  8. placeholder改变输入框字体颜色

    ::-webkit-input-placeholder {  color: #888;}:-moz-placeholder {  color: #888;}::-moz-placeholder{col ...

  9. 【JZOJ5060】【GDOI2017第二轮模拟day1】公路建设 线段树+最小生成树

    题面 在Byteland一共有n 个城市,编号依次为1 到n,它们之间计划修建m条双向道路,其中修建第i 条道路的费用为ci. Byteasar作为Byteland 公路建设项目的总工程师,他决定选定 ...

  10. 如何把一个普通的Eclipse项目改造成Eclipse Plugin项目

    New Project->Plug-in from existing JAR Archive 同时要记得不仅要将你要转换的项目的jar包选上,同时还要将项目依赖的jar包全部选上(要不然会找不到 ...