how can speedup the compile time of chdk - General Discussion and Assistance - CHDK Forum  

how can speedup the compile time of chdk

  • 12 Replies
  • 3468 Views
how can speedup the compile time of chdk
« on: 27 / November / 2010, 08:10:58 »
Advertisements
I have a Intel i5 760 system, but chdk compile after a simple source code change very long 1 min and 4 sec.

the remove of primary.bin to avoid this 22 sec wait at ->stubs_entry.S do not work.there come linker error,but the 22 sec wait is gone.

the build script generate also a file primary.bin with 0 size.
when compile again, gmake make a crash message and do nothing compile anymore.
there seem a file lock in that case, because only reboot windows get compile working again.

i like to get gcc 3.x working on win7 64 because GCC 3 compile faster, but this can not enable in chdk.
Also wy can gmake not use the 4 cores to compile the .o files ?
normaly compiling can be paralel so compile can speed up a lot.

Wy is it not possible to get GCC 3 working on win 7 ?
On winxp i was able to choose between gcc 3 and gcc 4.but now i have no winxp system.

my old system with 1.8 GHZ CPU need 1 min 16 sec with gcc 3.the i760 run when only 1 core is use at 3.3 GHZ but it compile in 1 min 4 sec. with GCC 4
so can see, no 4 cores are use and gcc 4 is slower
« Last Edit: 27 / November / 2010, 08:14:42 by Bernd R »
Ixus 1000 HS

*

Offline reyalp

  • ******
  • 13392
Re: how can speedup the compile time of chdk
« Reply #1 on: 27 / November / 2010, 16:23:35 »
Copying my response from the other thread

There's a few things going on:
1) the build dependencies are a mess. If this were fixed, you wouldn't have to do full builds all the time. If you know what you are doing, you don't have to do a full build every time. In general, if you only changed a C files, you can do an incremental build.
2) the build process does not support parallel building. Again, could be fixed by cleaning up the build process.
3) gcc on windows is slow. cygwin is even worse.
4) You don't have to regenerate stubs_entry.S unless you modify the sigs. Turning this off should speed your builds up quite a bit. Simply remove your PRIMARY.BIN (or better yet, keep your PRIMARY.BINs in another tree, and set PRIMARY_ROOT to point at it when you need to rebuild stubs_entry.S)
5) there are many other things built every time in a full build that you don't need to.
« Last Edit: 27 / November / 2010, 17:22:36 by reyalp »
Don't forget what the H stands for.

Re: how can speedup the compile time of chdk
« Reply #2 on: 28 / November / 2010, 04:06:24 »
Point 4 do not work.Have you try it out with chdk-shell and it work ?

Is it possible to switch off the compiler optimizer(from makefile), so chdk is compile unoptimize and its good enough for testing ?

when switch optimizer in gcc off, it compile lots faster.then gcc 3 and gcc4 compile speed is not diffrent.
gcc4 compile only longer, because he do more try to optimize

also the question, wy the gcc 3 does not work on win 7 is not answer.
if this gcc 3 version build is too old, then i can maybe compile a new arm gcc for win7.

Ixus 1000 HS

*

Offline reyalp

  • ******
  • 13392
Re: how can speedup the compile time of chdk
« Reply #3 on: 28 / November / 2010, 04:28:53 »
Point 4 do not work.
Works for me.
Quote
Have you try it out with chdk-shell and it work ?
I do not use CHDK shell, but if the PRIMARY_ROOT is not set and there is not a primary.bin present, then stubs_entry.S will not be regenerated.
Quote
Is it possible to switch off the compiler optimizer(from makefile), so chdk is compile unoptimize and its good enough for testing ?
Edit the make file and find out (probably top-level makefile.inc). It's possible that some things will break, CHDK does some things that are technically not valid and may or may not be affected by changes in optimization settings. e.g. C code in naked functions.
Quote
also the question, wy the gcc 3 does not work on win 7 is not answer.
Don't know. Feel free to post the answer if your figure it out.
Quote
if this gcc 3 version build is too old, then i can maybe compile a new arm gcc for win7.
Configuring GCC is a bit of a black art, even on non-windows platforms. If it takes you, say, 8 hours to figure out how to cut your two minute compile times in half, that's a lot of compiles you have to do to make it up ;)
Don't forget what the H stands for.


*

Offline whim

  • ******
  • 2041
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: how can speedup the compile time of chdk
« Reply #4 on: 28 / November / 2010, 05:35:32 »
@Bernd R

This post by reyalp and the following might interest you ...

HTH,

wim

*

Offline fe50

  • ******
  • 3132
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: how can speedup the compile time of chdk
« Reply #5 on: 28 / November / 2010, 06:13:05 »
Long time ago PlasmaHH did some tests, e.g. he modified the makefiles for parallel building...
--> http://www.projectiwear.org/~plasmahh/chdk.html

Re: how can speedup the compile time of chdk
« Reply #6 on: 28 / November / 2010, 06:29:18 »
>I do not use CHDK shell, but if the PRIMARY_ROOT is not set and there is not a primary.bin present, then >stubs_entry.S will not be regenerated.

yes thats true it is not regenerate, but something create a primary.bin file with size of 0, open some files, and forget to close them, so next make fail.

maybe thats a chdk shell problem only ?

>Configuring GCC is a bit of a black art, even on non-windows platforms. If it takes you, say, 8 hours to >figure out how to cut your two minute compile times in half, that's a lot of compiles you have to do to >make it up.

yes thats the logical theory.
But i dislike to sit and wait 1 minute watch that the computer finish.this make no fun, and i like do in my free time other things that do more fun.because when i test some code, i want see soon the results

also when get the gcc 3 working on win 7, this help all of you to compiling time in next years.
win 7 64 is the last windows i think which do lots changes in compare to previous win versions
so i can be sure GCC 3 work in next 10 years.

@whim

thanks for the link, can you please tell how i can remove the gcc 3 disable in chdk shell ?.
maybe GCC 3 can work.

I know a little about GCC compile and when the -v command work, then gcc should normaly work.

here is the output i get when i start gcc from shell

C:\Users\pc>E:\chdk\gcc\bin\gcc.exe -v
Reading specs from E:/chdk/gcc/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --wi
th-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --dis
able-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --d
isable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --with
out-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enabl
e-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)

C:\Users\pc>

Ixus 1000 HS

*

Offline whim

  • ******
  • 2041
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: how can speedup the compile time of chdk
« Reply #7 on: 28 / November / 2010, 09:13:40 »
@Bernd R

Quote
can you please tell how i can remove the gcc 3 disable in chdk shell ?

1. wait for v2.85 to pop up (should be soon, but need to do some clean up, was in the middle of something)
2. add to inifile in [Program] section 'override_oscheck=1' (but not the quotes)

wim

PS done...it even seems to compile on Win 7  :blink:
« Last Edit: 28 / November / 2010, 10:31:28 by whim »


Re: how can speedup the compile time of chdk
« Reply #8 on: 28 / November / 2010, 12:03:14 »
@whim
thanks for adding override_oscheck=1

i activate it and i can compile chdk with 3.x compiler.
I test also the exe in the camera, it work as before.

now compile is 23 sec faster.need now 41 sec, before need 1 min 4 sec on my system.

@all
the speedup is on fast systems not so much because this 22 sec wait on stubs_entry.S is still here.
remove or rename of primary.bin does not work.

maybe i understand something wrong.
I rename in
 trunk969/platform/ixus1000_sd4500/sub/100d/primary.bin

rename to

 trunk969/platform/ixus1000_sd4500/sub/100d/_primary.bin

so the build script do not find it.

I test again and do a compile and it works 1 time.
But when i look in the folder   trunk969/platform/ixus1000_sd4500/sub/100d

i see then a new file primary.bin with size 0.
then the next compile fail because it want read from primary.bin with size 0.

So how can avoid when remove primary.bin that no primary.bin with size 0 is create ?
or is this chdkshell Problem ?

a workaround can be, that chdk shell delete the file primary.bin when size is 0 at end of compile
I test this some times and it work.

Now compile time is 20 sec.
thats fast enough, because i remove  when i start compile the SD Card from Camera and put in reader.I dont want stress ;-)

total commander can always show the zip file content in a dir, (even if it is update), so i need only click on this 2 files with shift and press f5 to copy the files to SD-card.
« Last Edit: 28 / November / 2010, 12:13:02 by Bernd R »
Ixus 1000 HS

*

Offline reyalp

  • ******
  • 13392
Re: how can speedup the compile time of chdk
« Reply #9 on: 28 / November / 2010, 15:20:00 »
i see then a new file primary.bin with size 0.
then the next compile fail because it want read from primary.bin with size 0.
This is wrong. Look at the make files and understand what it does.

edit:
To clarify, the build process intentionally uses "touch" to create a zero byte primary.bin if it doesn't exist. This is unrelated to any problem you may have with the build failing.
« Last Edit: 28 / November / 2010, 15:26:42 by reyalp »
Don't forget what the H stands for.

 

Related Topics