LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How can I install NS2 ? (https://www.linuxquestions.org/questions/linux-software-2/how-can-i-install-ns2-421797/)

hoang_it 03-05-2006 05:47 AM

How can I install NS2 ?
 
Hello everybody!
My name is Hoang. I use Fedora core 4. I want to use NS2 (network simulator 2) so I tried to install ns-allinone2.28 many times but there were many error so I can't install it.
Please help me! thanks very much!

perfect_circle 03-06-2006 03:45 PM

hi there and welcome to LQ Forums.

I have installed ns2 all in one or as seperated packages just fine in slackware.
If i remember correct one my co-students could easily install it in Fedora, but maybe fedora 3.

I don't know but the problem might be that fedora core 4 uses gcc-4.0 which is still considered beta by many. Thare are many things that cannot be compiled with gcc-4.0.

But I don't know. What kind of errors do you get?
Maybe there is an rpm version of ns2, so you don't need to compile it at all....

hoang_it 03-07-2006 07:33 AM

Error occured while installing tk8.4.5
 
While installing tk8.4.5, many error occured. So ns2 cannot to be installed. I have used Fedora Core 4 recently, I dont't have many experiences, so I don't know what the errors are. I will post the log file to you soon. Thanks!

kazim425 02-26-2008 02:36 AM

steps to install ns2 in fedora
 
you can follow these steps in any linux environment

INSTALLING NS-2 ON FEDORA 8

STEP 1

From terminal login as super user and do the following.(internet must also be connected in order to install the package dependencies.

yum install autoconf
yum install automake
yum install gcc-c++
yum install libX11-devel
yum install xorg-x11-proto-devel
yum install libXt-devel
And for nam installation (optional):
yum install libXmu-devel

STEP 2

From terminal go to the folder where the ns-allinone patch is placed and type the following to extract
$ tar -xzf ns-allinone-2.31.tar.gz
$ cd ns-allinone-2.29
$. /install

STEP 3

Now go to /etc folder and type

gedit ~/.bashrc

Add the following lines to the end of it. Remember replace "/your/path" by something like "/home/kazim". And accordingly also change the version numbers. This is for ns 2.31.

# LD_LIBRARY_PATH
OTCL_LIB=/your/path/ns-allinone-2.31/otcl-1.13
NS2_LIB=/your/path/ns-allinone-2.31/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=/your/path/ns-allinone-2.31/tcl8.4.14/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/your/path/ns-allinone-2.31/bin:/your/path/ns-allinone-2.31/tcl8.4.14/unix:/your/path/ns-allinone-2.31/tk8.4.14/unix
NS=/your/path/ns-allinone-2.31/ns-2.31/
NAM=/your/path/ns-allinone-2.31/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM

Let it take effect immediately

source ~/.bashrc



Note: the step described above is important; otherwise, you cannot run ns successfully.
or you can restart your X windows.i.e. logout and then login, or reboot your system, to make it work.)

Now, the installation has been completed. If you try:
$ ns

Then a "%" will appear on the screen.type "exit" to quit the mode and back to "$"


If you miss out step 1 you may get the following errors

Build XGraph-12.1
============================================================
loading cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... missing
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking if malloc debugging is wanted... no
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH
make: *** No targets specified and no makefile found. Stop.
Can not create xgraph; But xgraph is an optional package, continuing...

If you miss step 3

At the prompt when you type ns you will get
Ns command not found

algabusi 09-12-2008 04:51 PM

failed to install ns-allinone-2.33 on fedora 8
 
i'm also failed to install ns-allinone-2.33 on fedora 8,
i'm following step1&2 and i'm thinking there is no problem in my step1&2

ok this is my step 3..
my step 3 gedit ~/.bashrc text is:-

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions

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

# PATH
XGRAPH=/home/kfaizal/ns-allinone-2.33/bin:/home/kfaizal/ns-allinone-2.33/tcl8.4.18/unix:/home/kfaizal/ns-allinone-2.33/tk8.4.18/unix
NS=/home/kfaizal/ns-allinone-2.33/ns-2.33/
NAM=/home/kfaizal/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM

is it correct?

after saving the [.bashrc(~) - gedit]
i'm type [ [kfaizal@localhost etc]$ source ~/.bashrc]
then i'm type [kfaizal@localhost etc]$ ns
and the output is [bash: ns: command not found]
i'm trying to restart and the same output [bash: ns: command not found] i'm get..
i've try the step1,2,3 around 10times and the result still the same..
somebody please help me

dludenar 11-21-2008 03:20 AM

Hello Algabusi

In order to solve your installation problem please refer to:

http://www.gidforums.com/t-11746.html?page=4

You will find a complete guide how to install ns2 in fedora or redhat based systems.

If you have any question please let me know

Regards

Dennis

mq15 04-14-2009 01:36 AM

anyone got another way to install ns2
 
Hi all.

yum is taking too much time in installing ns2, Is there is any other means we can install ns2 like rmp (RedHat Package Manager)?
Please help.
Regards

dludenar 04-14-2009 03:22 AM

Hello mq15

I hope you are fine. Well, I've never heard of a binary file or rpm package of NS2. It would however to be a good idea for students or other users, to make easy the process of course. Also, I don't know if there is any repository that you can use to install NS2 using yum.

Please check that you have all the needed packages updated:

gcc
gcc-c++

tcl.i386
tcl-devel.i386
tclx.i386

tk.i386

libX11-devel

You can check the status of these packages using yum.

I recommend you to use the allinone package from NS2. After you checked all this packages are ok follow this as a normal user NOT root:

in the directory you want to install NS2:

tar zxf ns-allinone-x.xx.tar.gz x.xx = your version

then:

cd ns-allinone-x.xx

then:

./install

after the installation process you must receive a message like:

Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.15: /Projects/ns-allinone-2.32/{bin,include,lib}
tk8.4.15: /Projects/ns-allinone-2.32/{bin,include,lib}
otcl: /Projects/ns-allinone-2.32/otcl-1.13
tclcl: /Projects/ns-allinone-2.32/tclcl-1.19
ns: /Projects/ns-allinone-2.32/ns-2.32/ns
nam: /Projects/ns-allinone-2.32/nam-1.13/nam
xgraph: /Projects/ns-allinone-2.32/xgraph-12.1
gt-itm: /Projects/ns-allinone-2.32/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns

then:

# Eventually these will go into .bash_profile
PATH=$PATH:/home/yourname/ns-allinone-2.31/bin:/home/yourname/ns-allinone-2.31/tcl8.4.14/unix:/home/yourname/ns-allinone-2.31/tk8.4.14/unix
export PATH

LD_LIBRARY_PATH=/home/yourname/ns-allinone-2.31/otcl-1.13:/home/yourname/ns-allinone-2.31/lib:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH

TCL_LIBRARY=/home/yourname/ns-allinone-2.31/tcl8.4.14/library:$TCL_LIBRARY
export TCL_LIBRARY

then:

Include the files above in the .absch_profile but before make a back up of that file

then:

execute ns

if your prompt change to:

%

type exit

It means that your installation was succesfull.

then:

./validate


And that's all enjoy it!!!

If you have any questions please let us know to help you

Regards

Dennis

mq15 04-14-2009 12:11 PM

I think I would NEVER find words to THANK you Dennis (dludenar)

Actually I was bored of ns2 installation, I am constantly receiving this message:
Another app is holding the yum lock;waiting for it to exit...
Another app is holding the yum lock;waiting for it to exit...
Another app is holding the yum lock;waiting for it to exit...

dludenar 04-14-2009 08:42 PM

Hello mq15

You are very welcome!!! Well about your question, it seems that the software updater of Fedora is running the same time that you want to check some of you updated applications. You have to options:

1. Wait until the software updater finish or
2. Being root please put the command:

/etc/init.d/yum-updatesd stop

This will stop the auto-update and you will be able to continue using yum.

If you have any other questions please let us know

Regards

mq15 04-16-2009 09:21 AM

Hello dludenar,
when I enter this command:
#./install

I get the following error:
============================================================
* Testing for Darwin (OS X) environment
============================================================
============================================================
* Testing for Cygwin environment
============================================================
Cygwin not detected, proceeding with regular install.
============================================================
* Build XGraph-12.1
============================================================
loading cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking if malloc debugging is wanted... no
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH
make: *** No targets specified and no makefile found. Stop.
Can not create xgraph; But xgraph is an optional package, continuing...
============================================================
* Build CWeb
============================================================
Making cweb
gcc -g -c -o ctangle.o ctangle.c
make: gcc: Command not found
make: *** [ctangle.o] Error 127
cweb failed to make, but it's optional
chmod: cannot access `cweave': No such file or directory
chmod: cannot access `ctangle': No such file or directory
ln: creating symbolic link `cweave': File exists
ln: creating symbolic link `ctangle': File exists
============================================================
* Build Stanford GraphBase
============================================================
Making sgb
cc -g -I/usr/local/sgb/include -DDATA_DIRECTORY=\"/usr/local/sgb/data/\" -c gb_io.c
make: cc: Command not found
make: *** [gb_io.o] Error 127
Unable to create sgb library, but it's optional, so continuing...
============================================================
* Build GT-ITM
============================================================
sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing..
============================================================
* Build zlib
============================================================
Checking for gcc...
Building static library libz.a version 1.2.3 with cc.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
Checking for errno.h... No.
Checking for mmap support... No.
cc -O -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o example.o example.c
make: cc: Command not found
make: *** [example.o] Error 127
Zlib make failed, but it's optional Continue ...
============================================================
* Build tcl8.4.15
============================================================
loading cache ./config.cache
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH
tcl8.4.15 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.
[root@localhost ns-allinone-2.32]#

Please help me out.

dludenar 04-16-2009 07:23 PM

Hello mq15

It seems that your tcl package is not installed.

Could you give me the result of the command:

yum info tcl

Regards

Dennis

mq15 04-17-2009 09:08 PM

u were very right Dennis, the tcl package wasn't installed.I re-installed this by:
#yum install gcc-c++
the ns is now installed successfully,thanking to you.

But now I am installing ns on a system of my friends. At first command.i.e
yum install autoconf
I get this error:

Loaded plugins: refresh-packagekit
primary.sqlite.bz2 | 2.0 MB 00:59
http://mirror.lums.edu.pk/fedora/pub...ry.sqlite.bz2: [Errno 4] Socket Error: timed out
Trying other mirror.
primary.sqlite.bz2 | 2.0 MB 00:50
http://ftp.jaist.ac.jp/pub/Linux/Fed...ry.sqlite.bz2: [Errno 4] Socket Error: timed out
Trying other mirror.

Please help me out,or this ns installation will blast me out.plese help.

dludenar 04-18-2009 05:04 AM

Hello mq15

Well it seems that the mirror that yum is trying to get the information is not working properly, wait for a second and try again. Yum must try to find another mirror to get the information.

Please let me know what happen

Regards

Dennis

mq15 04-18-2009 10:20 AM

Thanks Dennis for this perpetual assistance.
I waited for about 7 hours, every mirror timmes out after 2.0MB of download.
Should I wait so long?
Regards


All times are GMT -5. The time now is 12:43 AM.