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!

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

  1. Pingback: Install ns-allinone-2.34 on ubuntu 9.10 | Lotti's DevLog Ubuntu Netbook

  2. jfsanchez

    I have the problem with installation the moment the run the comenad make:

    make[1]: No se hace nada para `all-am’.
    make[1]: se sale del directorio `/home/nsmiracle-1.2.2/trunk/main’

    Please help me
    Thanks

  3. Lotti Post author

    please trasnslate in english the console errors and tell me if you’re trying to install NS or NSMIRACLE

  4. jfsanchez

    @Lotti
    Excuse my problem is with installing nsmiracle, some examples do not compile (sample1, sample2, etc).

    make [1]: Nothing to be done for `all-am ‘.
    make [1]: Leaving directory `/ home/nsmiracle-1.2.2/trunk/main ‘

    I will simulate 802.11 with multiple channel-multiple interface, is it possible with nsmiracle?

    Thank you very much for your time.

  5. Lotti Post author

    you didn’t have to compile examples with “make” but you have to run them with ns..

    try typing “ns sample1.tcl” inside the directory where sample1.tcl is.

    for the second question, i don’t know. try to ask it on the official mailing list

  6. jfsanchez

    I know the commands. My question is I have problems when installing with the command make.
    Some examples compile but not run the samples folder

    root@jimmy-laptop:/home/ns-allinone-2.34/nsmiracle/main/samples/sample1# ns sample1.tcl

    couldn’t load file “../../sandbox/.libs/libMiracleSandbox.so.0.0.0”: ../../sandbox/.libs/libMiracleSandbox.so.0.0.0: cannot open shared object file: No such file or directory
    while executing
    “load ../../sandbox/.libs/libMiracleSandbox.so.0.0.0”
    (file “sample1.tcl” line 41

    I do not have the library installed sandbox and neither can I do for synaptic

  7. Lotti Post author

    did you compile the sandbox library?

    you have to run autogen + configure + make, but not make install.

    actually i’m at office, this evening i will post console commands to do this (just “configure” command deserve an explatanation).

  8. Lotti Post author

    ./autogen.sh
    ./configure –with-ns-allinone=path/to/ns-allinone-2.34 –with-nsmiracle=path/to/nsmiracle
    make

  9. Manjula

    Sir Thank you for your reply. I have installed ns-2.35 and as per the installation procedure of nsmiracle I have installed it. But I am not able to find the path for libMiracleSandbox.so.0.0.0 even after adding addons folder to nsmiracle and following 3 steps autogen + configure + make. So can you suggest me how should I proceed. Thank you.

  10. Valerio Riva Post author

    Assure you have moved the addon directory inside nsmiracle folder in this way:

    nsmiracle/

    and not

    nsmiracle/addons/

    I didn’t write a clear point, that time.

  11. mazhar

    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:
    and replace it with

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

    4) save configure file

    but i got error

    ./configure: line 6307: syntax error near unexpected token `;’
    ./configure: line 6307: ` SHLD_FLAGS=""’
    otcl-1.13 configuration failed! Exiting …

  12. mazhar

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

    with

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

Leave a Reply

Your email address will not be published. Required fields are marked *