BasePointer
Tester - PICC PRO
Reged: Oct 16 2003
Posts: 203
Loc: Istanbul, Turkey
|
|
Hello,
What are the tricks to reduce compile time of PICC18? Compile time of my current application is 15 seconds and it grows as proportional to the size of the application.
Thanks
|
Ryan
HI-TECH team member
   
Reged: Jan 06 2004
Posts: 503
Loc: Brisbane, Australia
|
|
The compiler will have a delay when building until it is activated; this is the same for the demo. If you have a large project it can take a while, but nothing out of the ordinary. Perhaps you're encountering the delay?
|
Dimitri Turbiner
Reged: Dec 02 2004
Posts: 8
|
|
I use a fully working picc18 compiler. Everything goes OK for normal code but when I compile some heavy math, even with all optimizations off it takes about a minute to compile!.
For example Code:
teta2 = gamma + acos(
(pow(x4,2)+pow(y4,2)+pow(z4,2)-pow(l3,2)+pow(l2,2))/
(2*l2*sqrt(pow(x4,2)+pow(y4,2)+pow(z4,2))));
teta3 = PI / 2 - acos(
(pow(x4,2)+pow(y4,2)+pow(z4,2)-pow(l3,2)+pow(l2,2))/
(2*l2*sqrt(pow(x4,2)+pow(y4,2)+pow(z4,2)))) - acos(
(pow(x4,2)+pow(y4,2)+pow(z4,2)+pow(l3,2)-pow(l2,2))/
(2*l3*sqrt(pow(x4,2)+pow(y4,2)+pow(z4,2))));
I'm just posting to post, no questions or anything. The compiler is great, congratulations. Dimitri
|
BasePointer
Tester - PICC PRO
Reged: Oct 16 2003
Posts: 203
Loc: Istanbul, Turkey
|
|
Hello Ryan,
I have already activated it. I have a huge project to compile. I'm using a lot of unit in the project like io.c, bl.c, rtc.c, serial.c, etc... Doesn't PICC18 every times compile all units that I use when I build the project. Isn't there a way my units to become pre-compiled. I may reduce compile time with this way?
Thanks
|
Dan Henry
Guru
  
Reged: Oct 16 2003
Posts: 3863
Loc: Colorado
|
|
Quote:
Isn't there a way my units to become pre-compiled.
Sounds like a job for a 'make' tool.
|
BasePointer
Tester - PICC PRO
Reged: Oct 16 2003
Posts: 203
Loc: Istanbul, Turkey
|
|
Hello Dimitri,
If you use huge table like below, It takes extra about 10 seconds.
Code:
static const char* const str[] = {"menu", "back", "prepare", "run",...};
|
kcress
Reged: Feb 22 2005
Posts: 42
|
|
Hi Base,
There are two button in the IDE for compiling. One does them all. The other only does what needs to be compiled usually just the module you just worked on.. Which is about 50% faster if you have 6-8 modules.
|
lucky
Microchip staff
   
Reged: Oct 06 2003
Posts: 1184
Loc: Brisbane, Australia
|
|
Someone recently asked this question, to which Clyde responded:
Quote:
Code generation represents an NP-complete problem. We use various heuristics to limit the search space for solutions, otherwise everything would take a long time to compile. Occasionally a particular expression comes along that the heuristics don't work well on, so the code generator ends up considering nearly every possible solution before finding one that's suitable. With an example, we can tweak the heuristics to deal with this particular case by guiding the search down a path that terminates early.
However, I'm not surprised that your example does take a little while to process Dimitri. I would say that the example is a little unusual (but perfectly valid). Turning global optimizations on will further increase the time, as the code generator will (re)considered register usage. Like Clyde says, most of time it's pretty quick, but sometimes you guys write stuff that really gives it a workout. If it's annoying, a quick work-around would be to simplify the expression (break it up into multiple lines), or, you can send the example to support@htsoft.com so that someone can take a look at it when the next version of the compiler is released.
-------------------- Matt Luckman
Microchip Technology Inc.
|
pball
 
Reged: Apr 19 2004
Posts: 51
|
|
Where's the problem with 15 seconds? Honestly, that is really peanuts.
Most of the time I have to work on an application using Visual Studio C++ and the compile time for the project is 15 minutes! A number of years ago I had to work with an Ada compiler and the whole project took three hours to compile.
-------------------- There are 10 kinds of people, those that can do binary arithmetic and those that can't.
|
BasePointer
Tester - PICC PRO
Reged: Oct 16 2003
Posts: 203
Loc: Istanbul, Turkey
|
|
Quote:
Sounds like a job for a 'make' tool.
What is 'make' tool ?
|