Installing NS2.29 on Ubuntu 10.10

Embed Size (px)

DESCRIPTION

A tutorial on how to install Network Simulator v2.29 on Ubuntu 10.10 ( Maverick Meerkat )

Citation preview

  • 1. Installing NS 2.29 on Ubuntu 10.10Thejdeep G | 12CO99Siddartha L K | 12CO91

2. Download Instructions For downloading Ubuntu 10.10 MaverickMeerkathttp://old-releases.ubuntu.com/releases/maverick/Select and download appropriate .iso or .torrent either32bit or 64bit For downloading NS 2.29http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-Select ns-allinone-2.29.3.tar.gz 3. First Run Extract the downloaded ns-allinone by -tar -zxvf ns-allinone-2.29.3.tar.gzz ->unzip , x-> extract , v-> print verbosely, f->filename 'cd' into extracted folder ./install 4. Some Fatal Errors Ns-allinone-2.29/tk8.4.11/unix/../generic/tk.h:96 : fatal error:X11/Xlib.h: No such file or directory compilationterminated. Make failed.Conclusion : Xlib.h is not presentSo, which package contains the file Xlib.h ? 5. Tool for Installation Issues : apt-file Apt-file is a command in the Advanced PackagingTool that allows you to find which package includesa specific file Installation sudo apt-get install apt-file Once installed, run apt-file update for its databaseto get populated. This command attempts to fetchcontents.gz from the remote sourcesspecified in /etc/apt/sources.list 6. The search for Xlib.h Running apt-file search Xlib.h gives me 7. Installation of libx11-dev Running 'ssuuddoo aapptt--ggeett iinnssttaallll lliibbxx1111--ddeevv'' gives a'PPaacckkaaggee NNoott ffoouunndd'' error How about a 'ssuuddoo aapptt--ggeett uuppddaattee'' ?? Running 'ssuuddoo aapptt--ggeett uuppddaattee' in the terminalthrows many 404's (Not found). 8. Fixing Package Fetching After support for old ubuntu releases isdropped, repositories are removed from mainservers To get back the repository train, edit your//eettcc//aapptt//ssoouurrcceess..lliisstt and replace all instances ofaarrcchhiivvee..uubbuunnttuu..ccoomm and sseeccuurriittyy..uubbuunnttuu..ccoommwith oolldd--rreelleeaasseess..uubbuunnttuu..ccoomm 9. Fixing Package Fetching The new //eettcc//aapptt//ssoouurrcceess..lliisstt file 10. Next Steps Now, executing 'ssuuddoo aapptt--ggeett uuppddaattee'' updates all the packages Next, 'ssuuddoo aapptt--ggeett iinnssttaallll lliibbxx1111--ddeevv' to install the Xlib.hdependency issue 11. Second Run Running ..//iinnssttaallll for the second time Error : can't find X includesotcl-1.11 configuration failed! Exiting X libraries are not able to find utility functions Run 'ssuuddoo aapptt--ggeett iinnssttaallll lliibbxxmmuu--ddeevv'' 12. Third Run Running ./install for the third time Error: otcl.o: In function`OTclDispatch':/home/thejdeep/Desktop/ns-allinone-2.29/otcl-1.11/otcl.c:495: undefinedreference to `__stack_chk_fail_local' This error is because the linker being used is"ld -shared" instead of "gcc -shared". If you editone line in otcl-1.13/configure, and rerun install. 13. Third Run 14. Fourth Run Running ./install for the fourth time Error : Tcl.cc: In member function void Tcl::eval(char*):Tcl.cc:182: warning: deprecated conversion from stringconstant to char*. Tcl make failed Solution : Go to file tcl.cc and at line no. 564, replace with thefollowing- char *p =strchr(localName, '(');+ char *p =const_cast( strchr(localName, '(')); 15. Fifth Run Run ./install in the terminal Error :./common/packet.h:254:warning:deprecatedconversion from string constant to 'char*' Solution: Add this flag '-Wno-write-strings' tothe CCOPT line in the Makefile of ns-2.29folder 16. Sixth Run Run ./install in the terminal Error : queue/red.cc: In member function virtual voidREDQueue::trace(TracedVar*):queue/red.cc:874: error: invalid conversion from constchar* to char* Solution : In queue/red.cc at 874 line, do the followingchangesReplace (p = strstr(v->name(), "ave")) with ((p =const_cast(strstr(v->name(), "ave"))) 17. Seventh Run Run ./install again Similar error as previous with queue/rio.cc Solution: Do the following changes atqueue/rio.cc and line no. 565-if (((p = strstr(v->name(), "ave")) == NULL) &&+if (((p = const_cast(strstr(v->name(),"ave"))) == NULL) 18. Eighth Run Run ./install again Similar errors encountered for the following files :queue/pi.ccqueue/vq.ccqueue/rem.ccqueue/gk.cc Solutions for these are available athttp://ramakrishnamundugar.blogspot.in/p/network-simulator-v2.html 19. Finally 20. Setting Path Variables 21. Oops. Executing 'ns' in the terminal now works, givesthe % symbol. But Nam doesn't. Error : [code omitted because of length]: no event type or button # or keysymwhile executingbind Listbox {%W yview scroll [expr {- (%D / 120) * 4}] units} 22. Patching Tk Download tk-8.4-lastevent.patch fromhttp://www.linuxquestions.org/questions/attachment.php?attachmentid=4166&d=1279693038 Place the patch file inside the tk folder Run this in terminal - patch -p0 < tk-8.4-lastevent.patch 'cd' back to root dir of ns-allinone ./install again for the last time Ns and Nam works ! 23. Thank You 24. Patching Tk Download tk-8.4-lastevent.patch fromhttp://www.linuxquestions.org/questions/attachment.php?attachmentid=4166&d=1279693038 Place the patch file inside the tk folder Run this in terminal - patch -p0 < tk-8.4-lastevent.patch 'cd' back to root dir of ns-allinone ./install again for the last time Ns and Nam works !