nam problem in ns-allinone-2.35RC10

2,780 views
Skip to first unread message

Abbas

unread,
May 17, 2012, 5:00:25 PM5/17/12
to Network Simulator 2 (NS2)
hi everybody
I have installed ns-allinone-2.35RC10 on ubuntu10.4.
after installation and setting environment variables,
with running "ns" and "xgraph" command in directory "root@ubuntu:~/ns-
allinone-2.35-RC10/bin" i haven't problem but
when i write "nam", i face with this message:


nam: Can't find a usable tk.tcl in the following directories:
/root/ns-allinone-2.35-RC10/tcl8.5.8/library/tk8.5 /root/ns-
allinone-2.35-RC10/tcl8.5.8/tk8.5 ./lib/tk8.5 /root/ns-allinone-2.35-
RC10/lib/tk8.5 ./library

/root/ns-allinone-2.35-RC10/lib/tk8.5/tk.tcl: wrong # args: should be
"::source fileName"
wrong # args: should be "::source fileName"
while executing
"::source -encoding utf-8 /root/ns-allinone-2.35-RC10/lib/tk8.5/msgs/
en.msg"
("uplevel" body line 1)
invoked from within
"uplevel 1 [list ::source -encoding utf-8 $langfile]"
(procedure "::msgcat::mcload" line 10)
invoked from within
"::msgcat::mcload [file join $::tk_library msgs]"
(in namespace eval "::tk::msgcat" script line 23)
invoked from within
"namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {package require msgcat}]} {
# The msgcat package..."
(in namespace eval "::tk" script line 3)
invoked from within
"namespace eval ::tk {
# Set up the msgcat commands
namespace eval msgcat {
namespace export mc mcmax
if {[interp issafe] || [catch {p..."
(file "/root/ns-allinone-2.35-RC10/lib/tk8.5/tk.tcl" line 23)
invoked from within
"source.orig /root/ns-allinone-2.35-RC10/lib/tk8.5/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /root/ns-allinone-2.35-RC10/lib/tk8.5/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $file]"


This probably means that tk wasn't installed properly.

what should i do?
can anyone help me?!

haixiu

unread,
Oct 5, 2012, 8:43:44 AM10/5/12
to ns-u...@googlegroups.com
i am wondering if you have solver this problem ,i have the same problem.

在 2012年5月18日星期五UTC+8上午5时00分25秒,Abbas写道:

Kishore Ravi

unread,
Oct 5, 2012, 10:01:39 AM10/5/12
to ns-u...@googlegroups.com
Hi

You need to set the path of tcl/tk path in TCL_LIBRARY environment variable in .bash_profile and logout and login again. then try it.

if not come

then one source is change dir to ns-allinone-2.35-RC10 and type nam at console.

all the best

William Truong

unread,
Nov 7, 2012, 4:55:29 AM11/7/12
to ns-u...@googlegroups.com
Thank you very much for your solution!

I solved this problem by adding the path to TCL_LIBRARY variable in .bashrc like:

export TCL_LIBRARY=/home/username/Desktop/ns-allinone-2.35/tcl8.5.10/library:/home/username/Desktop/ns-allinone-2.35/tk8.5.10/library

And run "source ~./bashrc" in terminal.

Dogukan Cagatay

unread,
Dec 7, 2012, 8:15:50 AM12/7/12
to ns-u...@googlegroups.com
The same problem appeared in Mac OS X Mountain Lion ns-2 allinone install of me. Adding tk library path to TCL_LIBRARY variable solved my problem too.

Thank you all.

rprabh...@gmail.com

unread,
Apr 5, 2013, 6:15:19 AM4/5/13
to ns-u...@googlegroups.com
I struggled a lot to resolve. Finally I end up with your reply...Thanks a lot...

Arputha Rini

unread,
Mar 8, 2014, 10:13:36 AM3/8/14
to ns-u...@googlegroups.com
Hi ,
I installed ns2 initially sucessfully with
tracegraph in fedora 14 . But , i had to reinstall again due to errors
in my code . now , when i reinstalled ns2 but i am not able to install
nam and tracegraph .
when i try to run nam within the current directory itself i am
getting error messages like :
 probably tk wasnt install properly

i set the path also:
my path settings:
PATH=$PATH:$HOME:/home/fosslab/Desktop/ns-allinone-2.35/ns-2.35/bin:/home/fosslab/Desktop/ns-allinone-2.35/xgraph-12.2

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/fosslab/Desktop/ns-allinone-2.35/otcl-1.14:/home/fosslab/Desktop/ns-allinone-2.35/lib:/home/fosslab/Desktop/tracegraph202/bin/glnx86

export TCL_LIBRARY=/home/fosslab/Desktop/ns-allinone-2.35/tcl8.5.10/library:/home/fosslab/Desktop/ns-allinone-2.35/tk8.5.10/library

export PATH


knudfl

unread,
Mar 8, 2014, 1:42:06 PM3/8/14
to ns-u...@googlegroups.com
@Arputha Rini , Hi.

Nam : Install an rpm package ..
32bits (i686) : nam-1.14-1.el6.i686.rpm
https://drive.google.com/file/d/0B7S255p3kFXNLWhoVWp3MzVFWlU/edit?usp=sharing
... or if it's a 64bits (x86_64) OS (Not recommended for ns2) : nam-1.14-2.el6.x86_64.rpm
https://drive.google.com/file/d/0B7S255p3kFXNWDVsMThlaDVCQU0/edit?usp=sharing
.. Install with # yum localinstall nam-1.14*
Note : nam-1.14 is statically compiled with tcl/tk. I.e. will also work on an OS with no ns2, tcl / tk.
The other version, nam-1.15,  doesn't come with build options that advanced.

Howto start `tracegraph' :
$ export LD_LIBRARY_PATH=./bin/glnx86 && ./trgraph
Post #70 here http://www.linuxquestions.org/questions/programming-9/ns2-4175449125/page5.html

Setting all those *PATH's in .bashrc :  Not required. It's just a 15 year old text from a time,
when people used the University computer, and had no permissions to install 'ns' to /usr/local/bin/.
Today you can do this :
1)  $ cd ns-allinone-2.35/ns-2.35/
2)  # make install
..... and 'make install' will copy the executable 'ns' to  /usr/local/bin/ .
Note 2 : 'ns' is hard coded to know the location of it's libraries, etc.: tclsh8.5, libtcl*, libtk*.

-

VABI EDWARD

unread,
Sep 15, 2017, 2:14:13 AM9/15/17
to Network Simulator 2 (NS2)
Hi, 
i have the same error but i can't seem to find any tk installed.

I have added the neccessary paths as requested but nam isn't sill working.

knudfl

unread,
Sep 15, 2017, 5:50:25 AM9/15/17
to Network Simulator 2 (NS2)
@VABI EDWARD,   Hi.

1)  Please use an updated version of ns-allinone-2.35 :
ns-allinone-2.35_gcc5.tar.gz ( The 2014 - 2017 update )
https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing
I.e. can build a valid 'nam' on any genuine 'Linux OS'  (Not Cygwin?)

2) About nam : All packages → →
https://www.linuxquestions.org/questions/linux-newbie-8/ns-stop-couldn%27t-execute-nam-permission-denied-while-executing-exec-nam-4175524760/#2

Ubuntu, Mint, Debian : Please uninstall any 'nam' package. Only Ubuntu 17.04 has a usable nam package.deb

------------------------------

VABI EDWARD

unread,
Sep 16, 2017, 10:11:12 AM9/16/17
to Network Simulator 2 (NS2)
Thank you Sir, worked.
Reply all
Reply to author
Forward
0 new messages