can't find file to patch at input line n problem, Installing WiMax module on ns2-29
Hi.
I want to install WiMax module on ns2-29-3 in Fedora 15. I have downloaded the patch file(patch-QoS-WiMAX-13Apr2009-v2.1) in ns-allinone-2.29 directory. when applying the patch I get the following error: [narges@localhost ns-allinone-2.29]$ patch -p0<patch-QoS-WiMAX-13Apr2009-v2.1 patching file ns-2.29-new/autoconf.h can't find file to patch at input line 100 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -Naur ns-2.29-original/common/packet.h ns-2.29-new/common/packet.h |--- ns-2.29-original/common/packet.h 2009-04-13 11:39:11.000000000 +0200 |+++ ns-2.29-new/common/packet.h 2008-04-09 13:12:04.000000000 +0200 -------------------------- File to patch: I noticed a new folder ns-2.29-new is created under ns-allinone-2.29 directory and there's autoconf.h file in there. What should I do now? please help me. Thank you. |
Very simple :
Start from scratch with a new unpacked ns-allinone-2.29.3.tar.gz Rename (ns-allinone-2.29)/ns-2.29/ to ns-2.29-new .. And when you have finished the patching, rename ns-2.29-new to ns-2.29 Then you can do : cd ns-allinone-2.29/ && export CC=gcc34 CXX=g++34 && ./install ns2 prerequisites : # yum install \ gcc-c++ compat-gcc-34-c++ automake autoconf libtool libX11-devel \ libXext-devel libXau-devel libXmu-devel xorg-x11-proto-devel . |
Dear knudfl,
Thanks for the reply. So what you are saying is that I have to install ns2 again? and apply the patch before installing it? Isn't there any way that I dont have to install a new ns2? What if I want to install another patches later? I mean we cannot install the whole ns2 again just to apply patch, am I right? Thank you. |
It is of course possible to add the patching after the first build (./install).
cd ns-allinone-2.29/ns-2.29/ && cp ns ns229-backup && make clean ( The new patched version of 'ns' may not be usable for default tcl files.) && mv Makefile Makefile-orig && cd ../ Then you can rename : mv ns-2.29/ ns-2.29-new .. And do the patching : patch -p0 < patch-QoS-WiMAX-13Apr2009-v2.1 And rename to ns-2.29 again : mv ns-2.29-new/ ns-2.29 Now you can do the new "wimax build". . |
Hi.
Thanks again for your reply. I've done what you have said. The wimax files are in corresponding folders. Then under ns-2.29 directory I did : ./configure, make clean, make. Now, when I run ./configure, after lots of checking lines, I get the following error: configure: creating ./config.status config.status: creating Makefile config.status: error: cannot find input file: tcl/lib/ns-autoconf.tcl.in what should I do now? Can I copy and paste this file from another ns-allinone file? when I run the wimax examples provided, I get: invalid command name "Mac/802_16" while executing "Mac/802_16 set debug_ 0" (file "8MN_datarate.tcl" line 45) I guess thats becoz ns doesnt recognise wimax yet, right? |
#5
Quote:
and 'configure' will still want to use it to generate an ns-autoconf.tcl That's not what we want: The patch has provided the right ns-autoconf.tcl The required workaround : 1) cd ns-allinone-2.29/ns-2.29/tcl/lib/ 2) mv ns-autoconf.tcl ns-autoconf.tcl-new 3) Copy an original ns-autoconf.tcl.in to tcl/lib/ ... from another unpacked ns-allinone-2.29.3.tar.gz 4) cd ../../ && export CC=gcc34 CXX=g++34 && ./configure 5) cd tcl/lib/ && mv ns-autoconf.tcl-new ns-autoconf.tcl 6) cd ../../ && make clean && make : A new 'ns' is created OK. The 32bits Fedora 15 was used for the above. By the way : Did you remember to make a backup of the original ns ? . |
Thank you. I did all the steps as you said.
The problem with tcl/lib/ns-autoconf.tcl.in is solved now. When configured, I get the following : configure: creating ./config.status config.status: creating Makefile config.status: creating tcl/lib/ns-autoconf.tcl config.status: creating indep-utils/webtrace-conv/ucb/Makefile config.status: creating indep-utils/webtrace-conv/dec/Makefile config.status: creating indep-utils/webtrace-conv/nlanr/Makefile config.status: creating indep-utils/webtrace-conv/epa/Makefile config.status: creating indep-utils/cmu-scen-gen/setdest/Makefile config.status: creating autoconf.h config.status: autoconf.h is unchanged and make clean and make. It seems theres no problem. But when I run the examples I get the same error I got before: invalid command name "Mac/802_16" while executing "Mac/802_16 set debug_ 0" (file "8MN_datarate.tcl" line 45) I reconfigured, make clean and make again. I cannot understand why ns2 does not recognise WiMax? I mean all the wimax files are copied in ns2. and i compiled it, several times and theres no error. so whats wrong with it? Quote:
I really appreciate the time you spend to help me. |
# 7
Quote:
|
Quote:
|
Could the problem be related to Makefile file in ns-2.29?
Quote:
I have 4 makefiles in ns-2.29 (makefile.vc, Makefile, Makefile.in and Makefile-orig) with different file sizes. I tried another wimax example, in ns-2.29/tcl/lib (ns-wimax.tcl), and I got an error saying: invalid command name "Phy/WirelessPhy/OFDM" So means although I applied the patch and there is a wimax directory in ns-2.29 and ./configured,make clean,make with no error, but the classes there are unknown to ns2. |
Don't know, what you are doing.
You should now have two different binaries "ns" : The unpatched 'ns-orig', and a new 'ns' ( I'm using the name ns-wimax-QoS for new patched 'ns' ). Copy or link "ns-wimax-QoS" to ns-2.29/tcl/wimax/ , or : cp ns /usr/local/bin/. Running the example, see QoS_example1.tcl line 6 - 11 : Code:
puts "Usage: ns datarate.tcl modulation cyclic_prefix " ./ns-wimax-QoS 8MN_datarate.tcl QoS_example1.tcl OFDM_QPSK_1_2 0.03125 Or : ./ns-wimax-QoS QoS_example1.tcl 8MN_datarate.tcl OFDM_BPSK_1_2 0.125 ... But there are a few errors in the tcl scripts, so we don't get a simulation. Code:
num_nodes is set 30 . |
post #11
Quote:
|
Hi again.
I installed ns2 and wimax patch successfully following your advice. but I have 2 questions here. you said earlier that : Quote:
Quote:
see example here: Code:
na@ubuntu:~/ns2/ns-allinone-2.29/ns-2.29/tcl/wimax$ ns QoS_example1.tcl OFDM_BPSK_1_2 0.25 mmSIR However, when I change inside files in /ns-2.29/wimax, for example, I add or remove a method inside a header or cpp file , and I save changes and I do make clean, make depend,make, I get no errors,but running the wimax tcl example I see the changes are not affected (for instance I'm still able to use the method I removed from the files). I tried this command after make, Quote:
But everytime I change inside .h and .cc files, after using make,I have to use the command above, for changes to take effect. I dont want to repeat it every single time I change sth inside files. What should I do for that? Thank you in advance. |
# 13
Quote:
the suggestion is to rename any new "ns" to a recognizable name. And use as e.g. : 1) $ ns229 ( Or $ 'ns-orig' for an unpatched.) 2) $ ns-wimax 3) $ ns-wimax-abc 4) ns-wimax-yyz 5) $ ns-<???> How else will you keep track of many different functions ? And : It's the only way to save "ns" : ns gets deleted, when you 'make clean'. That's the reason for $ 'cp ns ns-new-name' before every 'make clean'. About 'make install' : Copies ns to /usr/local/bin/. You can as well copy all different ns-? to /usr/local/bin/. ( I'd usually have 20 different 'ns-<>' : No problems using all.) . |
Thank you so much for the explanation.
So the first time I install ns-allinone, after make,"ns" created and I change it "cp ns ns-unpatched" and "su cp ns-unpatched /usr/local/bin" then after installing wimax patch,after make,"ns" created and I change it to "cp ns ns-wimax" and "su cp ns-wimax /usr/local/bin" and If I modify sth and make,again "cp ns ns-wimax-1" and "su cp ns-wimax-1 /usr/local/bin" and goes on. did I get it correctly? So everytime I change I have to do "cp ns-name /usr/local/bin" and overwrite ns-name because without it the lates changes are not applied. (I checked after "make" and no changes afftected. I overwirte ns-name in /usr/local/bin and run the tcl and then it is applied.) and what if you remove one of your "ns-name" from your /ns-2.29 directory. what is the command to remove it from /usr/local/bin ? |
All times are GMT -5. The time now is 09:37 AM. |