Board index » cppbuilder » Re: parallel bcc32 build tool

Re: parallel bcc32 build tool


2005-08-18 01:07:05 AM
cppbuilder106
"Roddy Pratt" <roddy at spam fritter dot com>writes:
Quote
"Chris Uzdavinis (TeamB)" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>>>Standard bcc32 : 2 min 48 s
>>>mtbcc32, 2 threads : 1 min 48 s
>>>mtbcc32, 4 threads : 1 min 21 s
>>>BCB5 IDE : 16 min 14 s
>>>

>It's worse in the IDE when background compilation is enabled, but
>that's a bug in the IDE, not an inherent flaw in the design.

Chris - Do you think that the difference between 16:14 and 2:48 is a caused
by a bug in the IDE - (QC 6601??)

...or are you just trying to cheer me up by saying "if you think 16:14 is
slow, try enabling background compilation ;)"

I logged QC report 13775 a while back - maybe it's related to the 6601 bug?
I don't know if you're using background compilation or not, so I'm not
sure if I should have been trying to cheer you up or not. If you're
not using it, then I was trying to cheer you up. <g>
Seriously, all I know is that slow IDE builds are due to a bug in the
IDE. I'm also not sure if it's limited only for background compiles
or not, though background compilations certainly seem worse, IIRC, so
it could be.
The IDE compiles differently, because it uses a .dll version of the
compiler, and doesn't create any new process. It seems this has
potential of being faster, because it avoids all the startup time and
can keep the PCH cached. However, for whatever reason, this improved
performance is not realized.
--
Chris (TeamB);
 
 

Re:Re: parallel bcc32 build tool

"Rodrigo Gómez" < XXXX@XXXXX.COM >wrote in message
Quote
It's really easy to reproduce this. In any makefile, add to the include
paths a path surrounded by "" that contain spaces. That at least will
show this problem. The other that there is nothing reported back I guess
it's going to be a little bit difficult to reproduce :-/
Thank you for this explanation. I have been able to reproduce the error.
Now to fix it. :)
Jonathan
 

Re:Re: parallel bcc32 build tool

Jonathan Benedicto wrote:
Quote
This is really strange. I'll have to add a -debug option to mtbcc32, so
that users can track what it is doing.
Is there a deadlock? I have two bcc32.exe and one mtbcc32.exe running but
all three do not consume CPU time. And the compilation is on a still stand.
--
Regards,
Andreas Hausladen
 

{smallsort}

Re:Re: parallel bcc32 build tool

Jonathan Benedicto wrote:
Quote
Then maybe I'll make it an option. -equalize ?
To avoid the overhead of starting up the compiler many times and loading precompiled
headers many times it makes more sense to figure out how to assign source files to
the two compiler instances.
Some ideas toward that end:
- Measure of the compile times for all files. Run a Build as I previously described.
Do it twice with the first time to get the precompiled headers generated. Then on the
second pass record the times. Save those weightings to use to assign files in an
algorith to give the processors approximately equal amounts of work to do.
- Check .cpp file sizes on the disk to figure out which are bigger. But this misses
out on the cost of STL headers and other things that can eat into performance.
- Let the user assign files in lists to groups.
- Let the user create a table of weightings for how long each file takes to compile.
You could generate a compile time report on each file to help them do that.
Quote

Jonathan


 

Re:Re: parallel bcc32 build tool

Well.. it's the same... :(
Now I see the two threads:
C:\tsts\3.0\kernel>make -fDataModuleTS3.mak -B -d BCC32="mtbcc32 -debug"
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
C:\CBuilder6\BIN\mtbcc32 -debug -Od -H=c:\temp\objs\tsts3\datamodule\pch
.csm -Hc -Q -Vx -Ve -ff -X- -r- -a8 -6 -b- -k -y -v -vi- -c -tWM -w-par -Ic:\F
astReport3\LibBCB6;C:\ts\GenLicencias;..\mensajeria;..\programacion;..\varios;..
\ventanas;K:\LockBox\hpp6;C:\CBuilder6\Projects;C:\CBuilder6\include;C:\CBuilder
6\include\vcl;K:\NexusDB1\CBuilder6;K:\RxLib275BCB6\Units;k:\TMSPack\hpp6;K:\Del
phiGems\VirtualTreeview\hpp6;"K:\DelphiGems\Theme
Manager\hpp6";k:\bc2\tol;k:\bc
2\fechas;C:\jcl\include\c6;c:\ts\hasp;C:\HASPCD12\win32api\C;C:\DevExp.VCL\Libra
ry\CBuilder6;c:\kbmMemTable4\c6;"k:" -D_DEBUG;USAR_HASP;_RTLDLL;NO_STRICT;USEPAC
KAGES -nc:\temp\objs\tsts3\datamodule\ .\DataModuleTS3.CPP .\AutoDebug.CPP
.\Aud
itoria.CPP .\VErrorDebug.CPP .\VDataModulePrincipalTS3.CPP
..\ventanas\VEntrada.
CPP ..\varios\UtilVarios.CPP .\ConsErrores.CPP
..\varios\UtilConfiguracion.CPP .
\UtilUsuarios.CPP ..\mensajeria\UtilMensajeria.CPP .\ManejadorLicencias.CPP
.\VD
ataModuleReportes.CPP .\PermisosUsuarios.CPP
Compiling...
Thread count: 2
Debug: true
Equalize: false - 1 files at a time.
Thread 2368:
bcc32 -Od -H=c:\temp\objs\tsts3\datamodule\pc-0h.csm -Hc -Q -Vx -Ve
-ff -X- -r- -a8 -6 -b- -k -y -v -vi- -c -tWM -w-par -Ic:\FastReport3\LibBCB6;C:
\ts\GenLicencias;..\mensajeria;..\programacion;..\varios;..\ventanas;K:\LockBox\
hpp6;C:\CBuilder6\Projects;C:\CBuilder6\include;C:\CBuilder6\include\vcl;K:\Nexu
sDB1\CBuilder6;K:\RxLib275BCB6\Units;k:\TMSPack\hpp6;K:\DelphiGems\VirtualTreevi
ew\hpp6;K:\DelphiGems\Theme
Manager\hpp6;k:\bc2\tol;k:\bc2\fechas;C:\jcl\include
\c6;c:\ts\hasp;C:\HASPCD12\win32api\C;C:\DevExp.VCL\Library\CBuilder6;c:\kbmMemT
able4\c6;k: -D_DEBUG;USAR_HASP;_RTLDLL;NO_STRICT;USEPACKAGES -nc:\temp\objs\tsts
3\datamodule\ .\DataModuleTS3.CPP .\AutoDebug.CPP .\Auditoria.CPP
.\VErrorDebug.
CPP .\VDataModulePrincipalTS3.CPP ..\ventanas\VEntrada.CPP
..\varios\UtilVarios.
CPP
Thread 204:
bcc32 -Od -H=c:\temp\objs\tsts3\datamodule\pc-1h.csm -Hc -Q -Vx -Ve
-ff -X- -r- -a8 -6 -b- -k -y -v -vi- -c -tWM -w-par -Ic:\FastReport3\LibBCB6;C:\
ts\GenLicencias;..\mensajeria;..\programacion;..\varios;..\ventanas;K:\LockBox\h
pp6;C:\CBuilder6\Projects;C:\CBuilder6\include;C:\CBuilder6\include\vcl;K:\Nexus
DB1\CBuilder6;K:\RxLib275BCB6\Units;k:\TMSPack\hpp6;K:\DelphiGems\VirtualTreevie
w\hpp6;K:\DelphiGems\Theme
Manager\hpp6;k:\bc2\tol;k:\bc2\fechas;C:\jcl\include\
c6;c:\ts\hasp;C:\HASPCD12\win32api\C;C:\DevExp.VCL\Library\CBuilder6;c:\kbmMemTa
ble4\c6;k: -D_DEBUG;USAR_HASP;_RTLDLL;NO_STRICT;USEPACKAGES -nc:\temp\objs\tsts3
\datamodule\ .\ConsErrores.CPP ..\varios\UtilConfiguracion.CPP
.\UtilUsuarios.CP
P ..\mensajeria\UtilMensajeria.CPP .\ManejadorLicencias.CPP
.\VDataModuleReporte
s.CPP .\PermisosUsuarios.CPP
But after this, no other message. In the task manager there is no bcc32
running now, but it still doesn't return from the call to make... and
mtbcc32 is still present in the task manager.
Changing for threads1, 2, 4 etc doesn't seem to help... bcc32 ends from the
task list but mtbcc32 seems to fail realizing that.
Regards,
--
Rodrigo Gómez
www.rodrigogomez.com.mx/gallery/
"Jonathan Benedicto" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote
"Rodrigo Gómez" < XXXX@XXXXX.COM >wrote in message
news:43035f9d$ XXXX@XXXXX.COM ...
>Unfortunately that doesn't do the trick...
>
>With the 1.1 version, for example, I get all the errors about not being
>able to open an include file. With the 1.2 it just sits there without
>displaying anything :-|, and it doesn't seem to end.

Can you try with the new version ? It now prints out info with or without
the -debug mode on.

Jonathan

 

Re:Re: parallel bcc32 build tool

Thats what I get:
z:\Qt\bor\qt-4\src\tools\rcc>mtbcc32 -debug -c -q -tWR -5 -d -O2 -w -w-hid
-tWC -DUNICODE -DQT_RCC -DQT_LITE_UNICODE -DQT_NO_DATASTREAM
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT
-DQT_NODLL -I"..\..\corelib\arch\generic" -I"Z:/Qt/bor/qt-4/include" -I"."
-I"Z:/Qt/bor/qt-4/include/QtCore" -I"Z:/Qt/bor/qt-4/include/QtXml"
-I"..\..\3rdparty\zlib" -I"." -I"Z:\Qt\bor\qt-4\mkspecs\win32-borland"
-ntmp\obj\debug_shared\ ..\..\3rdparty\zlib\trees.c
Compiling...
Thread count: 2
Debug: true
Equalize: false - 1 files at a time.
Thread 7416: bcc32 -c -q -tWR -5 -d -O2 -w -w-hid -tWC -DUNICODE -DQT_RCC
-DQT_LITE_UNICODE -DQT_NO_DATASTREAM -DQT_NO_THREAD -DQT_NO_QOBJECT
-DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NODLL
-I..\..\corelib\arch\generic -IZ:/Qt/bor/qt-4/include -I.
-IZ:/Qt/bor/qt-4/include/QtCore -IZ:/Qt/bor/qt-4/include/QtXml
-I..\..\3rdparty\zlib -I. -IZ:\Qt\bor\qt-4\mkspecs\win32-borland
-ntmp\obj\debug_shared\ ..\..\3rdparty\zlib\trees.c
****{*word*154} **** CTRL+C
--
Regards,
Andreas Hausladen
 

Re:Re: parallel bcc32 build tool

I think I know why it's failing, at least the compilation.
If you see the command line passed, there is an include path "Theme manager"
that is not beign passed with ", so it
1) screws the include paths, so the errors reported by the 1.1 version
2) tryes to compile a Manager\... unit, that obviously doesn't exist.
The strange thing here is that it's not reported anywhere.
I'll see if I can do a testcase to send to you so you can try.
It's really easy to reproduce this. In any makefile, add to the include
paths a path surrounded by "" that contain spaces. That at least will show
this problem. The other that there is nothing reported back I guess it's
going to be a little bit difficult to reproduce :-/
Regards,
--
Rodrigo Gómez
www.rodrigogomez.com.mx/gallery/
"Rodrigo Gómez" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote
Well.. it's the same... :(

Now I see the two threads:

C:\tsts\3.0\kernel>make -fDataModuleTS3.mak -B -d BCC32="mtbcc32 -debug"
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
C:\CBuilder6\BIN\mtbcc32 -debug -Od -H=c:\temp\objs\tsts3\datamodule\pch
.csm -Hc -Q -Vx -Ve -ff -X- -r- -a8 -6 -b- -k -y -v -vi- -c -tWM -w-par
-Ic:\F
astReport3\LibBCB6;C:\ts\GenLicencias;..\mensajeria;..\programacion;..\varios;..
\ventanas;K:\LockBox\hpp6;C:\CBuilder6\Projects;C:\CBuilder6\include;C:\CBuilder
6\include\vcl;K:\NexusDB1\CBuilder6;K:\RxLib275BCB6\Units;k:\TMSPack\hpp6;K:\Del
phiGems\VirtualTreeview\hpp6;"K:\DelphiGems\Theme
Manager\hpp6";k:\bc2\tol;k:\bc
2\fechas;C:\jcl\include\c6;c:\ts\hasp;C:\HASPCD12\win32api\C;C:\DevExp.VCL\Libra
ry\CBuilder6;c:\kbmMemTable4\c6;"k:" -D_DEBUG;USAR_HASP;_RTLDLL;NO_STRICT;USEPAC
KAGES -nc:\temp\objs\tsts3\datamodule\ .\DataModuleTS3.CPP .\AutoDebug.CPP
.\Aud
itoria.CPP .\VErrorDebug.CPP .\VDataModulePrincipalTS3.CPP
..\ventanas\VEntrada.
CPP ..\varios\UtilVarios.CPP .\ConsErrores.CPP
..\varios\UtilConfiguracion.CPP .
\UtilUsuarios.CPP ..\mensajeria\UtilMensajeria.CPP
.\ManejadorLicencias.CPP .\VD
ataModuleReportes.CPP .\PermisosUsuarios.CPP
Compiling...
Thread count: 2
Debug: true
Equalize: false - 1 files at a time.
Thread 2368:
bcc32 -Od -H=c:\temp\objs\tsts3\datamodule\pc-0h.csm -Hc -Q -Vx -Ve
-ff -X- -r- -a8 -6 -b- -k -y -v -vi- -c -tWM -w-par -Ic:\FastReport3\LibBCB6;C:
\ts\GenLicencias;..\mensajeria;..\programacion;..\varios;..\ventanas;K:\LockBox\
hpp6;C:\CBuilder6\Projects;C:\CBuilder6\include;C:\CBuilder6\include\vcl;K:\Nexu
sDB1\CBuilder6;K:\RxLib275BCB6\Units;k:\TMSPack\hpp6;K:\DelphiGems\VirtualTreevi
ew\hpp6;K:\DelphiGems\Theme
Manager\hpp6;k:\bc2\tol;k:\bc2\fechas;C:\jcl\include
\c6;c:\ts\hasp;C:\HASPCD12\win32api\C;C:\DevExp.VCL\Library\CBuilder6;c:\kbmMemT
able4\c6;k: -D_DEBUG;USAR_HASP;_RTLDLL;NO_STRICT;USEPACKAGES -nc:\temp\objs\tsts
3\datamodule\ .\DataModuleTS3.CPP .\AutoDebug.CPP .\Auditoria.CPP
.\VErrorDebug.
CPP .\VDataModulePrincipalTS3.CPP ..\ventanas\VEntrada.CPP
..\varios\UtilVarios.
CPP
Thread 204:
bcc32 -Od -H=c:\temp\objs\tsts3\datamodule\pc-1h.csm -Hc -Q -Vx -Ve
-ff -X- -r- -a8 -6 -b- -k -y -v -vi- -c -tWM -w-par -Ic:\FastReport3\LibBCB6;C:\
ts\GenLicencias;..\mensajeria;..\programacion;..\varios;..\ventanas;K:\LockBox\h
pp6;C:\CBuilder6\Projects;C:\CBuilder6\include;C:\CBuilder6\include\vcl;K:\Nexus
DB1\CBuilder6;K:\RxLib275BCB6\Units;k:\TMSPack\hpp6;K:\DelphiGems\VirtualTreevie
w\hpp6;K:\DelphiGems\Theme
Manager\hpp6;k:\bc2\tol;k:\bc2\fechas;C:\jcl\include\
c6;c:\ts\hasp;C:\HASPCD12\win32api\C;C:\DevExp.VCL\Library\CBuilder6;c:\kbmMemTa
ble4\c6;k: -D_DEBUG;USAR_HASP;_RTLDLL;NO_STRICT;USEPACKAGES -nc:\temp\objs\tsts3
\datamodule\ .\ConsErrores.CPP ..\varios\UtilConfiguracion.CPP
.\UtilUsuarios.CP
P ..\mensajeria\UtilMensajeria.CPP .\ManejadorLicencias.CPP
.\VDataModuleReporte
s.CPP .\PermisosUsuarios.CPP

But after this, no other message. In the task manager there is no bcc32
running now, but it still doesn't return from the call to make... and
mtbcc32 is still present in the task manager.

Changing for threads1, 2, 4 etc doesn't seem to help... bcc32 ends from
the task list but mtbcc32 seems to fail realizing that.

Regards,

--
Rodrigo Gómez
www.rodrigogomez.com.mx/gallery/


"Jonathan Benedicto" < XXXX@XXXXX.COM >escribi?en el mensaje
news:430365fa$ XXXX@XXXXX.COM ...
>"Rodrigo Gómez" < XXXX@XXXXX.COM >wrote in message
>news:43035f9d$ XXXX@XXXXX.COM ...
>>Unfortunately that doesn't do the trick...
>>
>>With the 1.1 version, for example, I get all the errors about not being
>>able to open an include file. With the 1.2 it just sits there without
>>displaying anything :-|, and it doesn't seem to end.
>
>Can you try with the new version ? It now prints out info with or without
>the -debug mode on.
>
>Jonathan
>


 

Re:Re: parallel bcc32 build tool

The main "problem" is in make.exe which mtbcc32.exe cannot control.
A very complex solution would be to replace the make.exe so independent
dependency lists could be executed twice, like the "gnumake -j2" command.
--
Regards,
Andreas Hausladen
 

Re:Re: parallel bcc32 build tool

Great!
Let me know when you have it so I can try here :-)
Regards,
--
Rodrigo Gómez [NDX]
rodrigo.gomez at ndx dot nexusdb dot com
www.rodrigogomez.com.mx/gallery/
"Jonathan Benedicto" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote
"Rodrigo Gómez" < XXXX@XXXXX.COM >wrote in message
news:4303780b$ XXXX@XXXXX.COM ...
>It's really easy to reproduce this. In any makefile, add to the include
>paths a path surrounded by "" that contain spaces. That at least will
>show this problem. The other that there is nothing reported back I guess
>it's going to be a little bit difficult to reproduce :-/

Thank you for this explanation. I have been able to reproduce the error.
Now to fix it. :)

Jonathan

 

Re:Re: parallel bcc32 build tool

Quote
Is there a deadlock? I have two bcc32.exe and one mtbcc32.exe running but
all three do not consume CPU time. And the compilation is on a still
stand.
Hey, this looks like the problem I'm experiencing here...
--
Rodrigo Gómez
www.rodrigogomez.com.mx/gallery/
"Andreas Hausladen" < XXXX@XXXXX.COM >escribi?en el
mensaje news: XXXX@XXXXX.COM ...
Quote
Jonathan Benedicto wrote:

>This is really strange. I'll have to add a -debug option to mtbcc32, so
>that users can track what it is doing.

Is there a deadlock? I have two bcc32.exe and one mtbcc32.exe running but
all three do not consume CPU time. And the compilation is on a still
stand.


--
Regards,

Andreas Hausladen
 

Re:Re: parallel bcc32 build tool

"Chris Uzdavinis (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

However, for whatever reason, this improved
performance is not realized.
!!! The master of understatement...
The times quoted weren't mine. But I also see a>5x speedup if I build from
the command line rather than from the IDE, and I don't use BG compiles.
If the bccide interface was even half-documented, it might be possible to
get the DLL to use the command line compiler instead....?
- Roddy
 

Re:Re: parallel bcc32 build tool

Hi Roddy,
Quote

The times quoted weren't mine. But I also see a>5x speedup if I build from
the command line rather than from the IDE, and I don't use BG compiles.
I didn't use BG compiling, I don't have the time to measure that ;-)
Bye, Oliver
 

Re:Re: parallel bcc32 build tool

"Roddy Pratt" <roddy at spam fritter dot com>wrote in message
Quote
...I don't use BG compiles.
(...wiping egg off face...) Well, NOW I don't use BG compiles. Aliens must
have altered my settings while I slept.
 

Re:Re: parallel bcc32 build tool

I have written an alternative tool (fbcc32.exe) which uses another file
distribution algorithm. (and does not hang on my computer). Because I'm
more advanced in writing Delphi application, it is written in Delphi but
that should be no problem.
It tries to catch the problem with files that take long to compile by not
dividing the all files to the threads. It divides only 75% of the files.
The rest is given to idle thread. So fast threads can get more files while
slow threads can do their job.
If there is only one file or one thread the main thread does the job
itself. The compiler output is written to the console when one file is
compiled (parses the compiler's output) or the thread terminates.
See b.p.attachment for the download (includes executable, source code and
a build.bat). Qt-4 is now compiled really fast with fbcc32.
--
Regards,
Andreas Hausladen
 

Re:Re: parallel bcc32 build tool

This works fine with my projects, it compiles the projects I've having
problems with mtbcc32 without problems.
Now... I'm seeing that for a project, one of the bcc32 running can't write
te precompiled headers, maybe changing the filename as mtbcc32 does solves
this problem?
Regards,
--
Rodrigo Gómez
www.rodrigogomez.com.mx/gallery/
"Andreas Hausladen" < XXXX@XXXXX.COM >escribi?en el
mensaje news:4303bbc3$ XXXX@XXXXX.COM ...
Quote
I have written an alternative tool (fbcc32.exe) which uses another file
distribution algorithm. (and does not hang on my computer). Because I'm
more advanced in writing Delphi application, it is written in Delphi but
that should be no problem.
It tries to catch the problem with files that take long to compile by not
dividing the all files to the threads. It divides only 75% of the files.
The rest is given to idle thread. So fast threads can get more files while
slow threads can do their job.
If there is only one file or one thread the main thread does the job
itself. The compiler output is written to the console when one file is
compiled (parses the compiler's output) or the thread terminates.

See b.p.attachment for the download (includes executable, source code and
a build.bat). Qt-4 is now compiled really fast with fbcc32.


--
Regards,

Andreas Hausladen