16.9.11

Installing ns-2.1a

Several sites while installing old ns version gives suggestion to install older version of gcc which is tricky in itself. Approached by my friend, I tried doing the same in several platforms which eventually failed to do anything good about it. Instead of going back on gcc version, it is much easier to modify ns code to fit in version 4 of gcc, only thing required is fix some portions of diffusion based routing schemes. This is the step I followed from scratch.

Some basic issues:
1. Samsung Sens X360 would not let me install dual boot ubuntu for some unknown reason. Yet to find solution for this. Interestingly it even converted the boot sequence that I saved in the BIOS setting.
2. My friend did several trials on cygwin based linux environment. Running simulation is very slow
3. Third attempt I chose vmware and install ubuntu over it.

For a freshly installed ubuntu ensure few libraries are installed:
sudo apt-get install libxt-dev
sudo apt-get install libx11-dev

Otcl compilation error (From  wiki)

 otcl.o: In function `OTclDispatch':
 /home/ns/ns-allinone-2.34/otcl/otcl.c:495: undefined reference to `__stack_chk_fail_local'



This error is because the linker being used is "ld -shared" instead of "gcc -shared". If you edit one line in otcl-1.13/configure, and rerun install, it should work:
 --- configure.orig      2009-11-02 12:14:52.556167945 -0800
 +++ configure   2009-11-02 12:17:28.966706099 -0800
 @@ -6301,7 +6301,7 @@
          ;;
      Linux*)
          SHLIB_CFLAGS="-fpic"
 -        SHLIB_LD="ld -shared"
 +        SHLIB_LD="gcc -shared"
          SHLIB_SUFFIX=".so"
          DL_LIBS="-ldl"
          SHLD_FLAGS=""


Follow the rest of errors handling in sunreset blog

For Error on red.cc
==> Follow the discussion on const char* to char* error on porting to gcc-4.4
in red.cc .. redefine p to const char *p


Error: X11/Xmu/WinUtil.h: No such file or  for nam installation
sudo apt-get install libxmu-dev


This should set you to start working in ns-2.1a with gcc-3.4 :). *Quick note: This is better done more easily with ns-2.31 patches. Lesson: don't hang on old versions, move on.













No comments: