Skip to content

Belajar Menginstall ns-allinone-2.34 di ubuntu 9.10

11 August 2010

Belajar Menginstall ns-allinone-2.34 di ubuntu 9.10

[1]. Download source ns-allinone-2.34 disini
[2]. Buat folder dan simpan hasil download-an tadi
root@toiletumum:/home/harry/mkdir ns
[3]. cd ns
[4]. lalu extrak ns-allinone-2.34.tar
root@toiletumum:/home/harry/ns# tar -xvf ns-allinone-2.34.tar
[5]. Download & install some packages from repository

root@toiletumum:/home/harry/ns# sudo apt-get install build-essential
autoconf automake libxmu-dev

Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version.
The following packages were automatically installed and are no longer required:
libprelude2
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
autotools-dev libice-dev libpthread-stubs0 libpthread-stubs0-dev libsm-dev
libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxext-dev libxmu-headers
libxt-dev m4 x11proto-core-dev x11proto-input-dev x11proto-kb-dev
x11proto-xext-dev xtrans-dev
Suggested packages:
autoconf2.13 autobook autoconf-archive gnu-standards autoconf-doc libtool
The following NEW packages will be installed:
autoconf automake autotools-dev libice-dev libpthread-stubs0
libpthread-stubs0-dev libsm-dev libx11-dev libxau-dev libxcb1-dev
libxdmcp-dev libxext-dev libxmu-dev libxmu-headers libxt-dev m4
x11proto-core-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev
xtrans-dev
0 upgraded, 21 newly installed, 0 to remove and 4 not upgraded.
Need to get 4,438kB of archives.
After this operation, 13.4MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version.
The following packages were automatically installed and are no longer required:
libprelude2
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
autotools-dev libice-dev libpthread-stubs0 libpthread-stubs0-dev libsm-dev
libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxext-dev libxmu-headers
libxt-dev m4 x11proto-core-dev x11proto-input-dev x11proto-kb-dev
x11proto-xext-dev xtrans-dev
Suggested packages:
autoconf2.13 autobook autoconf-archive gnu-standards autoconf-doc libtool
The following NEW packages will be installed:
autoconf automake autotools-dev libice-dev libpthread-stubs0
libpthread-stubs0-dev libsm-dev libx11-dev libxau-dev libxcb1-dev
libxdmcp-dev libxext-dev libxmu-dev libxmu-headers libxt-dev m4
x11proto-core-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev
xtrans-dev
0 upgraded, 21 newly installed, 0 to remove and 4 not upgraded.
Need to get 4,438kB of archives.
After this operation, 13.4MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://10.14.200.108 karmic/main x11proto-core-dev 7.0.15-1 [94.0kB]
Get:2 http://10.14.200.108 karmic/main libice-dev 2:1.0.5-1 [61.9kB]
Get:3 http://10.14.200.108 karmic/main libsm-dev 2:1.1.0-2 [25.7kB]
Get:4 http://10.14.200.108 karmic/main libxau-dev 1:1.0.4-2 [16.7kB]
Get:5 http://10.14.200.108 karmic/main libxdmcp-dev 1:1.0.2-3 [20.0kB]
Get:6 http://10.14.200.108 karmic/main x11proto-input-dev 1.5.0-2ubuntu1 [12.1kB]
Get:7 http://10.14.200.108 karmic/main x11proto-kb-dev 1.0.3-3ubuntu1 [27.4kB]
Get:8 http://10.14.200.108 karmic/main xtrans-dev 1.2.4-1 [67.4kB]
Get:9 http://10.14.200.108 karmic/main libpthread-stubs0 0.1-2 [2,812B]
Get:10 http://10.14.200.108 karmic/main libpthread-stubs0-dev 0.1-2 [3,090B]
Get:11 http://10.14.200.108 karmic/main libxcb1-dev 1.4-1 [78.8kB]
Get:12 http://10.14.200.108 karmic/main libx11-dev 2:1.2.2-1ubuntu1 [1,920kB]
Get:13 http://10.14.200.108 karmic/main x11proto-xext-dev 7.0.4-2 [42.1kB]
Get:14 http://10.14.200.108 karmic/main libxext-dev 2:1.0.99.1-0ubuntu4 [79.3kB]
Get:15 http://10.14.200.108 karmic/main libxmu-headers 2:1.0.4-2 [21.5kB]
Get:16 http://10.14.200.108 karmic/main libxt-dev 1:1.0.5-3ubuntu1 [485kB]
Get:17 http://10.14.200.108 karmic/main m4 1.4.13-2 [241kB]
Get:18 http://10.14.200.108 karmic/main autoconf 2.64-1ubuntu1 [558kB]
Get:19 http://10.14.200.108 karmic/main autotools-dev 20090427.1 [63.7kB]
Get:20 http://10.14.200.108 karmic/main automake 1:1.11-1 [559kB]
Get:21 http://10.14.200.108 karmic/main libxmu-dev 2:1.0.4-2 [60.2kB]
Fetched 4,438kB in 1min 5s (68.2kB/s)
Selecting previously deselected package x11proto-core-dev.
(Reading database … 165352 files and directories currently installed.)
Unpacking x11proto-core-dev (from …/x11proto-core-dev_7.0.15-1_all.deb) …
Selecting previously deselected package libice-dev.
Unpacking libice-dev (from …/libice-dev_2%3a1.0.5-1_i386.deb) …
Selecting previously deselected package libsm-dev.
Unpacking libsm-dev (from …/libsm-dev_2%3a1.1.0-2_i386.deb) …
Selecting previously deselected package libxau-dev.
Unpacking libxau-dev (from …/libxau-dev_1%3a1.0.4-2_i386.deb) …
Selecting previously deselected package libxdmcp-dev.
Unpacking libxdmcp-dev (from …/libxdmcp-dev_1%3a1.0.2-3_i386.deb) …
Selecting previously deselected package x11proto-input-dev.
Unpacking x11proto-input-dev (from …/x11proto-input-dev_1.5.0-2ubuntu1_all.deb) …
Selecting previously deselected package x11proto-kb-dev.
Unpacking x11proto-kb-dev (from …/x11proto-kb-dev_1.0.3-3ubuntu1_all.deb) …
Selecting previously deselected package xtrans-dev.
Unpacking xtrans-dev (from …/xtrans-dev_1.2.4-1_all.deb) …
Selecting previously deselected package libpthread-stubs0.
Unpacking libpthread-stubs0 (from …/libpthread-stubs0_0.1-2_i386.deb) …
Selecting previously deselected package libpthread-stubs0-dev.
Unpacking libpthread-stubs0-dev (from …/libpthread-stubs0-dev_0.1-2_i386.deb) …
Selecting previously deselected package libxcb1-dev.
Unpacking libxcb1-dev (from …/libxcb1-dev_1.4-1_i386.deb) …
Selecting previously deselected package libx11-dev.
Unpacking libx11-dev (from …/libx11-dev_2%3a1.2.2-1ubuntu1_i386.deb) …
Selecting previously deselected package x11proto-xext-dev.
Unpacking x11proto-xext-dev (from …/x11proto-xext-dev_7.0.4-2_all.deb) …
Selecting previously deselected package libxext-dev.
Unpacking libxext-dev (from …/libxext-dev_2%3a1.0.99.1-0ubuntu4_i386.deb) …
Selecting previously deselected package libxmu-headers.
Unpacking libxmu-headers (from …/libxmu-headers_2%3a1.0.4-2_all.deb) …
Selecting previously deselected package libxt-dev.
Unpacking libxt-dev (from …/libxt-dev_1%3a1.0.5-3ubuntu1_i386.deb) …
Selecting previously deselected package m4.
Unpacking m4 (from …/archives/m4_1.4.13-2_i386.deb) …
Selecting previously deselected package autoconf.
Unpacking autoconf (from …/autoconf_2.64-1ubuntu1_all.deb) …
Selecting previously deselected package autotools-dev.
Unpacking autotools-dev (from …/autotools-dev_20090427.1_all.deb) …
Selecting previously deselected package automake.
Unpacking automake (from …/automake_1%3a1.11-1_all.deb) …
Selecting previously deselected package libxmu-dev.
Unpacking libxmu-dev (from …/libxmu-dev_2%3a1.0.4-2_i386.deb) …
Processing triggers for man-db …
Processing triggers for install-info …
Processing triggers for doc-base …
Processing 1 added doc-base file(s)…
Registering documents with scrollkeeper…
Setting up x11proto-core-dev (7.0.15-1) …
Setting up libice-dev (2:1.0.5-1) …
Setting up libsm-dev (2:1.1.0-2) …
Setting up libxau-dev (1:1.0.4-2) …
Setting up libxdmcp-dev (1:1.0.2-3) …
Setting up x11proto-input-dev (1.5.0-2ubuntu1) …
Setting up x11proto-kb-dev (1.0.3-3ubuntu1) …
Setting up xtrans-dev (1.2.4-1) …
Setting up libpthread-stubs0 (0.1-2) …
Setting up libpthread-stubs0-dev (0.1-2) …
Setting up libxcb1-dev (1.4-1) …
Setting up libx11-dev (2:1.2.2-1ubuntu1) …
Setting up x11proto-xext-dev (7.0.4-2) …
Setting up libxext-dev (2:1.0.99.1-0ubuntu4) …
Setting up libxmu-headers (2:1.0.4-2) …
Setting up libxt-dev (1:1.0.5-3ubuntu1) …
Setting up m4 (1.4.13-2) …
Setting up autoconf (2.64-1ubuntu1) …
Ignoring install-info called from maintainer script
The package autoconf should be rebuild with new debhelper to get trigger support
Ignoring install-info called from maintainer script
The package autoconf should be rebuild with new debhelper to get trigger support
Ignoring install-info called from maintainer script
The package autoconf should be rebuild with new debhelper to get trigger support

Setting up autotools-dev (20090427.1) …
Setting up automake (1:1.11-1) …
update-alternatives: using /usr/bin/automake-1.11 to provide /usr/bin/automake (automake) in auto mode.

Setting up libxmu-dev (2:1.0.4-2) …
root@toiletumum:/home/harry/ns#

[6]. Install the ns2
root@toiletumum:/home/harry/ns#cd ns-allinone-2.34
root@toiletumum:/home/harry/ns/ns-allinone-2.34#./install

[7].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.
============================================================
* Build OTcl-1.13
============================================================
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 C 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 ISO C89… 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 grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/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 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.18… 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 X11 header files
checking for X11 library archive
checking for XOpenDisplay in -lX11… yes
checking for XShmAttach in -lXext… yes
checking for ranlib… ranlib
checking for a BSD-compatible install… /usr/bin/install -c
checking system version (for dynamic loading)… Linux-2.6.31-14-generic
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
creating ./gen
creating ./bin
rm -f libotcl.a otcl.o
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -I. -I/home/harry/ns/ns-allinone-2.34/include -I/home/harry/ns/ns-allinone-2.34/include -I/home/harry/ns/ns-allinone-2.34/include -I/include  otcl.c
ar cq libotcl.a otcl.o
ranlib libotcl.a
rm -f libotcl.so otcl.o so_locations
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/harry/ns/ns-allinone-2.34/include -I/home/harry/ns/ns-allinone-2.34/include -I/home/harry/ns/ns-allinone-2.34/include -I/include  otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch’:
/home/harry/ns/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local’
otcl.o: In function `Otcl_Init’:
/home/harry/ns/ns-allinone-2.34/otcl-1.13/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 make failed! Exiting …
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
root@toiletumum:/home/harry/ns/ns-allinone-2.34#

[8].But please try this : sudo apt-get install g++-4.3
CC=gcc-4.3 CXX=g++-4.3 ./install

root@toiletumum:/home/harry/ns/ns-allinone-2.34# sudo apt-get install g++-4.3
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libprelude2
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
cpp-4.3 gcc-4.3 gcc-4.3-base libstdc++6-4.3-dev
Suggested packages:
gcc-4.3-locales g++-4.3-multilib gcc-4.3-doc libstdc++6-4.3-dbg
gcc-4.3-multilib libmudflap0-4.3-dev libgcc1-dbg libgomp1-dbg
libmudflap0-dbg libstdc++6-4.3-doc
The following NEW packages will be installed:
cpp-4.3 g++-4.3 gcc-4.3 gcc-4.3-base libstdc++6-4.3-dev
0 upgraded, 5 newly installed, 0 to remove and 4 not upgraded.
Need to get 11.6MB of archives.
After this operation, 31.5MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://10.14.200.108 karmic/universe gcc-4.3-base 4.3.4-5ubuntu1 [110kB]
Get:2 http://10.14.200.108 karmic/universe cpp-4.3 4.3.4-5ubuntu1 [3,092kB]
Get:3 http://10.14.200.108 karmic/universe gcc-4.3 4.3.4-5ubuntu1 [2,934kB]
Get:4 http://10.14.200.108 karmic/universe libstdc++6-4.3-dev 4.3.4-5ubuntu1 [1,348kB]
Get:5 http://10.14.200.108 karmic/universe g++-4.3 4.3.4-5ubuntu1 [4,138kB]
Fetched 11.6MB in 3min 7s (62.0kB/s)
Selecting previously deselected package gcc-4.3-base.
(Reading database … 167052 files and directories currently installed.)
Unpacking gcc-4.3-base (from …/gcc-4.3-base_4.3.4-5ubuntu1_i386.deb) …
Selecting previously deselected package cpp-4.3.
Unpacking cpp-4.3 (from …/cpp-4.3_4.3.4-5ubuntu1_i386.deb) …
Selecting previously deselected package gcc-4.3.
Unpacking gcc-4.3 (from …/gcc-4.3_4.3.4-5ubuntu1_i386.deb) …
Selecting previously deselected package libstdc++6-4.3-dev.
Unpacking libstdc++6-4.3-dev (from …/libstdc++6-4.3-dev_4.3.4-5ubuntu1_i386.deb) …
Selecting previously deselected package g++-4.3.
Unpacking g++-4.3 (from …/g++-4.3_4.3.4-5ubuntu1_i386.deb) …
Processing triggers for man-db …
Setting up gcc-4.3-base (4.3.4-5ubuntu1) …
Setting up cpp-4.3 (4.3.4-5ubuntu1) …
Setting up gcc-4.3 (4.3.4-5ubuntu1) …
Setting up g++-4.3 (4.3.4-5ubuntu1) …
Setting up libstdc++6-4.3-dev (4.3.4-5ubuntu1) …
root@toiletumum:/home/harry/ns/ns-allinone-2.34#
[9]. try to edit the Makefile.in too

From :
CC= @CC@
to :
CC= gcc-4.3

[10]. root@toiletumum:/home/harry/ns/ns-allinone-2.34# ./install
———————————————————————————-
Please put /home/harry/ns/ns-allinone-2.34/bin:/home/harry/ns/ns-allinone-2.34/tcl8.4.18/unix:/home/harry/ns/ns-allinone-2.34/tk8.4.18/unix
into your PATH environment; so that you’ll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/harry/ns/ns-allinone-2.34/otcl-1.13, /home/harry/ns/ns-allinone-2.34/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/harry/ns/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.

After these steps, you can now run the ns validation suite with
cd ns-2.34; ./validate

For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.

root@toiletumum:/home/harry/ns/ns-allinone-2.34#

[11]. gedit ~/.bashrc
add this:

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

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

save and exit.

[12].
root@toiletumum:/home/harry/ns/ns-allinone-2.34#cd ns-2.34
root@toiletumum:/home/harry/ns/ns-allinone-2.34/ns-2.34# ./validate

…..
Running test mixed:
../../ns test-suite-satellite.tcl mixed QUIET
Test output agrees with reference output
Running test wired:
../../ns test-suite-satellite.tcl wired QUIET
Test output agrees with reference output
Running test aloha:
../../ns test-suite-satellite.tcl aloha QUIET
Test output agrees with reference output
Running test aloha.collisions:
../../ns test-suite-satellite.tcl aloha.collisions QUIET
Test output agrees with reference output
Running test mixed.legacy:
../../ns test-suite-satellite.tcl mixed.legacy QUIET
Test output agrees with reference output
All test output agrees with reference output.
Wed Aug 11 13:25:41 WIT 2010
These messages are NOT errors and can be ignored:
warning: using backward compatibility mode
This test is not implemented in backward compatibility mode

validate overall report: all tests passed
root@toiletumum:/home/harry/ns/ns-allinone-2.34/ns-2.34#

[13].sudo ln -s /home/harry/ns/ns-allinone-2.34/ns-2.34/ /usr/bin/ns
[14]. test it

root@toiletumum:/home/harry/ns/ns-allinone-2.34/ns-2.34/tcl/ex# ns simple.tcl
root@toiletumum:/home/harry/ns/ns-allinone-2.34/ns-2.34/tcl/ex# ns simple.tcl
ns: command not found
root@toiletumum:/home/harry/ns/ns-allinone-2.34/ns-2.34/tcl/ex# source ~/.bashrc

root@toiletumum:/home/harry/ns/ns-allinone-2.34/ns-2.34/tcl/ex# ns simple.tcl
210
0.0037499999999999999
running nam…
root@toiletumum:/home/harry/ns/ns-allinone-2.34/ns-2.34/tcl/ex#

[15].Selamat Mencoba

reference:
http://ns-2.blogspot.com/2009/11/how-to-install-ns-234-on-ubuntu-910.html

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: