Category Archives: Linux

How to install latest nsmiracle.

nsmiracle is apparently stuck at version 1.2.2 published in 11-07-2008 as shown on his official website.

but that’s not true because is still in development and a currently updated version can be retrieved by using subversion (svn).

let’s see how to proceed.

1) install subversion if miss it and litbool too. libtool is an automated tool that create makefile and configures. open terminal and type

sudo apt-get install subversion libtool

2) download the latest version (actually rev 97) from nsmiracle repository

svn co --username nsmiracle-dev-guest --password nsmiracleguest https://telecom.dei.unipd.it:/tlcrepos/nsmiracle-dev/trunk

3) go inside trunk: main is the nsmiracle latest release and inside addon folder there are sandbox, umts, wimax and other supplementary modules
4) copy main folder and paste wherever you want (i put it inside ns-allinone directory). i suggest to rename main folder to something that you can easily remember (“nsmiracle” for example)
5) open terminal and inside nsmiracle directory type in order (configure need your actually paths. i left mine just for example)

$ ./autogen.sh
$ ./configure --with-ns-allinone=/home/lotti/Scrivania/ns/ns-allinone-2.34 --prefix=/home/lotti/Scrivania/ns/ns-allinone-2.34 --disable-static --with-dei80211mr=/home/lotti/Scrivania/ns/ns-allinone-2.34/dei80211mr-1.1.4
$ make
$ make install

6) now you’re ready to use nsmiracle

if you need to use also addons here there is an example

1) copy the wanted addon directory inside nsmiracle directory
2) open a terminal and go to the addon freshly pasted directory
3) type (always use your actual paths!):

$ ./autogen.sh
$ ./configure --with-ns-allinone=/home/lotti/Scrivania/ns/ns-allinone-2.34 --with-nsmiracle=/home/lotti/Scrivania/ns/ns-allinone-2.34/nsmiracle
$ make

that’s all.

run some samples to check if everything works. (some samples are broken – most errors are on loading libraries because of wrong paths)

Install ns-allinone-2.34 on ubuntu karmic koala 9.10 and ubuntu lucid lynx 10.04

i wrote this tutorial because official ns installation problems website actually return a blank useless page. all the credits goes to nsnam.isi.edu people.
the googled cache copy of the page is here.

WARNING: apply point 3-4 only if you noticed the error while installing ns-allinone-2.34 the first time.

 otcl.o: In function `OTclDispatch':
 /home/ns/ns-allinone-2.34/otcl/otcl.c:495: undefined reference to `__stack_chk_fail_local'
 otcl.o: In function `Otcl_Init':
 /home/ns/ns-allinone-2.34/otcl/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
 ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
 ld: final link failed: Nonrepresentable section on output
 make: *** [libotcl.so] Error 1

otcl-1.13 has some compatibility issues with latest g++ (>=4.4) but ns-allinone-2.34 need it.

all you have to do to fix issues and make a successfull installation is:

0)

sudo apt-get install build-essential autoconf automake libxmu-dev

1) extract ns-allinone wherever you want. open directory, go to otcl-1.13.

2) open configure file (the one without extension)

3) search for:

    Linux*)
        SHLIB_CFLAGS="-fpic"
        SHLIB_LD="ld -shared"
        SHLIB_SUFFIX=".so"
        DL_LIBS="-ldl"
        SHLD_FLAGS=""
        ;;

and replace it with

    Linux*)
        SHLIB_CFLAGS="-fpic"
        SHLIB_LD="gcc -shared"
        SHLIB_SUFFIX=".so"
        DL_LIBS="-ldl"
        SHLD_FLAGS=""
        ;;

4) save configure file

5) go back to ns-allinone-2.34 main directory and launch install.

6) remember to add to your .bash file (hided inside your home directory) with path variables. here there are mine for example

# LD_LIBRARY_PATH
OTCL_LIB=/home/lotti/Scrivania/ns/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/lotti/Scrivania/ns/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/lotti/Scrivania/ns/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

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

7) test it: close actual terminal and open a new one (to reload changed .bash file) and type “ns”. if a % appear, your actually on ns2 console.

Finish!