Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Nov 9, 2009

How to install ns-2.34 on Ubuntu 9.10 Karmic Koala



If you are planning to install the latest ns-2.34 on Ubuntu 9.10 Karmic Koala, here are some basic steps

1. Download ns-allinone-2.34.tar from here.

2. Place it in somewhere, e.g. /home/simulator, then extract it.
$ cd /home/simulator
$ tar -xvf ns-allinone-2.34.tar


3. Download & install some packages from repository
$ sudo apt-get install build-essential autoconf automake libxmu-dev

4. Install the ns2
$ cd ns-allinone-2.34
$ ./install


5. You might face problem with the installation of otcl-1.13, the problem can be due to the gcc-4.4.1 / g++-4.4.1 compilers. But please try this :

sudo apt-get install g++-4.3
CC=gcc-4.3 CXX=g++-4.3 ./install


try to edit the Makefile.in too

From :
CC= @CC@

to :
CC= gcc-4.3


6. Edit some paths ==a
$ gedit ~/.bashrc

Put these lines on that file. Off course, you might change /home/simulator for it depends on where you extract ns-allinone-2.34.tar.
# LD_LIBRARY_PATH
OTCL_LIB=/home/simulator/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/simulator/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/simulator/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/simulator/ns-allinone-2.34/bin:/home/simulator/ns-allinone-2.34/tcl8.4.18/unix:/home/simulator/ns-allinone-2.34/tk8.4.18/unix
NS=/home/simulator/ns-allinone-2.34/ns-2.34/
NAM=/home/simulator/ns-allinone-2.34/nam-1.13/
export PATH=$PATH:$XGRAPH:$NS:$NAM


7. Validate it
$ cd ns-2.34
$ ./validate


7. (Optionally) You can create a symlink, so that ns can be called from everywhere
$ sudo ln -s /home/simulator/ns-allinone-2.34/ns-2.34/ns /usr/bin/ns

8. Try to run it.
$ ns

[via]

Oct 13, 2008

How to install Ns-2-AllinOne-2.33 on Ubuntu 8.04

This is an example of the NS2-AllInOne-2.33 installation for Ubuntu 8.04.

Download the most recent Ns-2-AllinOne-2.33 from Sourceforge.

Suppose that there is "ns-allinone-2.33.tar.gz" in current directory (e.g. "~/" for me is "/home/mm").
All steps are done in Terminal, so open a terminal in Accessories/Terminal.

To extract the file:
tar xvfz ./ns-allinone-2.33.tar.gz

Go into extracted directory:
cd ns-allinone-2.33

Download required packages:
sudo apt-get install build-essential autoconf automake libxmu-dev

Start installation:
./install

Set environment parameter:
gedit ~/.bashrc
Then at the last line, append the following text with changing "/your/path" to the directory that contains "ns-allinone-2.33". (e.g. "/home/mm/" )

# LD_LIBRARY_PATH
OTCL_LIB=/home/mm/ns-allinone-2.33/otcl-1.13
NS2_LIB=/home/mm/ns-allinone-2.33/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/mm/ns-allinone-2.33/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/mm/ns-allinone-2.33/bin:/home/mm/ns-allinone-2.33/tcl8.4.18/unix:/home/mm/ns-allinone-2.33/tk8.4.18/unix
NS=/home/mm/ns-allinone-2.33/ns-2.33/
NAM=/home/mm/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM



[via]

Aug 27, 2006

Howto install ns-2 allinone onto Ubuntu linux

This HOWTO covers installation on Ubuntu Linux.

Get the allinone source.

$ cd ~lucsp
$ wget http://www.isi.edu/nsnam/dist/ns-allinone-2.28.tar.gz

Modify build for GDB debugger.

$ tar xzf ns-allinone-2.28.tar.gz
$ cd ns-allinone-2.28
$ vim install

Add the --enable-synbols option on line 408 so, ./configure --enable-gcc --disable-shared --prefix=$CUR_PATH || die "tcl8.3.2 configuration failed! Exiting ..." becomes,
./configure –-enable-symbols --enable-gcc --disable-shared --prefix=$CUR_PATH || die "tcl8.3.2 configuration failed! Exiting ..."

Add the –enable-debug option to line 498 so,
./configure || die "tclcl-$TCLCLVER configuration failed! Exiting ..."
becomes,
./configure -–enable-debug || die "tclcl-$TCLCLVER configuration failed! Exiting ..."

$ cd ns-2.28
$ vim Makefile.in

Add the -g option to line 82 so,
CFLAGS = $(CCOPT) $(DEFINE)
becomes,
CFLAGS = -g $(CCOPT) $(DEFINE)

X11/Intrinsic.h is required by otcl1-9 but is not in libx11-dev but is in libxt-dev.

$ sudo apt-get install -f libxt-dev libxt6 libsm-dev libsm6 libice-dev libice6

/usr/X11R6/include/X11/Xmu/WinUtil.h is required by nam-1.1.

$ sudo apt-get install libxmu-dev

xgraph Makefile requires modification.

$ cd ../xgraph-12.1
$ ./configure
$ vim Makefile

Add -L/usr/X11R6/lib on line 85 so,

xgraph_LDADD = $(ADDITIONAL_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(X_EXTRA_LIBS) -lX11 -lm becomes,
xgraph_LDADD = $(ADDITIONAL_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(X_EXTRA_LIBS) -L/usr/X11R6/lib -lX11 -lm

gt-itm requires a bin dir to be created.

$ cd ../gt-itm
$ mkdir bin
$ cd src
$ make

gt-itm and sgb2ns require sgb.

$ sudo apt-get sgb

gt-itm and sgb2ns require libgb.a to be at /home/lucsp/ns-allinone-2.28/gt-itm/lib.

$ mkdir lib
$ sudo ln -s usr/lib/libgb.a /home/lucsp/ns-allinone-2.28/gt-itm/lib

Fix pedantic gcc 3.3.5

$ cd src
$ vim eval.c

On line 162, the printf function argument must be on a single line.
printf(" and %d (this ends a connected component of the graph)\n", idx(g, artic_pt));

Compile NS-2.28.

$ cd ..
$ ./install &> compile.out

Environmental variables.

$ vim NS2.sh

#!/bin/sh

# LD_LIBRARY_PATH
OTCL_LIB=/home/lucsp/ns-allinone-2.28/otcl-1.9
NS2_LIB=/home/lucsp/ns-allinone-2.28/lib
X11_LIB=/usr/X11R6/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:/usr/local/lib

# TCL_LIBRARY
export TCL_LIBRARY=/home/lucsp/ns-allinone-2.28/tcl8.4.5/library:/usr/lib

# PATH
XGRAPH=/home/lucsp/ns-allinone-2.28/bin:/home/lucsp/ns-allinone-2.28/tcl8.4.5/unix:/home/lucsp/ns-allinone-2.28/tk8.4.5/unix
PATH=$PATH:$XGRAPH:/home/lucsp/ns-allinone-2.28/ns-2.28/

**source

tags :