6

when i use NS2 through terminal i keep getting a segment fault (core dumped) message.

g_0zek@g-0zeK-pc:~$ ns lab1.tcl
g_0zek@g-0zeK-pc:~$ nam lab1.nam
Segmentation fault (core dumped)

despite that xgraph works ok

the code in the tcl seems ok as it was given from university and one friend of mine runs it fine. Any ideas?

ioandr
  • 133

3 Answers3

7

Do not install via terminal.

Download ns-allinone-2.35.tar.gz file from https://sourceforge.net/projects/nsnam/

Install the following dependicies

sudo apt-get install tcl8.5-dev tk8.5-dev gcc-4.4 g++-4.4 build-essential autoconf automake perl xgraph libxt-dev libx11-dev libxmu-dev.

Extract ns-allinone-2.35.tar.gz

open ns-allinone-2.35/ns-2.35/linkstate/ls.h file.

go to line number 137.

change

"void eraseAll() {erase(baseMap::begin(), baseMap::end());}"  

to

"void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }"

then goto ns-allinone-2.35 directory

cd home/isysway/ns-allinone-2.35/
./install

it takes some time

come to home directory

isysway@isysway:~$ sudo gedit .bashrc

a text file will open

go to end of the file

add the following line

PATH=$PATH:/home/isysway/ns-allinone-2.35/bin:/home/isysway/ns-allinone-2.35/tcl8.5.10/unix:/home/isysway/ns-allinone-2.35/tk8.5.10/unix
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/isysway/ns-allinone-2.35/otcl-1.14/lib:/home/isysway/ns-allinone-2.35/lib
TCL_LIBRARY=$TCL_LIBRARY:/home/isysway/ns-allinone-2.35/tcl8.5.10/library
export PATH
export LD_LIBRARY_PATH
export TCL_LIBRARY

note:my user name is "isysway" you replace it with yours

isysway@isysway:~$source .bashrc

then

isysway@isysway:~$ns

%

if the modulo symbol comes you did it.

norbitwise
  • 340
  • 2
  • 7
1

Make sure you installed NS correctly. How ? east download one TCl file which does not run nam. If you do not know nam is just for depicting the algorithm graphically. After download and run TCL file ( As I said download nam free or at least your self disable that line or make them as comment on your TCL file .

There is some problems on running nam on 14.04 . You should download nam from here and copy the extracted file in to your /usr/local/bin . But I just test that for ubuntu 32 bit 14.04 .

By the way if you are new to NS2. I should tell you it not necessary to follow erlang NS2 method. If you are enough not in horry I recommend you to look at here: http://www.linuxquestions.org/questions/linux-newbie-8/ns2-version-2-34-is-too-old-wpan-802-15-4-a-4175499373/

Mohammad Reza Rezwani
  • 10,286
  • 36
  • 92
  • 128
0

I think there must be a bug in the Ubuntu 14.04 package. Probably the best thing to do is install from source until a package maintainer fixes the problem. I have gone ahead reported the bug.

OEP
  • 141
  • 1
  • 1
  • 6