Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Suppose if I followed the steps in #3, my old folders will be rename to back-<name> as well right? But then why my old folder's name still exist?
and when I delete the old folders from ns-allinone-2.27, it cannot continue install by prompting me this error:
Code:
============================================================
* Build tcl8.4.5
============================================================
cd: 358: can't cd to ./tcl8.4.5/unix
./install: 365: ./configure: not found
tcl8.3.2 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.
So is it proved that I not yet move/replace everything from old folders?
Click here to see the post LQ members have rated as the most helpful post in this thread.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
#166, Hi lilicharmaine.
The text
============================================================
* Build tcl8.4.5
============================================================ , etc. etc.
... is from the file 'install', which handles tcl tk otcl tclcl
with the original ( old ) names. That's why e.g. tcl8.4.18 must have a link
by name 'tcl8.4.5', to make it possible for the 'install' script to work.
My ns-allinone-2.27/ looks like this ( 'ls ns-allinone-2.27/' )
May be you should omit the 'otcl-113 patch'.
Actually "CC = gcc-4.3" is the proof method. No guaranty that the patch will work.
On one Ubuntu version ( 9.10 ? ) we have seen errors / no errors,
both with and without the patch !
I had found the solution that you gave in some other thread (ns installation wont let me do it in ubuntu 9.10, post #4).
The following errors :
Code:
otcl.o: In function `OTclDispatch':
/home/lilicharmaine/ns/ns-allinone-2.27/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/lilicharmaine/ns/ns-allinone-2.27/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: Nonrepresentable section on output
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
The solution: is by editing
Code:
ns-allinone-2.27/otcl-1.13/Makefile.in
CC gcc-3.3 (line 7)
Thanks a lot, you really help me solved my problems, thanks again
invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/home/shiayok/ns-allinone-2.27/ns-2.27/mit/rca//resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /home/shiayok/ns-allinone-2.27/ns-2.27/mit/rca//resources/ns-energy-resource.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source $env(RCA_LIBRARY)/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 18)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
May I know how can I solve this problem? thanks
-- and my leach.out is empty because of the above error, i need to solve it in order to get answer, thanks
By getting the help from all of you (especially knudfl), I have complete LEACH protocol installation in ns-allinone-2.27 (ubuntu10.10), and I compiled the complete instructions as following, hope it can help you, Good luck !!
Code:
Installing ns2.27 in UBUNTU 10.10
After finished installed the UBUNTU 10.10
Installation for ns-allinone-2.27 in ubuntu10.10Step 1: download ns-allinone-2.27.tar.gz and ns-allinone-2.34.tar.gz
cd /home/<path>
wget http://www.isi.edu/nsnam/dist/ns-allinone-2.27.tar.gz
gunzip ns-allinone-2.27.tar.gz
tar –xvf ns-allinone-2.27.tar
wget http://cdnetworks-kr-2.dl.sourceforge.net/project/nsnam/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz
gunzip ns-allinone-2.34.tar.gz
tar –xvf ns-allinone-2.34.tar
Step 2:
Edit ns-allinone-2.27/ns-2.27/Makefile.in, line 36-37 to:
CC = gcc-3.3
CPP = g++-3.3
and ns-allinone-2.27/nam-1.10/Makefile.in, line44-45 to:
CC = gcc-3.3
CPP = g++-3.3
Step 3: The g++-3.3 packages required, so download the following compiler version
wget http://cvsup9.tw.freebsd.org/pub/Linux/Ubuntu/pool/universe/g/gcc-3.3/cpp-3.3_3.3.6-15ubuntu4_i386.deb
wget http://ftp.jaist.ac.jp/pub/Linux/ubuntu//pool/universe/g/gcc-3.3/g++-3.3_3.3.6-15ubuntu4_i386.deb
wget http://mirror.netcologne.de/ubuntu//pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu4_i386.deb
wget http://free.nchc.org.tw/ubuntu//pool/universe/g/gcc-3.3/gcc-3.3-base_3.3.6-15ubuntu4_i386.deb
wget http://mirror.pnl.gov/ubuntu//pool/universe/g/gcc-3.3/libstdc++5-3.3-dev_3.3.6-15ubuntu4_i386.deb
Step 4: install the g++-3.3 packages
sudo dpkg -i cpp-3.3_3.3.6-15ubuntu4_i386.deb g++-3.3_3.3.6-15ubuntu4_i386.deb \
gcc-3.3_3.3.6-15ubuntu4_i386.deb gcc-3.3-base_3.3.6-15ubuntu4_i386.deb \
libstdc++5-3.3-dev_3.3.6-15ubuntu4_i386.deb
Step 5:
Having ns-allinone-2.27/ and ns-allinone-2.34/ in the same directory,
e.g: /home/<path>/ns2:
cd ns-allinone-2.27/
mv otcl-1.8/ back-otcl-1.8
mv tcl8.4.5/ back-tcl8.4.5
mv tclcl-1.15/ back-tclcl-1.15
mv tk8.4.5/ back-tk8.4.5
ln -s ../ns-allinone-2.34/tcl8.4.18/
ln -s ../ns-allinone-2.34/tcl8.4.18/ tcl8.4.5
ln -s ../ns-allinone-2.34/tk8.4.18/
ln -s ../ns-allinone-2.34/tk8.4.18/ tk8.4.5
ln -s ../ns-allinone-2.34/otcl-1.13/
ln -s ../ns-allinone-2.34/otcl-1.13/ otcl-1.8
ln -s ../ns-allinone-2.34/tclcl-1.19/
ln -s ../ns-allinone-2.34/tclcl-1.19/ tclcl-1.15
mkdir -p include
cd include/
ln -s ../tcl8.4.18/generic/tclInt.h
ln -s ../tcl8.4.18/generic/tclIntDecls.h
( These two links may already be present.)
Step 6: Apply tk-8.4-lastevent.patch in ns-allinone-2.27/tk8.4.18
wget ftp://ftp.uni-kl.de/pub/linux/gentoo-portage/dev-lang/tk/files/tk-8.4-lastevent.patch
patch –p0 < tk-8.4-lastevent.patch
NOTE: ignore the error as following:
Hunk #1 FAILED at 635
1 out of 1 hunk FAILED -- saving rejects to file generic/tk.h.rej
Step 7:
Edit ns-allinone-2.27/otcl-1.13/Makefile.in, line7 to:
CC gcc-3.3
Step 8:
cd ns-allinone-2.27
./install
Step 9: type the following messages in the same directory (/ns-allinone-2.27/)
PATH=$PATH:$HOME/bin:/home/<path>/ns-allinone-2.27/bin:/home/<path>/ns-allinone-2.27/tcl8.4.18/unix:/home/<path>/ns-allinone-2.27/tk8.4.18/unix
export LD_LIBRARY_PATH=/home/<path>/ns-allinone-2.27/otcl-1.13:/home/<path>/ns-allinone-2.27/lib
export TCL_LIBRARY=/home/<path>/ns-allinone-2.27/tcl8.4.18/library
./validate
COMPLETE !!!
Install LEACH protocol in ns2.27Step 1: download mit.tar.gz (mit.tar.gz can be download at same thread, post #155)
cd ns-allinone-2.27/ns-2.27
Step 2: allocate mit.tar.gz into this directory
gunzip mit.tar.gz
tar –xvf mit.tar
gedit ~/ns-allinone-2.27/ns-2.27/mac/wireless-phy.cc
goto line 59, that is after line 58
#define max(a,b) (((a)<(b))?(b):(a))
insert:
#define min(a,b) (((a)>(b))?(b):(a))
Step 3:
cd ns-allinone-2.27/ns-2.27/
gedit Makefile
Do the following in Makefile:
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 (before) line 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 \
save the Makefile
Step 4:
At the same directory, do:
make clean
make
Then, type
./test
You will get an error called
./test: line 5: ./leach_test: No such file or directly
So we correct it by:
cd ns-allinone-2.27/ns-2.27
gedit test
change the following codes:
#!/bin/bash
cd tcl/ex
ns wireless-demo-csci694.tcl
sleep 2
./leach_test
cd ../../
to this :
#!/bin/bash
cd tcl/ex
ns wireless-demo-csci694.tcl
sleep 2
cd ../../
./leach_test
Step 5:
gedit ~/.bashrc
at last line, insert:
export RCA_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/rca
export uAMPS_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/uAMPS
NOTE: Must using “~” although your directory is not in “~” root
cd ns-allinone-2.27/ns-2.27,
type the following again:
export RCA_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/rca
export uAMPS_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/uAMPS
NOTE: Must using “~” although your directory is not in “~” root
Step 6 (directory: ns-allinone-2.27/ns-2.27):
./test
Check :
ns-allinone-2.27/ns-2.27/mit/rca/leach.err,
if having the following error:
invalid command name “Resource/Energy”
while executing
“Resource/Energy” instproc set param
….
then re-install ns-2.27 by:
cd ns-allinone-2.27/
./install
Then repeat the following steps again:
cd ns-allinone-2.27/ns-2.27/
gedit Makefile
Do the following in Makefile :
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 (before) line 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 \
save the Makefile
make clean
make
If now you have CPP_NAMESPACE error, then go to three of the directory to insert:
Append this:
-DCPP_NAMESPACE=std
into 3 of the directory and appended as shown respectively:
ns-2.27/indep-utils/cmu-scen-gen/setdest/Makefile (append in DEFINE)
ns-2.27indep-utils/webtrace-conv/dec/Makefile (append in CFLAGS)
ns-2.27/indep-utils/webtrace-conv/ulanr/Makefile (append in CFLAGS)
Repeat:
cd ns-allinone-2.27/ns-2.27
make clean
make
sudo make install
type the following again:
export RCA_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/rca
export uAMPS_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/uAMPS
NOTE: Must using “~” although your directory is not in “~” root
./test
cd ns-allinone-2.27/ns-2.27/mit/leach-sims/leach.err
You should now see (leach.err):
INITIALIZE THE LIST xListHead
Channel.cc:sendUp – Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 222.8
SORTING LISTS …DONE!
And
cd ns-allinone-2.27/ns-2.27/mit/leach-sims/leach.out
will be the result (due to permission, the result must be see by using other method)
Only then it shows your LEACH installation is successful. GOOD LUCK !!
COMPLETE!!!
By getting the help from all of you (especially knudfl), I have complete LEACH protocol installation in ns-allinone-2.27 (ubuntu10.10), and I compiled the complete instructions as following, hope it can help you, Good luck !!
Code:
Installing ns2.27 in UBUNTU 10.10
After finished installed the UBUNTU 10.10
Installation for ns-allinone-2.27 in ubuntu10.10Step 1: download ns-allinone-2.27.tar.gz and ns-allinone-2.34.tar.gz
cd /home/<path>
wget http://www.isi.edu/nsnam/dist/ns-allinone-2.27.tar.gz
gunzip ns-allinone-2.27.tar.gz
tar –xvf ns-allinone-2.27.tar
wget http://cdnetworks-kr-2.dl.sourceforge.net/project/nsnam/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz
gunzip ns-allinone-2.34.tar.gz
tar –xvf ns-allinone-2.34.tar
Step 2:
Edit ns-allinone-2.27/ns-2.27/Makefile.in, line 36-37 to:
CC = gcc-3.3
CPP = g++-3.3
and ns-allinone-2.27/nam-1.10/Makefile.in, line44-45 to:
CC = gcc-3.3
CPP = g++-3.3
Step 3: The g++-3.3 packages required, so download the following compiler version
wget http://cvsup9.tw.freebsd.org/pub/Linux/Ubuntu/pool/universe/g/gcc-3.3/cpp-3.3_3.3.6-15ubuntu4_i386.deb
wget http://ftp.jaist.ac.jp/pub/Linux/ubuntu//pool/universe/g/gcc-3.3/g++-3.3_3.3.6-15ubuntu4_i386.deb
wget http://mirror.netcologne.de/ubuntu//pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu4_i386.deb
wget http://free.nchc.org.tw/ubuntu//pool/universe/g/gcc-3.3/gcc-3.3-base_3.3.6-15ubuntu4_i386.deb
wget http://mirror.pnl.gov/ubuntu//pool/universe/g/gcc-3.3/libstdc++5-3.3-dev_3.3.6-15ubuntu4_i386.deb
Step 4: install the g++-3.3 packages
sudo dpkg -i cpp-3.3_3.3.6-15ubuntu4_i386.deb g++-3.3_3.3.6-15ubuntu4_i386.deb \
gcc-3.3_3.3.6-15ubuntu4_i386.deb gcc-3.3-base_3.3.6-15ubuntu4_i386.deb \
libstdc++5-3.3-dev_3.3.6-15ubuntu4_i386.deb
Step 5:
Having ns-allinone-2.27/ and ns-allinone-2.34/ in the same directory,
e.g: /home/<path>/ns2:
cd ns-allinone-2.27/
mv otcl-1.8/ back-otcl-1.8
mv tcl8.4.5/ back-tcl8.4.5
mv tclcl-1.15/ back-tclcl-1.15
mv tk8.4.5/ back-tk8.4.5
ln -s ../ns-allinone-2.34/tcl8.4.18/
ln -s ../ns-allinone-2.34/tcl8.4.18/ tcl8.4.5
ln -s ../ns-allinone-2.34/tk8.4.18/
ln -s ../ns-allinone-2.34/tk8.4.18/ tk8.4.5
ln -s ../ns-allinone-2.34/otcl-1.13/
ln -s ../ns-allinone-2.34/otcl-1.13/ otcl-1.8
ln -s ../ns-allinone-2.34/tclcl-1.19/
ln -s ../ns-allinone-2.34/tclcl-1.19/ tclcl-1.15
mkdir -p include
cd include/
ln -s ../tcl8.4.18/generic/tclInt.h
ln -s ../tcl8.4.18/generic/tclIntDecls.h
( These two links may already be present.)
Step 6: Apply tk-8.4-lastevent.patch in ns-allinone-2.27/tk8.4.18
wget ftp://ftp.uni-kl.de/pub/linux/gentoo-portage/dev-lang/tk/files/tk-8.4-lastevent.patch
patch –p0 < tk-8.4-lastevent.patch
NOTE: ignore the error as following:
Hunk #1 FAILED at 635
1 out of 1 hunk FAILED -- saving rejects to file generic/tk.h.rej
Step 7:
Edit ns-allinone-2.27/otcl-1.13/Makefile.in, line7 to:
CC gcc-3.3
Step 8:
cd ns-allinone-2.27
./install
Step 9: type the following messages in the same directory (/ns-allinone-2.27/)
PATH=$PATH:$HOME/bin:/home/<path>/ns-allinone-2.27/bin:/home/<path>/ns-allinone-2.27/tcl8.4.18/unix:/home/<path>/ns-allinone-2.27/tk8.4.18/unix
export LD_LIBRARY_PATH=/home/<path>/ns-allinone-2.27/otcl-1.13:/home/<path>/ns-allinone-2.27/lib
export TCL_LIBRARY=/home/<path>/ns-allinone-2.27/tcl8.4.18/library
./validate
COMPLETE !!!
Install LEACH protocol in ns2.27Step 1: download mit.tar.gz (mit.tar.gz can be download at same thread, post #155)
cd ns-allinone-2.27/ns-2.27
Step 2: allocate mit.tar.gz into this directory
gunzip mit.tar.gz
tar –xvf mit.tar
gedit ~/ns-allinone-2.27/ns-2.27/mac/wireless-phy.cc
goto line 59, that is after line 58
#define max(a,b) (((a)<(b))?(b):(a))
insert:
#define min(a,b) (((a)>(b))?(b):(a))
Step 3:
cd ns-allinone-2.27/ns-2.27/
gedit Makefile
Do the following in Makefile:
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 (before) line 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 \
save the Makefile
Step 4:
At the same directory, do:
make clean
make
Then, type
./test
You will get an error called
./test: line 5: ./leach_test: No such file or directly
So we correct it by:
cd ns-allinone-2.27/ns-2.27
gedit test
change the following codes:
#!/bin/bash
cd tcl/ex
ns wireless-demo-csci694.tcl
sleep 2
./leach_test
cd ../../
to this :
#!/bin/bash
cd tcl/ex
ns wireless-demo-csci694.tcl
sleep 2
cd ../../
./leach_test
Step 5:
gedit ~/.bashrc
at last line, insert:
export RCA_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/rca
export uAMPS_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/uAMPS
NOTE: Must using “~” although your directory is not in “~” root
cd ns-allinone-2.27/ns-2.27,
type the following again:
export RCA_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/rca
export uAMPS_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/uAMPS
NOTE: Must using “~” although your directory is not in “~” root
Step 6 (directory: ns-allinone-2.27/ns-2.27):
./test
Check :
ns-allinone-2.27/ns-2.27/mit/rca/leach.err,
if having the following error:
invalid command name “Resource/Energy”
while executing
“Resource/Energy” instproc set param
….
then re-install ns-2.27 by:
cd ns-allinone-2.27/
./install
Then repeat the following steps again:
cd ns-allinone-2.27/ns-2.27/
gedit Makefile
Do the following in Makefile :
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 (before) line 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 \
save the Makefile
make clean
make
If now you have CPP_NAMESPACE error, then go to three of the directory to insert:
Append this:
-DCPP_NAMESPACE=std
into 3 of the directory and appended as shown respectively:
ns-2.27/indep-utils/cmu-scen-gen/setdest/Makefile (append in DEFINE)
ns-2.27indep-utils/webtrace-conv/dec/Makefile (append in CFLAGS)
ns-2.27/indep-utils/webtrace-conv/ulanr/Makefile (append in CFLAGS)
Repeat:
cd ns-allinone-2.27/ns-2.27
make clean
make
sudo make install
type the following again:
export RCA_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/rca
export uAMPS_LIBRARY=~/ns-allinone-2.27/ns-2.27/mit/uAMPS
NOTE: Must using “~” although your directory is not in “~” root
./test
cd ns-allinone-2.27/ns-2.27/mit/leach-sims/leach.err
You should now see (leach.err):
INITIALIZE THE LIST xListHead
Channel.cc:sendUp – Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 222.8
SORTING LISTS …DONE!
And
cd ns-allinone-2.27/ns-2.27/mit/leach-sims/leach.out
will be the result (due to permission, the result must be see by using other method)
Only then it shows your LEACH installation is successful. GOOD LUCK !!
COMPLETE!!!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.