LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-04-2012, 12:23 PM   #1
Narges
Member
 
Registered: Oct 2011
Posts: 32

Rep: Reputation: Disabled
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.
 
Old 12-04-2012, 01:44 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
make DOSE NOT install anything

Code:
su 
make install
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
 
Old 12-04-2012, 02:10 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Yes, everything looks OK.

Quote:
I've made some changes inside already existing header and c++ files in wimax
I guess you will have to show the changes. In code tags, please.
And please tell which files it's about, + specify the edited line numbers.

Also : Please attach your tcl script. As name.tcl.txt .
Attachments : The paper clip tool in the 'Advanced Editor'.


.

Last edited by knudfl; 12-04-2012 at 02:12 PM.
 
Old 12-04-2012, 11:44 PM   #4
Narges
Member
 
Registered: Oct 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
Thank you for the reply.

Quote:
make DOSE NOT install anything
Code:
su
make install
But I didnt want to install anything, I just want to recompile the code.

Quote:
did you restart the very OLD ns 2.29 ( .34 is the current OLD 2 version i think. )
Yes I did restart.

Quote:
DOSE the "makefile" actually have a "clean" section DEFINED ????
I dont understand what "clean" section deos, but inside my Makefile.in I can see:

CLEANFILES = ns nse nsx ns.dyn $(OBJ) $(OBJ_EMULATE_CC) \
$(OBJ_EMULATE_C) common/tclAppInit.o \
$(GEN_DIR)* $(NS).core core core.$(NS) core.$(NSX) core.$(NSE) \
common/ptypes2tcl common/ptypes2tcl.o
and
clean:
$(RM) $(CLEANFILES)
and
distclean: distclean-recursive
$(RM) $(CLEANFILES) Makefile config.cache config.log config.status \
autoconf.h gnuc.h os-proto.h $(AUTOCONF_GEN); \
$(MV) .configure .configure- ;\
echo "Moved .configure to .configure-"

distclean-recursive:
for i in $(SUBDIRS); do ( cd $$i; $(MAKE) clean; $(RM) Makefile; ) done
 
Old 12-04-2012, 11:46 PM   #5
Narges
Member
 
Registered: Oct 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
Thank you for the reply.
Quote:
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.
 
Old 02-28-2019, 07:10 AM   #6
VankaSaiSumanth
LQ Newbie
 
Registered: Feb 2019
Posts: 2

Rep: Reputation: Disabled
Lightbulb Error solved. Thank you for the post

Quote:
Originally Posted by Narges View Post
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.
 
Old 04-06-2023, 02:09 AM   #7
sowjanyadasari
LQ Newbie
 
Registered: Apr 2023
Posts: 3
Blog Entries: 1

Rep: Reputation: 11
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?
 
Old 04-06-2023, 02:52 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post #7, @sowjanyadasari : Welcome to LQ.

No errors are shown in the quoted text. (And no word "error").
... The text only shows what's happening !

$ man install https://linux.die.net/man/1/install

ns2 INFO https://docs.google.com/document/d/1...usp=share_link

-

Last edited by knudfl; 04-06-2023 at 02:55 AM.
 
1 members found this post helpful.
Old 04-07-2023, 01:27 PM   #9
sowjanyadasari
LQ Newbie
 
Registered: Apr 2023
Posts: 3
Blog Entries: 1

Rep: Reputation: 11
Ohh Okay! Thanks for the reply. I didn't realise it, but the changes I've made aren't being reflected when I run the TCL file. Can anyone explain why?

And if there's any tutorial/ video/ web page on how to modify protocols in ns2, sharing the link for the same would be appreciated. Thank you
 
Old 04-11-2023, 03:10 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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).

-
 
Old 04-18-2023, 03:54 AM   #11
sowjanyadasari
LQ Newbie
 
Registered: Apr 2023
Posts: 3
Blog Entries: 1

Rep: Reputation: 11
Quote:
Originally Posted by knudfl View Post
Re #9


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.
 
1 members found this post helpful.
  


Reply

Tags
ns2, recompile, wimax, wimax-qos



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] error while recompiling Ns2 makefile.in indumit18 Linux - Software 41 01-16-2024 03:05 AM
I've made changes to DSR in NS2 , but when I run the simulation nothing has changed farzane Linux - Wireless Networking 0 06-26-2012 12:50 AM
[SOLVED] error while recompiling Ns2 indumit18 Linux - Newbie 10 10-14-2011 02:08 AM
error while recompiling ns2 indumit18 Linux - Software 1 09-16-2011 08:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration