can't find file to patch at input line n problem, Installing WiMax module on ns2-29
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
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.
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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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
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:
It's an error in the patch. The patching will delete ns-autoconf.tcl.in,
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 ?
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:
By the way : Did you remember to make a backup of the original ns ?
yes, I did: cd ns-allinone-2.29/ns-2.29/ && cp ns ns229-backup as you mentioned earlier.
I really appreciate the time you spend to help me.
Could the problem be related to Makefile file in ns-2.29?
Quote:
&& mv Makefile Makefile-orig && cd ../
Should I have renamed that Makefile-orig back to Makefile again? I followd exactly what you wrote.
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.
Which means a command like :
./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
sink node created
INITIALIZE THE LIST xListHead
(_o54 cmd line 1)
invoked from within
"_o54 cmd set-default-modulation QoS_example1.tcl"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o54" line 2)
(SplitObject unknown line 2)
invoked from within
"$bs_sched set-default-modulation [lindex $argv 0] "
(file "8MN_datarate.tcl" line 144)
Hi again.
I installed ns2 and wimax patch successfully following your advice.
but I have 2 questions here.
you said earlier that :
Quote:
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' ).
But I have only one "ns" in /ns-2.29 directory. why? why do you have two ns binaries and I have only one? i did exactly as you said for patch:
Quote:
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
If I want to run the tcl examples in /tcl/wimax directory, I just type "ns" not ns-wiamx or anything else and I'm able to run the tcl files.
see example here:
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:
cp ns /usr/local/bin/.
. and now the changes I made in the files are working.
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?
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 13
Quote:
I dont want to repeat it every single time I change sth inside files.
When you are patching / making changes in say five different ways,
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.)
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 ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.