Saturday 29 June 2013

Part 2

Instructions for INSTALLING NS-2.29 ON FEDORA 13 Operating System

Pleasz U can follow these steps in any Linux environment

INSTALLING NS-2.29 ON FEDORA 13
STEP 1
From terminal login as super user and do the following.(internet must also be connected in order to install the package dependencies.

yum install autoconf
yum install automake
yum install gcc-c++
yum install libX11-devel
yum install xorg-x11-proto-devel
yum install libXt-devel
And for nam installation (optional):
yum install libXmu-devel


STEP 2
From terminal go to the folder where the ns-allinone patch is placed and type the following to extract
$ tar -xzf ns-allinone-2.31.tar.gz 
$ cd ns-allinone-2.29
$. /install


STEP 3


Now go to /etc folder and type

gedit ~/.bashrc

Add the following lines to the end of it. Remember replace "/your/path" by something like "/home/ram". And accordingly also change the version numbers. This is for ns 2.31.

# LD_LIBRARY_PATH
OTCL_LIB=/your/path/ns-allinone-2.31/otcl-1.13
NS2_LIB=/your/path/ns-allinone-2.31/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LI B:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/your/path/ns-allinone-2.31/tcl8.4.14/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/your/path/ns-allinone-2.31/bin:/your/path/ns-allinone-2.31/tcl8.4.14/unix:/your/path/ns-allinone-2.31/tk8.4.14/unix
NS=/your/path/ns-allinone-2.31/ns-2.31/
NAM=/your/path/ns-allinone-2.31/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM


Let it take effect immediately

source ~/.bashrc


Note: the step described above is important; otherwise, you cannot run ns successfully.
or you can restart your X windows.i.e. logout and then login, or reboot your system, to make it work.)

Now, the installation has been completed. If you try:
$ ns

Then a "%" will appear on the screen.type "exit" to quit the mode and back to "$"


Errors You May Encounter During Installation of ns-2.29 in Fedora 13


If you miss out step 1 you may get the following errors

Build XGraph-12.1
================================================== ==========
loading cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... missing
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking if malloc debugging is wanted... no
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH
make: *** No targets specified and no makefile found. Stop.
Can not create xgraph; But xgraph is an optional package, continuing...

If you miss step 3

At the prompt when you type ns you will get 
Ns command not found



Others Errors:

No .configure file found in current directory
Continuing with default options...
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking for main in -lXbsd... no
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... yes
checking for dcgettext in -lintl... no
checking for getnodebyname in -ldnet_stub... no
checking that g++ can handle -O2... no
checking standard STL is available... no
checking for ranlib... ranlib
checking for snprintf... yes
checking for ANSI C header files... (cached) yes
checking for strtoq... yes
checking for strtoll... yes
checking for long... yes
checking size of long... 4
checking for __int64_t... no
checking for long long... yes
checking for int64_t... yes
checking which kind of 64-bit int to use... int64_t
checking for tcl.h... -I../include
checking for tclInt.h... -I../include
checking for libtcl8.4... -L../lib -ltcl8.4
checking for init.tcl... ../lib/tcl8.4
checking for http.tcl... ../lib/tcl8.4/http1.0
checking Tcl http.tcl library... yes
checking for tclsh8.4.11... no
checking for tclsh8.4... ../bin/tclsh8.4
checking for tk.h... -I../include
checking for libtk8.4... -L../lib -ltk8.4
checking for tk.tcl... ../lib/tk8.4
checking for otcl.h... -I../otcl-1.11
checking for libotcl1.11... -L../otcl-1.11 -lotcl
checking for X11 header files
checking for X11 library archive
checking for XOpenDisplay in -lX11... yes
checking for XShmAttach in -lXext... yes
No explicit static compilation flag; setting V_STATIC to ""
checking for dlopen in -ldl... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
g++ -c -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBOTCL1_11 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCLINT_H -DHAVE_TCL_H -DHAVE_CONFIG_H -I. -I/home/Sharath/Desktop/ns-allinone-2.29/otcl-1.11 -I/home/Sharath/Desktop/ns-allinone-2.29/include -I/home/Sharath/Desktop/ns-allinone-2.29/include -I/home/Sharath/Desktop/ns-allinone-2.29/include -o Tcl.o Tcl.cc
Tcl.cc: In member function ‘void Tcl::eval(char*)’:
Tcl.cc:182: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc: In member function ‘int TclObject::traceVar(const char*, TclObject*)’:
Tcl.cc:421: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc: In static member function ‘static int TclClass::create_shadow(void*, Tcl_Interp*, int, const char**)’:
Tcl.cc:509: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc:511: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc: In static member function ‘static int TclClass::dispatch_instvar(void*, Tcl_Interp*, int, const char**)’:
Tcl.cc:566: error: invalid conversion from ‘const char*’ to ‘char*’
Tcl.cc:571: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc: In member function ‘virtual void TclClass::bind()’:
Tcl.cc:603: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc:605: warning: deprecated conversion from string constant to ‘char*’
make: *** [Tcl.o] Error 1
tclcl-1.17 make failed! Exiting ...

If you face this type of error you have to follow below steps:

# yum install \
gcc-c++ compat-gcc-34-c++ automake autoconf libtool libX11-devel \
libXext-devel libXau-devel libXmu-devel xorg-x11-proto-devel

And for ns-allinone-2.29.3 : gcc, g++ style 3.4.6 / 4.1.x is required.
Either use : 'export CC=gcc34 CXX=g++34' or the Suse compat gcc41*,
whichever makes the best result for a perfect 'validate'.

The Suse gcc41* compat works perfect in Fedora 12 .. 14 :
http://download.opensuse.org/distrib...oss/suse/i586/
rpm -Uvh cpp41-4.1.2_20070115-16.1.i586.rpm
rpm -Uvh libmudflap41-4.1.2_20070115-16.1.i586.rpm
rpm -Uvh gcc41-4.1.2_20070115-16.1.i586.rpm
rpm -Uvh libstdc++41-devel-4.1.2_20070115-16.1.i586.rpm
rpm -Uvh gcc41-c++-4.1.2_20070115-16.1.i586.rpm


cd ns-allinone-2.29/tk8.4.11/
export CC=gcc-4.1 CXX=g++-4.1
patch -p0 < tk-8.4-lastevent.patch
cd .. && ./install

Good luck !


If You Face any Errors during Installation, Feel Free to comment. I will try my Level best to solve it.

No comments:

Post a Comment