Build process starts out with just 1 unit

TwineCompile - Cut C++Builder compile times by up to 50x!
Post Reply
zzattack
Posts: 22
Joined: Tue Feb 02, 2021 3:35 am

Build process starts out with just 1 unit

Post by zzattack »

Regardless of the number of CPU cores set to use by TwineCompile, it appears on my systems that initially only a single unit is compiled simultaneously. Once compilation of this first unit completes, the actual requested number of cores is put to use.
Is this deliberate, optional and/or desirable?
jomitech
Site Admin
Posts: 2153
Joined: Wed Oct 08, 2008 12:23 am

Re: Build process starts out with just 1 unit

Post by jomitech »

This is deliberate for any project that has been configured to use pre-compiled headers. The first unit is compiled by itself to generate the pre-compiled header and then subsequent units can use this pre-compiled header. If multiple files were initially compiled simultaneously, they would either be unable to use that pre-compiled header, or would cause it to be corrupted because it was generated by several units.

If your project does not use pre-compiled headers, you can turn them off in the compiler options, and TwineCompile will compile as many files as possible from the start.
Jon
zzattack
Posts: 22
Joined: Tue Feb 02, 2021 3:35 am

Re: Build process starts out with just 1 unit

Post by zzattack »

That makes perfect sense, thanks for clearing it up!
zzattack
Posts: 22
Joined: Tue Feb 02, 2021 3:35 am

Re: Build process starts out with just 1 unit

Post by zzattack »

Even after setting the following project options, I'm still seeing the same behavior:

Code: Select all

 - PCH Usage (Do not use)
 - External types files (false)
 - Enable smart cached precompiled headers (false)
 - Cache precompiled headers (false)
This is the same for all projects in my group project. Anything else I could be missing? (Maybe some #pragma smart header stuff?)
jomitech
Site Admin
Posts: 2153
Joined: Wed Oct 08, 2008 12:23 am

Re: Build process starts out with just 1 unit

Post by jomitech »

Are you using the Classic or CLANG compiler?
Jon
zzattack
Posts: 22
Joined: Tue Feb 02, 2021 3:35 am

Re: Build process starts out with just 1 unit

Post by zzattack »

We're using the CLang compiler.
jomitech
Site Admin
Posts: 2153
Joined: Wed Oct 08, 2008 12:23 am

Re: Build process starts out with just 1 unit

Post by jomitech »

I've made an update that will allow TwineCompile to determine if CLANG is being used without precompiled headers (unlike the classic compiler, there are no explicit flags for it).

Please download the following file and extract into the TwineCompile Program Files directory:
http://jomitech.com/downloads/mtbcc32.zip
Jon
zzattack
Posts: 22
Joined: Tue Feb 02, 2021 3:35 am

Re: Build process starts out with just 1 unit

Post by zzattack »

Hi Jon,
Thanks for that. I've done a bunch of builds with it, and I believe this works as expected. Each project now starts with multiple compiler invocations right away. I hope this will make it into an official update :)
jomitech
Site Admin
Posts: 2153
Joined: Wed Oct 08, 2008 12:23 am

Re: Build process starts out with just 1 unit

Post by jomitech »

Yes, it'll be part of the next release. Glad it worked for you.
Jon
Post Reply