recompiling .h and .cc files in ns2 does not shows changes made to them
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.
recompiling .h and .cc files in ns2 does not shows changes made to them
Hi. I'm working in ns-2.29 on fedora 15.
I've made some changes inside already existing header and c++ files in wimax directory in ns2.
I saved the changes, then under /ns-2.29 I applied following:
make clean
make depend
make
to recompile ns2 and I got no errors, I got:
make[1]: Entering directory `/home/N/ns2/ns-allinone-2.29/ns-2.29/indep-utils/cmu-scen-gen/setdest'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/N/ns2/ns-allinone-2.29/ns-2.29/indep-utils/cmu-scen-gen/setdest'
...
which I know its not an error.
but even after recompiling the files,the changed I made are not applied.
when I run my tcl file I get an error.
what should I do to properly compile the codes so it reflects my modifications?
Thanks in advance.
will install to the $PREFIX directory ( if used in the makefile)
most programs install to /usr or /usr/local by default
Now some require that YOU manually move the program out of the build folder
or
run in the build folder ( not a good idea )
also
did you restart the very OLD ns 2.29 ( .34 is the current OLD 2 version i think. )
also be advised that fedora 15 is UNSUPPORTED
currently ONLY fedora 16 and 17 are supported and VERY SOON fedora 16 will go END OF LIFE after fedora 18 comes out
DOSE the "makefile" actually have a "clean" section DEFINED ????
not all do ?
if not YOU will have to manually delete the old files YOU defined in the BUILD folder and rebuild
( it is EVER NEVER NEVER YES NEVER a good idea to build software IN your source folder/ working folder )
also "make clean" will NOT remove any prerequisites that needed building
" distclean" will do that IF defined in the makefile
And please tell which files it's about, + specify the edited line numbers.
I'm working in Wimax QoS module I downloaded from this Site : http://perso.telecom-bretagne.eu/aymenbelghith/tools/
I added new algorithm inside /wimax/scheduling/bsscheduler.h and .cc files. There are some algorithms alreay defined there.
in bsscheduler.h,I decleared my algorithm and in bsscheduler.cc I defined its body, also in command() function I added the algorithm name like other algorithms so when user runs the tcl file and enteres the algorithm name ns runs the algorithm code.
SO,
when I compile using: make clean , make depend , make , I get no errors.
When I run the tcl and choose "M" as algorithm,I get following:
Error! Unknown rtPS scheduling algorithm
This line is written inside commande() function in bsscheduler.cc
I've added my algorithm name inside command() but I dont know why it doesnt recognise it.
Hi. I'm working in ns-2.29 on fedora 15.
I've made some changes inside already existing header and c++ files in wimax directory in ns2.
I saved the changes, then under /ns-2.29 I applied following:
make clean
make depend
make
to recompile ns2 and I got no errors, I got:
make[1]: Entering directory `/home/N/ns2/ns-allinone-2.29/ns-2.29/indep-utils/cmu-scen-gen/setdest'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/N/ns2/ns-allinone-2.29/ns-2.29/indep-utils/cmu-scen-gen/setdest'
...
which I know its not an error.
but even after recompiling the files,the changed I made are not applied.
when I run my tcl file I get an error.
what should I do to properly compile the codes so it reflects my modifications?
Thanks in advance.
After running "make", the re-compilation is done but to apply the changes one need to install it again. You may be currently in ns-2.35 directory when running the make.
Now run "sudo make install".
Quote:
sumanth@sumanth-HP-Notebook:~/Documents/ns-allinone-2.35/ns-2.35$ sudo make install
if you just run "make install", it may give an error like this
Quote:
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install: cannot create regular file '/usr/local/bin/ns': Permission denied
Makefile:557: recipe for target 'install-ns' failed
make: *** [install-ns] Error 1
Then run tcl scripts to see the desired output and applied changes.
Last edited by VankaSaiSumanth; 02-28-2019 at 10:47 AM.
I got an error when I tried to execute the "sudo make install" command after making changes in the .cc file. Can I get some help to resolve
Now run "sudo make install".
if you just run "make install", it may give an error like this
I have run the "sudo make install" command and I got an error similar to what you've said.
It's like this:
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install -c -m 644 ns.1 usr/local/man/man1
How to resolve this error? Could someone help me with this?
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #9
Quote:
changes I've made aren't being reflected when I run the TCL file
Generally about changes in C++ code ......
1) Sometimes the right "Tcl hook" must be included in the C++ code.
2) And changes may have to include some lines in tcl/lib/[ns-files.tcl]
... e.g. ns-agent.tcl, ns-default.tcl?, ns-lib.tcl, ns-mobilenode.tcl, ns-packet.tcl
3) A certain text may be required in the simulation.tcl to achieve a visible result in the terminal output / in some extra output file(s).
Generally about changes in C++ code ......
1) Sometimes the right "Tcl hook" must be included in the C++ code.
2) And changes may have to include some lines in tcl/lib/[ns-files.tcl]
... e.g. ns-agent.tcl, ns-default.tcl?, ns-lib.tcl, ns-mobilenode.tcl, ns-packet.tcl
3) A certain text may be required in the simulation.tcl to achieve a visible result in the terminal output / in some extra output file(s).
-
Thank you! I am able to make changes and the changes are being reflected when I run the tcl script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.