how to install ns2.27 on Ubuntu 9.10 64-bits version
Hi,
I tried to install ns2.27 on my Ubuntu 9.10 64-bits version. I downloaded the gcc-3.3...amd64.deb instead of the one you recommend. When installing the debian files, I get this at the terminal sudo dpkg -i cpp-3.3_3.3.6-15ubuntu4_amd64.deb g++-3.3_3.3.6-15ubuntu4_amd64.deb gcc-3.3_3.3.6-15ubuntu4_amd64.deb gcc-3.3-base_3.3.6-15ubuntu4_amd64.deb libstdc++5-3.3-dev_3.3.6-15ubuntu4_amd64.deb [sudo] password for cielo: (Reading database ... 152340 files and directories currently installed.) Preparing to replace cpp-3.3 1:3.3.6-15ubuntu4 (using cpp-3.3_3.3.6-15ubuntu4_amd64.deb) ... Unpacking replacement cpp-3.3 ... Preparing to replace g++-3.3 1:3.3.6-15ubuntu4 (using g++-3.3_3.3.6-15ubuntu4_amd64.deb) ... Unpacking replacement g++-3.3 ... Preparing to replace gcc-3.3 1:3.3.6-15ubuntu4 (using gcc-3.3_3.3.6-15ubuntu4_amd64.deb) ... Unpacking replacement gcc-3.3 ... Preparing to replace gcc-3.3-base 1:3.3.6-15ubuntu4 (using gcc-3.3-base_3.3.6-15ubuntu4_amd64.deb) ... Unpacking replacement gcc-3.3-base ... Preparing to replace libstdc++5-3.3-dev 1:3.3.6-15ubuntu4 (using libstdc++5-3.3-dev_3.3.6-15ubuntu4_amd64.deb) ... Unpacking replacement libstdc++5-3.3-dev ... Setting up gcc-3.3-base (1:3.3.6-15ubuntu4) ... Setting up cpp-3.3 (1:3.3.6-15ubuntu4) ... Processing triggers for man-db ... Setting up gcc-3.3 (1:3.3.6-15ubuntu4) ... Setting up libstdc++5-3.3-dev (1:3.3.6-15ubuntu4) ... Setting up g++-3.3 (1:3.3.6-15ubuntu4) ... I don't see any errors but the file is not installed (I think) because when I go to synaptic they are not there. And trying to proceed with the ns2 installation results in error since I don't have the gcc3.3 |
Welcome to LQ.
All your installs say "replace / replacement" : Looks like the packages were already installed. 'g++-3.3' can also be installed with 'sudo apt-get install' or Synaptic .. I.e. add Hardy to /etc/apt/sources.list .. Code:
deb http://76.73.4.58/ubuntu/ hardy-updates main ( And / or : which g++-3.3 ). What are the errors you get, when you compile ns-2.27 ? ? .. |
Thanks a lot for the warm welcome :)
Quote:
/usr/bin/g++ /usr/bin/g++-3.3 /usr/bin/g++-4.3 (I have no idea what that means, but I'm assuming it means somehow g++3.3_3.3.6 is installed) And the errors that I get when installing ns2.27 are these: for i in indep-utils/cmu-scen-gen/setdest indep-utils/webtrace-conv/dec indep-utils/webtrace-conv/epa indep-utils/webtrace-conv/nlanr indep-utils/webtrace-conv/ucb; do ( cd $i; make all; ) done make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest' g++ -c -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@ -o setdest.o setdest.cc setdest.cc:71:1: warning: "INFINITY" redefined In file included from /usr/include/math.h:40, from setdest.cc:43: /usr/include/bits/inf.h:27:1: warning: this is the location of the previous definition In file included from ../../../config.h:54, from setdest.h:5, from setdest.cc:57: ../../../autoconf.h:85: error: ‘CPP_NAMESPACE’ is not a namespace-name ../../../autoconf.h:85: error: expected namespace-name before ‘;’ token In file included from setdest.cc:57: setdest.h:26: error: extra qualification ‘vector::’ on member ‘operator=’ setdest.h:31: error: extra qualification ‘vector::’ on member ‘operator+=’ setdest.h:36: error: extra qualification ‘vector::’ on member ‘operator==’ setdest.h:39: error: extra qualification ‘vector::’ on member ‘operator!=’ setdest.cc: In member function ‘void Node::Dump()’: setdest.cc:876: error: cast from ‘Neighbor*’ to ‘int’ loses precision make[1]: *** [setdest.o] Error 1 make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest' make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec' g++ -c -DSTL_NAMESPACE=@STL_NAMESPACE@ -I. -I/home/cielo/ns2/ns-allinone-2.27/tclcl-1.15 -I/home/cielo/ns2/ns-allinone-2.27/otcl-1.8 -I/home/cielo/ns2/ns-allinone-2.27/include -I/home/cielo/ns2/ns-allinone-2.27/include -I/usr/include/pcap -o proxytrace.o proxytrace.cc In file included from proxytrace.cc:3: ../../../autoconf.h:85: error: ‘CPP_NAMESPACE’ is not a namespace-name ../../../autoconf.h:85: error: expected namespace-name before ‘;’ token make[1]: *** [proxytrace.o] Error 1 make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec' make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa' g++ -c -I. -I/home/cielo/ns2/ns-allinone-2.27/tclcl-1.15 -I/home/cielo/ns2/ns-allinone-2.27/otcl-1.8 -I/home/cielo/ns2/ns-allinone-2.27/include -I/home/cielo/ns2/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc tr-stat.cc: In function ‘double lf_analyze(Entry&)’: tr-stat.cc:154: error: cast from ‘void*’ to ‘int’ loses precision make[1]: *** [tr-stat.o] Error 1 make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa' make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr' g++ -c -DSTL_NAMESPACE=@STL_NAMESPACE@ -I. -I../../.. -I/home/cielo/ns2/ns-allinone-2.27/tclcl-1.15 -I/home/cielo/ns2/ns-allinone-2.27/otcl-1.8 -I/home/cielo/ns2/ns-allinone-2.27/include -I/home/cielo/ns2/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc In file included from ../../../config.h:54, from logparse.h:7, from tr-stat.cc:24: ../../../autoconf.h:85: error: ‘CPP_NAMESPACE’ is not a namespace-name ../../../autoconf.h:85: error: expected namespace-name before ‘;’ token tr-stat.cc: In function ‘double lf_analyze(lf_entry&)’: tr-stat.cc:141: error: cast from ‘void*’ to ‘int’ loses precision tr-stat.cc:152: error: cast from ‘void*’ to ‘int’ loses precision make[1]: *** [tr-stat.o] Error 1 make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr' make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb' g++ -c -I. -I/home/cielo/ns2/ns-allinone-2.27/tclcl-1.15 -I/home/cielo/ns2/ns-allinone-2.27/otcl-1.8 -I/home/cielo/ns2/ns-allinone-2.27/include -I/home/cielo/ns2/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc tr-stat.cc: In function ‘double lf_analyze(lf_entry&)’: tr-stat.cc:174: error: cast from ‘void*’ to ‘int’ loses precision tr-stat.cc:187: error: cast from ‘void*’ to ‘int’ loses precision make[1]: *** [tr-stat.o] Error 1 make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb' make: *** [all-recursive] Error 2 Ns make failed! I think the error is related to the gcc. But I don't know how to fix it. Thanks again for replying. |
Yes, those are errors only occurring on a 64 Bits OS.
The example, you show from ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ is ucb/ , which comes with a separate Makefile.in . Line 27 can be edited to : CC = g++-3.3 These files are actually of minor importance, as the binary 'ns' at this stage already has been created. ( As I remember it.) Except from ucb/, there may be a couple more directories in webtrace-conv/ with either a Makefile.in or a Makefile. Same procedure : You can try editing CC = @CXX@ to CC = g++-3.3 , if they cause errors. Good luck ! .. |
Thanks knudfl!
in ../ns2.27 I typed the following command "find -iname Makefile.in" Then, you get the following directories: ./indep-utils/webtrace-conv/ucb/Makefile.in ./indep-utils/webtrace-conv/dec/Makefile.in ./indep-utils/webtrace-conv/epa/Makefile.in ./indep-utils/webtrace-conv/nlanr/Makefile.in ./indep-utils/cmu-scen-gen/setdest/Makefile.in ./Makefile.in I manually modified each Makefile.in changing line #27 CC = @CXX@ to CC = gcc-3.3. I know you said g++-3.3 but I got confused since in your thread you said gcc-3.3. Makefile is automatically modified when you change Makefile.in, so no need to edit it. Anyway, there is an improvement in the errors. I'm only getting this now: make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest' g++ -c -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@ -o setdest.o setdest.cc setdest.cc:71:1: warning: "INFINITY" redefined In file included from /usr/include/math.h:40, from setdest.cc:43: /usr/include/bits/inf.h:27:1: warning: this is the location of the previous definition In file included from ../../../config.h:54, from setdest.h:5, from setdest.cc:57: ../../../autoconf.h:85: error: ‘CPP_NAMESPACE’ is not a namespace-name ../../../autoconf.h:85: error: expected namespace-name before ‘;’ token In file included from setdest.cc:57: setdest.h:26: error: extra qualification ‘vector::’ on member ‘operator=’ setdest.h:31: error: extra qualification ‘vector::’ on member ‘operator+=’ setdest.h:36: error: extra qualification ‘vector::’ on member ‘operator==’ setdest.h:39: error: extra qualification ‘vector::’ on member ‘operator!=’ setdest.cc: In member function ‘void Node::Dump()’: setdest.cc:876: error: cast from ‘Neighbor*’ to ‘int’ loses precision make[1]: *** [setdest.o] Error 1 make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest' make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec' gcc-3.3 -c -DSTL_NAMESPACE=@STL_NAMESPACE@ -I. -I/home/cielo/ns2/ns-allinone-2.27/tclcl-1.15 -I/home/cielo/ns2/ns-allinone-2.27/otcl-1.8 -I/home/cielo/ns2/ns-allinone-2.27/include -I/home/cielo/ns2/ns-allinone-2.27/include -I/usr/include/pcap -o proxytrace.o proxytrace.cc In file included from proxytrace.cc:3: ../../../autoconf.h:85: error: namespace `CPP_NAMESPACE' undeclared make[1]: *** [proxytrace.o] Error 1 make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec' make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa' make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr' gcc-3.3 -c -DSTL_NAMESPACE=@STL_NAMESPACE@ -I. -I../../.. -I/home/cielo/ns2/ns-allinone-2.27/tclcl-1.15 -I/home/cielo/ns2/ns-allinone-2.27/otcl-1.8 -I/home/cielo/ns2/ns-allinone-2.27/include -I/home/cielo/ns2/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc In file included from ../../../config.h:54, from logparse.h:7, from tr-stat.cc:24: ../../../autoconf.h:85: error: namespace `CPP_NAMESPACE' undeclared tr-stat.cc: In function `double lf_analyze(lf_entry&)': tr-stat.cc:134: warning: cast to pointer from integer of different size tr-stat.cc:136: warning: cast to pointer from integer of different size tr-stat.cc:137: warning: cast to pointer from integer of different size tr-stat.cc:141: warning: cast from pointer to integer of different size tr-stat.cc:148: warning: cast to pointer from integer of different size tr-stat.cc:152: warning: cast from pointer to integer of different size make[1]: *** [tr-stat.o] Error 1 make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr' make[1]: Entering directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/cielo/ns2/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb' I will proceed with the installation of MIT LEACH and see how it goes and update you. I only reply so soon because I noticed the number of views of this thread got so high in just three hours, so I'm guessing there are quite a few ppl out there in my situation. |
CC = @CXX@ , i.e. CXX means c++.
indep-utils/webtrace-conv/ucb/ : CXX = g++-3.3 The others are less important, will usually compile with the default gcc, g++. indep-utils/webtrace-conv/dosdbell/ : CC = gcc-3.3 indep-utils/webtrace-conv/dec/ : CC = g++-3.3 indep-utils/webtrace-conv/epa/ : CC = g++-3.3 indep-utils/webtrace-conv/nlanr/ : CC = g++-3.3 indep-utils/cmu-scen-gen/setdest/ : CC = gcc-3.3 , CCX = g++ When you have file.c : gcc. When it's files.cc : g++ for c++ files. ( *.c is c code. *.cc (or *.cpp) is c++ code.) I actually compiled a clean old ns-allinone-2.27 on Fedora 14 - 32, while I wrote post # 4. No files from ns-allinone-2.34 was used. The patch ns-2.27-gcc410.patch was included : (Works for gcc-3.4.6...gcc-4.1.0). http://cfs3.tistory.com/upload_contr...7-gcc410.patch And no editing of any Makefile.in, just : export CC=g++34 CXX=g++34 && ./install And, validate : "validate overall report: all tests passed" ( But this simple method will usually not work on Ubuntu.) .. |
to eliminate the error of
./../../autoconf.h:85: error: namespace `CPP_NAMESPACE' undeclared make[1]: *** [proxytrace.o] Error 1. In autoconfig.h.in replace line #84 "using namespace CPP_NAMESPACE"; to "using namespace std" and ns2 will compile with no errors at all. I will address leach installation in my next post because now I'm having some minor errors |
This post is for anyone trying to install leach. The process is just the usual one. I hope this helps somehow.
For the installation of leach obtain the mit.tar.gz package at http://www.internetworkflow.com/down...ach/mit.tar.gz Step 1: Place the mit.tar.gz package into the ns-allione-2.27/ns-2.27 directory and type the following commands in the terminal cd ns-allione-2.27/ns-2.27 gunzip mit.tar.gz tar -xvf mit.tar Step 2: Edit the file in ns-allione2.27/ns-2.27/Makefile.in Add –DMIT_uAMPS to the DEFINE list Add -I./mit/rca –I./mit/uAMPS to the INCLUDE list Add the following just prior to the line that says gaf/gaf.o \ mit/rca/energy.o mit/rca/rcagent.o \ mit/rca/rca-ll.o mit/rca/resource.o \ mac/mac-sensor-timers.o mac/mac-sensor.o mit/uAMPS/bsagent.o \ Edi the file in ns-allione-2.27/ns-2.27/mit/uAMPS/sims/uamps.tcl Replace lines #12 to 15 with these lines: source mit/rca/ns-ranode.tcl source mit/uAMPS/ns-bsapp.tcl source mit/uAMPS/extras.tcl source mit/uAMPS/stats.tcl Replace lines #20 to 22 with these lines: source mit/rca/resources/ns-resource-manager.tcl source mit/rca/resources/ns-energy-resource.tcl source mit/rca/resources/ns-neighbor-resource.tcl Follow the same logic of replacing $env(RCA_LIBRARY) and $env(uAMPS_LIBRARY) with mit/rca and mit/uAMPS correspondingly in the following files: ns-allione-2.27/ns-2.27/mit/uAMPS/sims/leach.tcl ns-allione-2.27/ns-2.27/mit/uAMPS/sims/leach-c.tcl Step 3: cd ns-allione-2.27/ns-2.27/ ./configure make clean make ./validate ./leach-test Check in ns-allione-2.27/ns-2.27/mit/leach_sims/leach.err if the file reports any errors Check the simulation outputs in ns-allione-2.27/ns-2.27/mit/leach_sims/leach.out GOOD LUCK! D.BONEKE |
try this http://nsnam.isi.edu/nsnam/index.php..._on_Ubuntu7.04 or this http://www.techquark.com/2009/09/ins...buntu-904.html equally applicable till 10.04 but not for 10.10 , else visit www.wirelesscafe.wordpress.com
|
Hi everyone...
I[m following the bnkdul tutorial to install leach and ns-2.27 but I got an error. I[m using gcc and g++ version 3.3.6, when I run the make command, i[m getting: Code:
g++-3.3.6: cannot specify -o with -c or -S and multiple compilations |
# 10 , @ jimctu :
I don't think the edits in post #8 are meant as "complete install instructions". Quote, post #8 : ""The process is just the usual one."" The proof method for 'ns-allinone-2.27' is here, post #3 : http://www.linuxquestions.org/questi...10-a-782356/#3 Suggest : Read all LEACH threads : LQ Search , Tag = leach .. |
Quote:
I'm trying to install leach in NS2.27 (os:ubuntu 10.04) and I followed which is mentioned in thread #8 about installing leach.But when I run the ./test_leach I have the following error in the leach.err file Code:
couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory Code:
At 584.50000000006435: Code:
At 331.6000000000069: I need your help and I will be Grateful if someone can replay me as soon as possible because it urgent work for me . Thanks. |
# 19 .
LEACH Ubuntu 10.04, posts #5 and #6 here .. http://www.linuxquestions.org/questi...-4175453312/#5 cd ns-allinone-2.27/ns-2.27/ .. Please start with 'test' , which will run 'leach_test' : export RCA_LIBRARY=$NS/mit/rca && export uAMPS_LIBRARY=$NS/mit/uAMPS && ./test Replace $NS with the full path, like .. export RCA_LIBRARY=/home/doussa/ns-allinone-2.27/ns-2.27/mit/rca && export uAMPS_LIBRARY=/home/doussa/ns-allinone-2.27/ns-2.27/mit/uAMPS && ./test ./leach_test can be run alone, in the same way : 1) export RCA_LIBRARY=/home/doussa/ns-allinone-2.27/ns-2.27/mit/rca 2) export uAMPS_LIBRARY=/home/doussa/ns-allinone-2.27/ns-2.27/mit/uAMPS 3) ./leach_test Note : There is no file by name "test_leach". More about running leach_test alone : In one of these threads : http://www.linuxquestions.org/questi...2-34-a-870368/ http://www.linuxquestions.org/questi...2-27-a-785379/ .. Please look for posts by @deepa_2111 . All LQ LEACH : LQ Search → Tag = leach - |
Quote:
I make all the changes as you said and I run ./test (after modify file test:with moving line:cd ../../ above line:./leach_test ) but I have this message couldn't read file "wireless-demo-csci694.tcl": no such file or directory NOTE:the path of test file is ns-allinone-2.27/ns-2.27/mit thank you for replying |
# 14 .
Quote:
The tests, './test' and './leach_test' must be run from ns-allinone-2.27/ns-2.27/. That's the required location. Else the dependencies like wireless-demo-csci694.tcl etc. will not be found. Code:
cd ns-allinone-2.27/ns-2.27/ && export RCA_LIBRARY=/home/doussa/ns-allinone-2.27/ns-2.27/mit/rca && export uAMPS_LIBRARY=/home/doussa/ns-allinone-2.27/ns-2.27/mit/uAMPS && ./test |
Quote:
when I extracted the mit.tar.gz under NS2.27 I have a folder nammed mit inwhich I have test file leach_test file tcl common apps ...and a mit(inwhich leach_sims,rca,uAMPS). |
Quote:
Code:
num_nodes is set 3 I'm witing for your help |
# 16 .
Quote:
( only the command line can be used ) and you will get : apps/ common/ mac/ mit/ tcl/ trace/ leach_test* test* package_up* ... I.e. if you are using a GUI archive tool for the unpack, an extra folder mit/ is created : mit/mit/ is absolutely wrong. - |
Quote:
ok I will try that. sorry but I have another question if you can help me:I installed leach in NS2.34 at the same time and I have no problem with the installation of ns2.34 but when I run the "make"(installing leach) I got Code:
for i in indep-utils/cmu-scen-gen/setdest indep-utils/webtrace-conv/dec indep-utils/webtrace-conv/epa indep-utils/webtrace-conv/nlanr indep-utils/webtrace-conv/ucb; do ( cd $i; make all; ) done and when I run "bash ./test",I got no errors in leach.err but the total energy=319 which is ellogical result. thx knudfl for your efforts. |
# 19 .
Quote:
Quote:
Quote:
→ I.e. in the two long leach threads. - |
Quote:
|
All times are GMT -5. The time now is 09:51 PM. |