Help to install ns2

267 views
Skip to first unread message

nadbo

unread,
May 12, 2015, 11:59:42 AM5/12/15
to ns-u...@googlegroups.com
Hello Sir,

I want to install ns2.34 in ubuntu13.04, but when i run ./install i get the following error:

make: *** [tk3d.o] Error 1
tk8.4.18 make failed! Exiting ...

Can you please help me as soon as possible

Best Wishes

knudfl

unread,
May 12, 2015, 12:28:47 PM5/12/15
to ns-u...@googlegroups.com
Hi .

$ sudo apt-get update && sudo apt-get install g++ g++-4.4 automake libtool patch libxmu-dev

Building ns-2.34, `method 1´ :
$ cd ns-allinone-2.34/
$ patch -p0 < otcl_ns234_gcc-4.4.patch
https://drive.google.com/file/d/0B7S255p3kFXNMG9xWjZ2X09ZYzg/view?usp=sharing
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install
$ cd ns-2.34/
$ sudo make install  ( 'make install'  will copy 'ns' to /usr/local/bin/

`Method 2´ ...  may also work with Ubuntu :
$ cd ns-allinone-2.34/
$ patch -p0 < ns234_gcc49.patch
https://drive.google.com/file/d/0B7S255p3kFXNZDNyV1BPZHhEY0U/view?usp=sharing
$ ./install
$ cd ns-2.34/
$ sudo make install

Xgraph : $ sudo apt-get install xgraph

NAM :  Download a package for your OS here ...
http://www.linuxquestions.org/questions/linux-newbie-8/ns-stop-couldn%27t-execute-nam-permission-denied-while-executing-exec-nam-4175524760/#2
Select i386 for i686 architecture, and  .amd64 for x86_64 architecture.
Click the downloaded package to install it.

** The Ubuntu 'nam' packages have been useless for about a year.
** The 'nam' from ns-allinone-2.34/ can also not be used as is.

-

nadbo

unread,
May 12, 2015, 12:54:12 PM5/12/15
to ns-u...@googlegroups.com
Dear sir, i followed ur instructions but now i get this error:

configure: error: installation or configuration problem: C compiler cannot create executables.
tcl8.4.18 configuration failed! Exiting ...
Tcl is not part of the ns project.

knudfl

unread,
May 12, 2015, 1:06:15 PM5/12/15
to ns-u...@googlegroups.com
?  Are you quite sure that you installed g++ and g++-4.4 ?

* $  sudo apt-get install g++ g++-4.4

Can be checked with the 'which' command :
$ which gcc
$ which g++
$ which gcc-4.4
$ which g++-4.4

-

nadbo

unread,
May 12, 2015, 1:46:38 PM5/12/15
to ns-u...@googlegroups.com
which gcc gives /usr/bin/gcc  other which commands give nothing. When i run sudo apt-get install g++ g++-4.4 automake libtool patch libxmu-dev
at the begining i get:

E: Unable to locate package g++-4.4
E: Couldn't find any package by regex 'g++-4.4'
E: Unable to locate package automake
E: Package 'libtool' has no installation candidate
E: Unable to locate package libxmu-dev

knudfl

unread,
May 12, 2015, 2:27:03 PM5/12/15
to ns-u...@googlegroups.com
https://wiki.ubuntu.com/Releases
OK ... end of life for Ubuntu 13.04 is :  January 27, 2014 !

So obviously "13.04" was moved to the "Ubuntu Museum",
.. and you will have to replace all text in /etc/apt/sources.list :
Please do :  $  sudo gedit /etc/apt/sources.list
...... delete all the current text,  and copy / paste  these new lines to the file :

deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted
deb http
://old-releases.ubuntu.com/ubuntu/ raring multiverse universe
deb http
://old-releases.ubuntu.com/ubuntu/ raring-updates main restricted
deb http
://old-releases.ubuntu.com/ubuntu/ raring-updates multiverse universe
deb http
://old-releases.ubuntu.com/ubuntu/ raring-backports main restricted
deb http
://old-releases.ubuntu.com/ubuntu/ raring-backports multiverse universe
deb http
://old-releases.ubuntu.com/ubuntu/ raring-security main restricted
deb http
://old-releases.ubuntu.com/ubuntu/ raring-security multiverse universe

..... Then please run  $ sudo apt-get update
... And you can now install packages :
$ sudo apt-get install g++ g++-4.4 automake libtool patch libxmu-dev xgraph

-

nadbo

unread,
May 12, 2015, 2:47:50 PM5/12/15
to ns-u...@googlegroups.com
Thanks a lot Sir, this installed ns correctly. i just wanna ask you if i have to add my path to the environment variables or is this step not necessary? thnks again

knudfl

unread,
May 12, 2015, 3:46:42 PM5/12/15
to ns-u...@googlegroups.com
Hi .

You hopefully already have the executable´s in a system PATH :
/usr/local/bin/{ nam, ns } ,  and /usr/bin/xgraph
..... So there are no path´s to add.

The old year ~1999 text ....
»» Please put .... ,,   IMPORTANT NOTICES: You MUST put .. ««
... was meant only for a "University Computer" : You had no write permissions to /usr/local/.

And :  The executable 'ns'  ( or ns renamed or copied to 'ns-new-name' ) .....
... is hard coded to know the location of it´s libraries :
ns-allinone-2.34/{ bin/tcsh8* , lib/*/* }.

-

nadbo

unread,
May 12, 2015, 6:37:11 PM5/12/15
to ns-u...@googlegroups.com
Actually i found xgraph and ns but no nam in the system path, how can i add it please?

knudfl

unread,
May 12, 2015, 6:56:14 PM5/12/15
to ns-u...@googlegroups.com
Hi .

See my above first post :  Download a nam package from my backup ...
http://www.linuxquestions.org/questions/linux-newbie-8/ns-stop-couldn%27t-execute-nam-permission-denied-while-executing-exec-nam-4175524760/#2

You have not yet told which Ubuntu 13.04 you have.
If its the 32bits version : nam_1.15-10_i386.deb
Link = https://drive.google.com/file/d/0B7S255p3kFXNUkx0LVU1NnFVQTA/view?usp=sharing

And if you have a 64bits "13.04" :  nam_1.14_amd64.deb
Link = https://drive.google.com/file/d/0B7S255p3kFXNNmtLeXhsaG5hXzQ/view?usp=sharing

HOWTO decide your architecture :  $ uname -m

-

nadbo

unread,
May 12, 2015, 7:18:25 PM5/12/15
to ns-u...@googlegroups.com
It's done thanks a loot

nadbo

unread,
May 13, 2015, 8:52:16 AM5/13/15
to ns-u...@googlegroups.com
Hi Sir
I also installed ns2.35, now if i wanna switch the work between these 2 ns versions how can i do that?

knudfl

unread,
May 13, 2015, 9:46:01 AM5/13/15
to ns-u...@googlegroups.com
Hi .

* You can have as many ns-allinone-2.xx as you want, installed at the same time.
( But do never add a *PATH text to .bashrc ).

The setup :
1)  $  cd ns-2.34/
$  cp ns ns234   ( Any naming can be used, see the post about path, from yesterday.)
$  sudo cp ns234  /usr/local/bin/

2)  $  cd ns-2.35/
$  cp ns ns235
$  sudo cp ns235  /usr/local/bin/

* All files.tcl  can be run with 'ns_any-name' :   $ ns235  file.tcl
Only if you run a simulation with a shell script :
... then the command 'ns' must be present, in the right version, in /usr/local/bin/
( Unless you edit the shell script to e.g.  'ns234' instead of 'ns'.)

P.S.: I have about  180 different patched "ns-allinone-2.xx"  on one OS, so you can have more than two :)
(  $  ls /usr/local/bin/ns* | wc  ....  The count of my ns*** is 190 today.)

-

nadbo

unread,
May 13, 2015, 10:44:37 AM5/13/15
to ns-u...@googlegroups.com
Thanks a lot :)
Reply all
Reply to author
Forward
0 new messages