Ubuntu – Segmentation fault (core dumped) in nam ubuntu 14.04

segmentation fault

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?

Best Answer

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.

Related Question