LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to install multiple ns packages in ubuntu 12.04 (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-multiple-ns-packages-in-ubuntu-12-04-a-4175513708/)

pon 08-06-2014 08:01 AM

How to install multiple ns packages in ubuntu 12.04
 
hi everyone,

I am new to ns2 , i have ns2.35 in my ubuntu 12.04 , i'd like to add more ns2 packages like ns2.27,2.28,2.33,2.34

i tried to install ns-2.33 along with ns-2.35 but it occurs more errors.
primarily i'd like to install ns-2.33 now ,

so anyone help me to solve this problem

and also how can i switch to one ns pack from other ns pack while execution


Thanks in Advance

evo2 08-07-2014 12:57 AM

Hi,

how did you try to install it? What errors occurred?

Evo2.

pon 08-07-2014 01:20 AM

ya Me.evo

i got erro like Ns make failed,... i already installed ns-23.5 now i am trying to install ns-2.33

when i type gedit ~/.bashrc it is poening file , but when i command


source ~/.bashrc , it is showing

bash: /bin: Is a directory

i used to add and delete LD PATH more times but i did not get message like this before


Kindly support me to clear this issue

evo2 08-07-2014 01:23 AM

Hi,

sorry, I don't understand what you are trying to say. Please use full words, and when reporting what you did and the errors that result, report *exactly* what was in your terminal Eg cut and paste into [code] blocks.

Evo2.

pon 08-07-2014 01:31 AM

for installation of ns-2.33

i followed these steps :

step 1.$ sudo apt-get install gcc-4.4 g++-4.4

step 2: sudo apt-get install libxt-dev libx11-dev libxmu-dev xorg-dev xgraph

step 3:cd /home/abdusy/ns-allinone-2.34

// on below steps i made some changes in some files
STEP 4: ~$ gedit /home/abdusy/ns-allinone-2.34/otcl-1.13/configure
Linux*)
SHLIB_CFLAGS=”-fpic”
#SHLIB_LD=”ld -shared” //disabled this line
SHLIB_LD=”gcc -shared” // add this line
SHLIB_SUFFIX=”.so”
DL_LIBS=”-ldl”
SHLD_FLAGS=””
;;

The next file you need to modified is ns-2.34/tools/ranvar.cc and change the line 219.

STEP 5 : ~$ gedit /home/abdusy/ns-allinone-2.34/ns-2.34/tools/ranvar.cc
SOLVED:
double GammaRandomVariable::value()
{
// Proposed by Marsaglia in 2000:
// G. Marsaglia, W. W. Tsang: A simple method for gereating Gamma variables
// ACM Transactions on mathematical software, Vol. 26, No. 3, Sept. 2000
if (alpha_ < 1) {
double u = rng_->uniform(1.0);
//return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_); /* Disabled*/
return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_); /*add this line*/
}

Next step is change the lines 183 and 185 in file ns-2.34/mobile/nakagami.cc.

STEP 6 : ~$ gedit /home/abdusy/ns-allinone-2.34/ns-2.34/mobile/nakagami.cc
SOLVED:
if (int_m == m) {
//resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
} else {
//resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
resultPower = GammaRandomVariable(m, Pr/m).value();
}

The next step is to edit line 270 in tcl8.4.18/unix/Makefile.in.

STEP 7 : ~$ gedit /home/abdusy/ns-allinone-2.34/tcl8.4.18/Makefile.in
SOLVED:
#CC = @CC@
CC = @CC@-4.4

To used gcc-4.4 and g++-4.4 as compiler to compile ns-allinone-2.34, change the line 36-37 in ns-2.34/Makefile.in.

STEP 8 : ~$ gedit /home/abdusy/ns-allinone-2.34/ns-2.34/Makefile.in
SOLVED:
#CC = @CC@
#CPP = @CXX@
CC = @CC@-4.4
CPP = @CXX@-4.4

Also change the line 36-37 in ns-2.34/Makefile

STEP 9 : ~$ gedit /home/abdusy/ns-allinone-2.34/ns-2.34/Makefile
SOLVED:
#CC = gcc
#CPP = g++
CC = gcc-4.4
CPP = g++-4.4

Final Step: cd na-allinone-2.33/ ./install

Error: Ns make failed,....

But one notable thing was after gone through these procedures i was not able to execute ns files in prev ns-2.35,

shown like ns not installed ,

again now i successfully installed ns-2.35

evo2 08-07-2014 01:44 AM

Hi,

that's a somewhat convoluted procedure. I'm afraid it will be difficult to understand what is going on.

Why are you following this procedure? Why can't you just do
Code:

./configure --prefix=/path/to/somewhere
make
make install

Also, why do you want so many versions of ns installed?

Evo2.

pon 08-07-2014 01:47 AM

Error message on terminal is:

config.status: creating Makefile
rm -f libotcl.so otcl.o so_locations
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/chase/ns-allinone-2.34/include -I/home/chase/ns-allinone-2.34/include -I/home/chase/ns-allinone-2.34/include -I/include otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch':
/home/chase/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/chase/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ...

pon 08-07-2014 02:01 AM

i need it to be installed because i am getting patch files of various protocols each in different ns-versions ,

i followed the procedure from link below:

http://abdusyarif.wordpress.com/2012...ntu-12-04-lts/

most of the people suggested is to modify makefile.in,packet.h, and someother files,

so only i gone through that complicated procedure,

i installed ns-2.35 multiple times in my computer by simple commands as like you said in post #6 , that too i tried for ns-2.34 not worked,...

evo2 08-07-2014 02:01 AM

Hi,

sorry, can't help if I don't understand what you are trying to do and why. That is why I asked questions. After that we can try to address specific problems you are having.

Evo2.

pon 08-07-2014 02:10 AM

Ok Thanks,,....

i ll try,..

pon 08-07-2014 02:56 AM

New problem i am facing in ubuntu [Apart from abovesaid problem]

When i open a terminal in ubuntu 12.04 Lts i am getting 1st line like

bash: /bin: Is a directory
chase@chase-desktop:~$



when i command source ~/.bashrc

i am getting like: bash: /bin Is a directory,

WHY IT IS COMING LIKE THIS,SOMEONE HELP ME,

Before that i worked on terminals and edited bashrc so many times , but i did not get those messages

evo2 08-07-2014 03:06 AM

Hi,

post #4 seems to indicate that you have edited your ~/.bashrc in doing so you may have broken your environment. You can return it to its original state by recopying it from /etc/skel. For example

Code:

cp ~/.bashrc ~/.bashrc.backup
cp /etc/skel/.bashrc ~/

Did you edit any other files in your home directory?

Evo2.

PS. Please don't yell at us.

pon 08-07-2014 03:34 AM

Could you please come to thread on below link, there i attached screen shot of my terminal in post#1
because in this thread i am not able to attach screenshot i dont know why ,


sorry for your inconvenience , Thanks for your patience.

http://www.linuxquestions.org/questi...63#post5216763

pon 08-07-2014 03:39 AM

Super evo2 , i followed the command in post #12
and i solved this bashrc file issue, but still problem in ns-2.33 installation is pending

My humble thanks to you Mr.EVO
Thanks A loTTTTTTTTTtt

I solved issue in opening teminal


All times are GMT -5. The time now is 02:28 PM.