Install NS 2.35 from source packages on Fedora 16

I assume that the Fedora Installation you have on your system have minimal packages and installed with GNOME desktop.

Though it's optional, you can check for existing installation of package, by typing "rpm -qa | grep <pkg_name>", in our case, i.e. Perl. If not present, I prefer installing Perl binaries from Fedora repository only. To do that (as you are reading my blog here, I assume your system is connected to Internet), type below command:
                        
[root@fedora32 ~]# yum install perl

This will install Perl-5.14.2-198.fc16.i686 package and other related Perl packages as per requirement.

Also install various dependencies which will come in course of compiling and "configure/make" of required source packages by typing below commands.

[root@fedora32 ~]# yum install gcc gcc-g++
[root@fedora32 ~]# yum install libX11-devel
[root@fedora32 ~]# yum groupinstall "X Software Development"
[root@fedora32 ~]# yum install  qt-devel


Now you visit this URL: http://www.isi.edu/nsnam/ns/ns-build.html , where you will get links to download source of Tcl, Tk, otcl, TclCL, ns, xgraph and nam packages. Make a directory, say "ns2" in your home directory and dump all packages there. I now expect that following source packages are in ns2 directory:
1) tcl8.5.12-src.tar.gz
2) tk8.5.12-src.tar.gz
3) otcl-src-1.14.tar.gz
4) tclcl-src-1.20.tar.gz
5) ns-src-2.35.tar.gz
6) nam-src-1.15.tar.gz 
7) xgraph-12.1.tar.gz

I left other optional source packages, as they can be installed as and when need arise.

Now extract all the source packages by below command in current directory:
[root@fedora32 ns2]# tar zxvf  <*.tar.gz>

Now follow below steps to install tcl package:
[root@fedora32 ns2]# cd  tcl8.5.12/unix

[root@fedora32 unix]#./configure --prefix=/usr --enable-threads \
            --mandir=/usr/share/man &&
            make &&
            sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \
            -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" \
            -i tclConfig.sh
[root@fedora32 unix]# make test
[root@fedora32 unix]#  make install &&
                 make install-private-headers &&
                                  ln -v -sf tclsh8.5 /usr/bin/tclsh
[root@fedora32 unix]# chmod -v 755 /usr/lib/libtcl8.5.so

To understand what the above commands does, visit to "http://www.linuxfromscratch.org/blfs/view/svn/general/tcl.html".
 Now we need to install Tk package, for that follow below steps:
[root@fedora32 ns2]# cd tk8.5.12/unix/
[root@fedora32 unix]# ./configure
[root@fedora32 unix]# make
[root@fedora32 unix]# make test
[root@fedora32 unix]# make install

Now we need to install otcl source package, move to source directory and follow below step:
[root@fedora32 otcl-1.14]# ./configure --prefix=/usr --enable-devel --enable-release
[root@fedora32 otcl-1.14]# make
[root@fedora32 otcl-1.14]# make test
[root@fedora32 otcl-1.14]# make install

Now we need to install remaining tctcl, ns, and nam source package, by moving to source directory and follow below step:
 1) ./configure
 2) make
 3) make install

For the remaining last xgraph-12.1 source package, move to source directory and do following:
[root@fedora32 xgraph-12.1]# vi dialog.c

Now search for the keyword "getline" in the file and change the two occurences to "my_getline". Save the file and exit and proceed as below:
[root@fedora32 xgraph-12.1]#./configure
[root@fedora32 xgraph-12.1]# make
[root@fedora32 xgraph-12.1]# make install

[root@fedora32 xgraph-12.1]#yum install xorg-x11-fonts*
The above "yum" command prevents below error:

"Parameter LabelFont: can't translate `helvetica-10' into a font (defaulting to `fixed')
X Error: BadFont (invalid Font parameter)
Major opcode of failed request: 55 (X_CreateGC)
Aborted (core dumped)"


Now you are all set to run NS2 (The Network Simulator version 2), but it's useful only if you know how to write program in "OTcl".  To help you on this, there is very good online resource available at this URL: http://nile.wpi.edu/NS/

For those who are just impatient to test their installation right away, can go to "Basics" topic in "NS by Example". In there, go to "Simple Simulation Example" page, download a copy of "ns-simple.tcl" program and type "ns ns-simple.tcl" at your shell prompt. Magically, NAM will appear, press the button with symbol like "Play" and enjoy without the clue, what just happened, like it happened to me first time. Take time to understand the program and discover rest of needed yourself.
All the Best for installation. Enjoy.

P.S. : I wrote this article with help from various forums, articles, posts and my little experience of linux system administration. The links mentioned in this blog are intellectual property of respective person/organization, if applicable.


Comments

  1. sir i got error while installing xgraph ,after ./configure when i type make it gives following error:
    [root@localhost xgraph-12.2]# make
    make all-am
    make[1]: Entering directory '/home/priyasharma/ns-allinone-2.35/xgraph-12.2'
    source='dialog.c' object='dialog.o' libtool=no \
    DEPDIR=.deps depmode=none /bin/sh ./depcomp \
    gcc -DHAVE_CONFIG_H -I. -g -c dialog.c
    /bin/sh: ./depcomp: No such file or directory
    Makefile:372: recipe for target 'dialog.o' failed
    make[1]: *** [dialog.o] Error 127
    make[1]: Leaving directory '/home/priyasharma/ns-allinone-2.35/xgraph-12.2'
    Makefile:250: recipe for target 'all' failed
    make: *** [all] Error 2
    pls reply asap !!

    ReplyDelete
  2. Hi Priya, I did my installation with individual packages and not ns-allinone-2.35 packages, it can lead to this unknown behavior which is not mentioned in my blog. You can visit the link http://www.isi.edu/nsnam/ns/ns-build.html and get individual source packages and follow the steps in blog and let me know if you face the same issue. BTW looking at error message you got, it's evident that it's not able to find "depcomp" file. Let me know the Fedora version you are trying this installation as well.

    ReplyDelete
  3. Thanks for replying.
    Sir m using fedora 21 alpha version. Do i need to separately download xgraph12.2 package and keep it in nsallinone-2.35 package? Will it solve the error? or pls suggest smthng else...

    ReplyDelete
  4. [nayabhussain@localhost xgraph-12.2]$ make
    make all-am
    make[1]: Entering directory `/home/nayabhussain/ns2/ns-allinone-2.35/xgraph-12.2'
    source='xgraph.c' object='xgraph.o' libtool=no \
    DEPDIR=.deps depmode=none /bin/sh ./depcomp \
    gcc -DHAVE_CONFIG_H -I. -g -c xgraph.c
    /bin/sh: ./depcomp: No such file or directory
    make[1]: *** [xgraph.o] Error 127
    make[1]: Leaving directory `/home/nayabhussain/ns2/ns-allinone-2.35/xgraph-12.2'
    make: *** [all] Error 2



    how to deal with this error while installing xgraph

    ReplyDelete

Post a Comment

Popular posts from this blog

"gnome-screenshot" (No such file or directory)"

कुछ और

यादें