'Smart?' compiler? Why recompile a file that hasn't changed?

Post your requests and ideas on the future development of mikroC PRO for AVR.
Post Reply
Author
Message
sadavis80
Posts: 114
Joined: 15 Nov 2008 19:27

'Smart?' compiler? Why recompile a file that hasn't changed?

#1 Post by sadavis80 » 07 Dec 2008 23:40

As far as I can tell, the compiler recompiles EVERY file in the project EVERY time I hit Ctrl-F9. Why? I have worked with numerous compilers in the past that only recompiled files that had changed.

An 'improvement' possibly? Or is it actually in place now - but it just LOOKS like it's not (watching the message window ... *TIME* spent waiting on the results of compiles for files that have not changed) ??

Steve

User avatar
rajkovic
mikroElektronika team
Posts: 694
Joined: 16 Aug 2004 12:40

Re: 'Smart?' compiler? Why recompile a file that hasn't chan

#2 Post by rajkovic » 10 Dec 2008 08:30

sadavis80 wrote:As far as I can tell, the compiler recompiles EVERY file in the project EVERY time I hit Ctrl-F9. Why? I have worked with numerous compilers in the past that only recompiled files that had changed.

An 'improvement' possibly? Or is it actually in place now - but it just LOOKS like it's not (watching the message window ... *TIME* spent waiting on the results of compiles for files that have not changed) ??

Steve
C have very complex rules for preprocessor and actually you do not have to change file to get different results of compilation. For example that file could include another and that another ... and so on. Now lets assume that
we have checked all files and all their dependencies, even that is not enough.
Because there is project level define which could be passed to preprocessor directly and you will get different results without modifying any file directly.

So there is always possibility to miss something. Result will be: file is not compiled even if it should be.

We had experience with 'smart' compilers that did not compile files that should be compiled. Personally I do not like 'smart' sw that most times works and sometimes not.

There is another way to get this done:
When you have compiled file and do not want to be compiled any more,
simply add .mcl file to binaries in project manager and remove it from list of source files in project manager. This way you have full control and do not have to recompile files that you have once compiled and you do not want to change any more.

sadavis80
Posts: 114
Joined: 15 Nov 2008 19:27

Re: 'Smart?' compiler? Why recompile a file that hasn't chan

#3 Post by sadavis80 » 10 Dec 2008 16:14

rajkovic wrote:There is another way to get this done:
When you have compiled file and do not want to be compiled any more,
simply add .mcl file to binaries in project manager and remove it from list of source files in project manager. This way you have full control and do not have to recompile files that you have once compiled and you do not want to change any more.
Thanks for the reply. I understand what you mean and I appreciate the work around. When I reach the point where my 'other' files are complete, I'll consider that alternative :).
Steve

amrbekhit
Posts: 95
Joined: 05 Jul 2007 12:55
Contact:

#4 Post by amrbekhit » 10 Dec 2008 19:25

An interesting topic post.

@rajkovic: you suggested to Steve that he should put his completed code into .mcl files. However, will these mcl files be only valid for one specific processor (namely the one they were initially compiled for)?

--Amr
[url=http://www.mikroe.com/forum/viewtopic.php?p=69489]mikroC USB Joystick[/url]
[url=http://helmpcb.com/software/usb-hid-template-for-visual-basic-2005]USB HID Template for Visual Basic 2005/2008/2010[/url]
[url=http://www.mikroe.com/forum/viewtopic.php?p=55958]Storing floats and other objects in EEPROM[/url]

User avatar
rajkovic
mikroElektronika team
Posts: 694
Joined: 16 Aug 2004 12:40

#5 Post by rajkovic » 11 Dec 2008 08:00

amrbekhit wrote:An interesting topic post.

@rajkovic: you suggested to Steve that he should put his completed code into .mcl files. However, will these mcl files be only valid for one specific processor (namely the one they were initially compiled for)?

--Amr
main menu Tools->Options->Output Settings there is combo box
Build all Files as Libraries

when this check box is checked mcl is built in common form which will work
with all* MCUs, if it is not checked then mcl is build for specific target mcu.
Price for common mcl is that code is a slightly greater but it can be used without re-compiling. In any case compiler will report error if you put mcl built for specific MCU and use it for another. Also there is two kind of common mcls
those for devices (with 16bit PC or smaller) those that have <= 128 kB
and those for devices with more than > 128kB
you will find that kind of separation in our uses folder.

for more information how to create library and use it refer to help section
Creating New Library

PS. we have not given details in help about this kind of difference among *.mcl files, it will be included in next release of compiler.

Post Reply

Return to “mikroC PRO for AVR Wish List”