Friday, December 14, 2012

NS-2.29 installation in Ubuntu 12.04

The below given details are the errors and solutions, which I found while installing.

1.
Build tcl8.4.11
============================================================
loading cache ./config.cache
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for building with threads... no (default)
checking if the compiler understands -pipe... yes
checking how to run the C preprocessor... gcc -pipe -E
checking for sin... no
checking for main in -lieee... yes
checking for main in -linet... no
checking for net/errno.h... no
checking for connect... yes
checking for gethostbyname... yes
checking how to build libraries... static
checking for ranlib... ranlib
checking if 64bit support is requested... no
checking if 64bit Sparc VIS support is requested... no
checking system version (for dynamic loading)... ./configure: 1: Syntax error: Unterminated quoted string
tcl8.3.2 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.

Solution:
Basically, in some of the configure scripts the calls to awk are malformed.

    Go to the ns-allinone folder and type

    find . -name configure

A list of the configure scripts should appear.

    For each of these replace any line that looks like this:

    system=MP-RAS-`awk ‘{print }’ /etc/.relid’`

    with ...

    system=MP-RAS-`awk ‘{print }’ /etc/.relid`

Now rerun ./install in the ns-allinone folder.



2.
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In otcl-1.13/configure, line number 5516

-  SHLIB_LD="ld -shared"

+SHLIB_LD="gcc -shared" 

3.
Tcl.cc: In member function ‘void Tcl::eval(char*)’:
Tcl.cc:182:8: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc: In member function ‘int TclObject::traceVar(const char*, TclObject*)’:
Tcl.cc:421:50: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc: In static member function ‘static int TclClass::create_shadow(ClientData, Tcl_Interp*, int, const char**)’:
Tcl.cc:509:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc:511:61: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc: In static member function ‘static int TclClass::dispatch_instvar(ClientData, Tcl_Interp*, int, const char**)’:
Tcl.cc:566:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
Tcl.cc:571:72: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc: In member function ‘virtual void TclClass::bind()’:
Tcl.cc:603:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc:605:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [Tcl.o] Error 1
tclcl-1.17 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Soultion:
Go to file tclcl-1.17/tcl.cc at line no. 564 replace the line following line

- char *p =strchr(localName, '(');
+ char *p =const_cast<char*>( strchr(localName, '('));


4.
./sctp/sctp.h:558:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]
./sctp/sctp.h:564:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]
./sctp/sctp.h:571:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]
./sctp/sctp.h:577:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]
./sctp/sctp.h:705:8: error: extra qualification ‘SctpAgent::’ on member ‘DumpSendBuffer’ [-fpermissive]
trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [trace/trace.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In file sctp/sctp.h in line 705, please change as follows:

- void SctpAgent::DumpSendBuffer();
+void DumpSendBuffer();


5.
In file included from ./trace/cmu-trace.h:43:0,
                 from src_rtg/sragent.cc:53:
./mobile/god.h: At global scope:
./mobile/god.h:88:14: error: extra qualification ‘vector::’ on member ‘operator=’ [-fpermissive]
./mobile/god.h:93:14: error: extra qualification ‘vector::’ on member ‘operator+=’ [-fpermissive]
./mobile/god.h:98:13: error: extra qualification ‘vector::’ on member ‘operator==’ [-fpermissive]
./mobile/god.h:101:13: error: extra qualification ‘vector::’ on member ‘operator!=’ [-fpermissive]
make: *** [src_rtg/sragent.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
The changes to be done to solve this problem is in the file mobile/god.h

In line 88, 93, 98 and 101 
remove vector::


6.
queue/red.cc: In member function ‘double REDQueue::estimator(int, int, double, double)’:
queue/red.cc:388:18: warning: variable ‘old_ave’ set but not used [-Wunused-but-set-variable]
queue/red.cc: In member function ‘virtual void REDQueue::trace(TracedVar*)’:
queue/red.cc:874:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/red.cc:875:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/red.cc:876:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/red.cc:877:41: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [queue/red.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
 In file queue/red.cc at line 874,


-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) ) {

+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) ) {


7.
dsr/dsragent.cc:2737:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:2756:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [dsr/dsragent.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In dsr/dsragent.cc at line 216 add following lines,

void XmitFlowFailureCallback(Packet *pkt, void *data);
void XmitFailureCallback(Packet *pkt, void *data);


8.
diffusion/diffusion.cc: In member function ‘void DiffusionAgent::MACprepare(Packet*, nsaddr_t, int, bool)’:
diffusion/diffusion.cc:427:26: error: ‘XmitFailedCallback’ was not declared in this scope
make: *** [diffusion/diffusion.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In diffusion/diffusion.cc at line 85 add following line,

void XmitFailedCallback(Packet *pkt, void *data);

9.
diffusion/omni_mcast.cc: In member function ‘void OmniMcastAgent::ConsiderNew(Packet*)’:
diffusion/omni_mcast.cc:243:19: warning: variable ‘hashPtr’ set but not used [-Wunused-but-set-variable]
diffusion/omni_mcast.cc:246:27: warning: variable ‘forward_nodeID’ set but not used [-Wunused-but-set-variable]
diffusion/omni_mcast.cc: In member function ‘void OmniMcastAgent::MACprepare(Packet*, nsaddr_t, unsigned int, bool)’:
diffusion/omni_mcast.cc:388:26: error: ‘OmniMcastXmitFailedCallback’ was not declared in this scope
make: *** [diffusion/omni_mcast.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In diffusion/omni_mcast.cc at line 83 add followinf line

void OmniMcastXmitFailedCallback(Packet *pkt, void *data);


10.
queue/rio.cc: In member function ‘virtual void RIOQueue::enque(Packet*)’:
queue/rio.cc:481:56: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
queue/rio.cc: In member function ‘virtual void RIOQueue::trace(TracedVar*)’:
queue/rio.cc:565:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/rio.cc:566:38: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/rio.cc:567:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/rio.cc:568:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/rio.cc:569:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/rio.cc:570:40: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/rio.cc:571:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [queue/rio.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
Do the following changes in queue/rio.cc at line 565 onwards,

-    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)) {
       

+    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)) {


11.
tcp/tcp-sack-rh.cc: At global scope:
tcp/tcp-sack-rh.cc:68:15: error: extra qualification ‘SackRHTcpAgent::’ on member ‘newack’ [-fpermissive]
make: *** [tcp/tcp-sack-rh.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In tcp/tcp-sack-rh.cc at line 68,

-    virtual void SackRHTcpAgent::newack(Packet* pkt);
+    virtual void newack(Packet* pkt);

12.
queue/pi.cc: In member function ‘virtual void PIQueue::trace(TracedVar*)’:
queue/pi.cc:316:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/pi.cc:317:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [queue/pi.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In queue/pi.cc at line 316, do the following changes,

-    if (((p = strstr(v->name(), "prob")) == NULL) &&
-        ((p = strstr(v->name(), "curq")) == NULL)) {

+    if (((p = const_cast<char*>(strstr(v->name(), "prob"))) == NULL) &&
+        ((p = const_cast<char*>(strstr(v->name(), "curq"))) == NULL)) {


13.
queue/vq.cc: In member function ‘virtual void Vq::trace(TracedVar*)’:
queue/vq.cc:333:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [queue/vq.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In file queue/vq.cc at line 333,

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


14.
queue/rem.cc: In member function ‘virtual void REMQueue::trace(TracedVar*)’:
queue/rem.cc:335:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/rem.cc:336:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
queue/rem.cc:337:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [queue/rem.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In file queue/rem.cc at line 335,

-    if (((p = strstr(v->name(), "ave")) == NULL) &&
-        ((p = strstr(v->name(), "prob")) == NULL) &&
-        ((p = strstr(v->name(), "curq")) == NULL)) {

+   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)) {


15.
queue/gk.cc: In member function ‘virtual void GK::trace(TracedVar*)’:
queue/gk.cc:207:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [queue/gk.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution:
In file queue/gk.cc at line 207,

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


16.
pgm/pgm-agent.cc: At global scope:
pgm/pgm-agent.cc:307:8: error: extra qualification ‘PgmAgent::’ on member ‘trace_event’ [-fpermissive]
pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_rdata(Packet*)’:
pgm/pgm-agent.cc:607:30: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_nak(Packet*)’:
pgm/pgm-agent.cc:756:43: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_ncf(Packet*)’:
pgm/pgm-agent.cc:853:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [pgm/pgm-agent.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problem

Solution
In pgm/pgm-agent.cc at line 307,

-  void PgmAgent::trace_event(char *evType, double evTime);
+  void trace_event(char *evType, double evTime);


17.
pgm/pgm-sender.cc: At global scope:
pgm/pgm-sender.cc:189:8: error: extra qualification ‘PgmSender::’ on member ‘trace_event’ [-fpermissive]
pgm/pgm-sender.cc: In member function ‘virtual void PgmSender::handle_nak(Packet*)’:
pgm/pgm-sender.cc:501:67: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
pgm/pgm-sender.cc: In member function ‘virtual void PgmSender::send_rdata(RdataItem*)’:
pgm/pgm-sender.cc:645:51: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [pgm/pgm-sender.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution
In pgm/pgm-sender.cc at line 189,

-  void PgmSender::trace_event(char *evType, nsaddr_t daddr, double evTime);
+  void trace_event(char *evType, nsaddr_t daddr, double evTime);


18.
pgm/pgm-receiver.cc: At global scope:
pgm/pgm-receiver.cc:186:8: error: extra qualification ‘PgmReceiver::’ on member ‘trace_event’ [-fpermissive]
pgm/pgm-receiver.cc: In member function ‘void PgmReceiver::generate_Nak(int)’:
pgm/pgm-receiver.cc:617:34: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [pgm/pgm-receiver.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Solution
In pgm/pgm-sender.cc at line 186,

-   void PgmReceiver::trace_event(char *evType, double evTime);
+   void trace_event(char *evType, double evTime);