Showing posts with label install. Show all posts
Showing posts with label install. Show all posts

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 31, 2006

How to install the tcl-debug onto Cygwin + ns2 release 2.28

[ns] [Answer] How to install the tcl-debug onto Cygwin + ns2 release 2.28
tk424 tk424 at umr.edu
Thu Jun 16 10:23:08 PDT 2005

Dear NS-users,

I decided to email to share my experience how to install the tcl-debug2.0.
I've seen some emails from NS mailing list archive providing useful information.
I recommend you to try the STANDARD method to install tcl-debug suggested by
(1) the NS-manual, Chap. 22.1. Tcl-level debugging.
(2) the archive, Title: [ns] re:how to debug TCL by Jiangtao Luo (Nov.2004)
http://mailman.isi.edu/pipermail/ns-users/2004-November/045925.html
(3) The README file given by Tcl-debug

But I needed some more information and help to make my tcl-debug work.
The help is mostly from the other NS users in the archive, Regina Rosales Hain, and Prof. Larry Pyeatt.
By sharing my experience, some of you may save time and effort. :)
The method in this email is just one option and there are so many other (and easy) ways to deal with problems as well.

------------------------------------------------------------------------------------
Target:
Information about the installation of tcl-debugger for NS-2;
tcl-debug is suggested on the official NS-2 website.
I've got the same installation problem as minisivakumar vellore (Mar. 2005), which I didn't find the solution in the archive yet.

------------------------------------------------------------------------------------
Assumption:
Installation of Cygwin and NS-2 is successful.
(This email only deals with the installation of tcl-debug.)
Tcl-debug will be installed onto a directory parallel to the NS-2 directory, i.e. ~ns (by the convention in the NS manual)

------------------------------------------------------------------------------------
My system:
OS: Windows XP + Cygwin (http://www.cygwin.com/setup.exe)
(I guess the Cygwin DLL release version is 1.5.17-1 <http://cygwin.com/ml/cygwin-announce/2005-05/msg00029.html> )
NS-2: release 2.28 all-in-one package
(http://www.isi.edu/nsnam/dist/ns-allinone-2.28.tar.gz)
Tcl debugger: tcl-debug version 1.7
(http://expect.nist.gov/tcl-debug/tcl-debug.tar.gz)

NS-2 is installed on the user's home directory, /home/UserID;
therefore. /home/UserID/ns-allinone-2.28
------------------------------------------------------------------------------------
Refered links:
http://www.cygwin.com/
http://www.isi.edu/nsnam/ns/
http://mailman.isi.edu/pipermail/ns-users/

------------------------------------------------------------------------------------
Installation of tcl-debug

1. Download the tcl-debug and move the downloaded file to NS-2 root directory, i.e. ns-allinone-2.28.
To download, http://expect.nist.gov/tcl-debug/tcl-debug.tar.gz
You should be in the NS-2 root directory
$ cd /home/UserID/ns-allinone-2.28

UserID is your account. For example, the account name phil4u becomes /home/phil4u/ns-allinone-2.28

2. Extract the downloaded tcl-debug file.
$ tar -xfz tcl-debug.tar.gz

Then, the extracted files will be automatically copied into a new directory, tcl-debug-2.0
Note: The reason we extract the files into a directory PARALLEL to the directory ~ns,
i.e. /home/UserID/ns-allinone-2.28/ns-2.28, is because of the step 4.3.

3. Compile the tcl-debug and move the created loadable library to the NS-2 library directory
1) Move to the directory where tcl-debug is.
$ cd tcl-debug-2.0

2) Configure and compile tcl-debug
$ ./configure
$ make

3) Check whether a loadable library (*.a) is created after compilation.
See if a file "libtcldbg.a" is there.
As its name, this file is the loadable "library for tcl debug".

4) Copy the loadable library to the NS-2 library directory, /home/UserID/ns-allinone-2.28/ns-2.28/lib or ~ns/lib
$ cp *.a ../ns-2.28/lib

Note: After compilation, we don't get an executable file, but a loadable library.

4. Compile the NS-2
1) Go to the directory ~ns/lib and check whether the loadable library is properly copied.
$ cd ../ns-2.28/lib
$ ls

2) Move to the directory ~ns, /home/UserID/ns-allinone-2.28/ns-2.28
cd ..

3) Configure NS-2 with an option enabling tcl-debug
$ ./configure --with-tcldebug

Note: You should see lines showing that the directory of tcl-debug is recognized.
If you don't see this line below, you should get back to the previous steps.

Checking for libtcldbg... -L/home/UserID/ns-allinone-2.28/ns-2.28/ ../tcl-debug-2.0 -ltcldbg

I see this line above a line given below,

checking dmallc... not requested with --with-dmalloc

4) Erase previous compilation record
$ make clean

Note: This step is important!

5) Compile NS-2
$ make
Now the tcl-debug is embedded to the created NS-2 executable file "ns.exe" for cygwin

6) Check if you can run the NS-2 excutable.
$ ns
%
As you know, NS-2 works fine if you see %. ( Press ctrl+C )

7) Copy this NS-2 excutable to the ns-allinone-2.28/bin directory
$ cp ns.exe ../lib/

5. Check if the tcl-debug works.
Now the installation is done. You can check if the debugger works by adding a line "debug 1" into a tcl script.
For example,
1) pick a tcl script in ~ns/tcl/ex directory, say wireless-test.tcl,
and modify this tcl script with a text editor.

set ns_ [new Simulator]
debug 1; # this line calls the tcl-debug
set chan [new $opt(chan)]

2) Run the wireless-test.tcl
$ ns wireless-test.tcl

After running this script, you will see the following lines if the installation is successful.
2: lappend auto_path $dbg_library
dbg2.0>

If you still see the error message while you think you've done right so far, please check step 4.1, 4.3. 4.4, 4.6.
Good luck!

Tae-hyung Kim

tags :

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 :

May 7, 2006

Problem in Installing NS 2.29.2-allinone

If you find this error in your installation of the new version ns-allinone 2.29 2 :

"checking system version (for dynamic loading)... ./configure: line
7624: syntax error near unexpected token ')'
./configure: line 7624: ' OSF*)'
tcl8.3.2 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com to see
if they have a fix for your problem."


the problem is due to these files :

  • tcl: file tcl8.x.x/unix/tcl.m4.

  • tk: file tk8.x.x/unix/tcl.m4.

  • otcl: file otcl-1.x/configure.in.


  • According to Gauraz,

    The line generating the problem was :

    system=MP-RAS-`awk ' { print $3 } '/etc/.relid'`

    The problem lies in how bash 3.1.x and 4.x.x parse the configure file. This will simply pass through bash 3.0.x and lower versions. So in order to make things work I changed the above line to:

    system=MP-RAS-`awk ' { print $3 } '/etc/.relid`

    You will have to take following steps in order to bring the changes into effect:
    Remove the second last character ( ' ) from the line and do this for all the three files above. Now after changing the configuration files you will have to delete older configure file and any cache if it exists in the respective folders. After that do not forget to run autoconf from command line in the respective folders to generate a fresh configure file.

    And finally re-install it by the following command :

    ./install


    UPDATE :

    For Fedora core 5 or Debian users, you may find the following errors :

    some modifications should be done for ns2 source files, including:
    tcl_install_path/unix/configure
    tcl_install_path/unix/tcl.m4
    tk_install_path/unix/configure
    tk_install_path/unix/tcl.m4
    otcl_install_path/unix/configure

    The modification is:
    searching .relid'` in above files
    and replacing them with .relid`

    If you don't do above changes,
    then when you install, an error will occur:
    " checking system version (for dynamic loading)... syntax error near... "

    and there is a patch for that here :

    http://www.ececs.uc.edu/~cdmc/ucbt/src/ns2292-gcc410.patch

    sha1sum
    dc355ec01ca7ceae7f4a237fdf997ca31efd432f ns2292-gcc410.patch

    Tags :