MinGW errors

Well looks like i was wrong

1>Link:
1>  Ctrlr_Standalone.vcxproj -> C:\devel\ctrlrv4\nightly\Builds\Generated\Windows\Standalone\.\Release_Nightly\Ctrlr-Win32.exe
1>PostBuildEvent:
1>          1 file(s) copied.
1>FinalizeBuildStatus:
1>  Deleting file ".\Release_Nightly\Ctrlr_Standalone.unsuccessfulbuild".
1>  Touching ".\Release_Nightly\Ctrlr_Standalone.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:02:58.96
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

disabling LTCGin Introjucer helped a lot. Now the question is do i need that option, with LTCG enabled it’s 30 minutes, is it worth it ?

HOLY!!! This is madness! I looked at your numbers again…I just assumed when I saw the 30 it was the number of seconds. In fact, it is half an hour! That’s crazy! And you’re pointing to a 3 minute build as an example of success? I think I would jump out of the window of a tall building if it took 3 minutes to build an app.

This is definitely a consequence of not having header files structured properly. Especially being on a 16 core system.

“Link Time Code Generation” is needed for whole program optimization. It is a technique for inlining code across translation units (.cpp files). Is it necessary? Well the way that the JUCE sources are organized, it certainly won’t help JUCE. It wouldn’t help VFLib either since I have used the same Unity Build style. Besides, most time critical JUCE code is already marked inline and put into the header files.

I have found that Link Time Code Generation doesn’t really help very much in terms of performance. If you need a performance boost you should consider the Intel C++ Studio compiler. It generally provides a small but measurable increase in speed. The profiler is also great.

So is it just the link that takes 2 minutes 58 seconds or a full build? Is this just one .exe or many projects? Did you organize your code in the unity build style?

Well the link time is that long cause the linked does not use threads, is’t a single process so it’s as fast as a 2.4GHz cpu, i’d need to speed my up CPU to make it faster.

Anyway i turned on precompiled headers and disabled the LTCG i’m down to:

1>ResourceCompile:
1>  All outputs are up-to-date.
1>Link:
1>  LINK : .\..\..\..\..\Bin\Standalone\Win32\\Ctrlr-Debug-Win32.exe not found or not built by the last incremental link; performing full link
1>  Ctrlr_Standalone.vcxproj -> C:\devel\ctrlrv4\nightly\Builds\Generated\Windows\Standalone\.\..\..\..\..\Bin\Standalone\Win32\Ctrlr-Debug-Win32.exe
1>CopyFilesToOutputDirectory:
1>  Copying file from ".\Debug\Ctrlr-Debug-Win32.pdb" to ".\..\..\..\..\Bin\Standalone\Win32\Ctrlr-Debug-Win32.pdb".
1>FinalizeBuildStatus:
1>  Deleting file ".\Debug\Ctrlr_Standalone.unsuccessfulbuild".
1>  Touching ".\Debug\Ctrlr_Standalone.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:24.84
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

24 seconds build now. Though it’s impossible to use precompiled headers with Introjucer, you need per-file settings to tell VS not to use PCH when compiling JUCE sources (the same goes for lua C files). It’s possible from MSVC but you can’t exclude files from using PCH using the command line.

You’re right that linking is a serial operation, but note that the linking step is typically not CPU-bound but rather, I/O bound. That’s why I do all my development on a machine with an SSD drive. If you don’t have an SSD drive you can get a freeware RAM disk utility (List of RAM drive software - Wikipedia). Preferably one that saves the contents to disk on a shutdown and reloads it on startup.

Change your project so that all the intermediate outputs go to the RAM drive and you will see significant performance gains. Also, more RAM helps with the linking process.

Yep, this is an unfortunate consequence of IntroJucer. It will never offer as much support as what you can get in the native IDE. That’s why making IntroJucer required for practical development is a bad idea.

I dealt with I/O CPU and Memory when i was building my PC, i got a OCZ RevoDrive 2 it does 120,000 IOPS and about 700MB/s read/write speed, i got DDR3 in dual channel ECC registered dimms with 8GB so i doubt theese are my bottlenecks. I just need to organize my includes better, but 30minutes down to 24 seconds is a major leap anyway. I was experimenting with MINGW for that reason it compiles my program really fast and linking is almost instant.

I looked a bit mote into the precompiled header stuff, i guess it could be done (or at least i think) with MSBuild and it’s build customizations, by creating a XML that modifies the project when it builds, and adding properties to selected files. I had a look what changes in vcxproj when i save the project with some files excluded from PCH

<ClCompile Include="..\..\..\..\Source\Lua\luabind\src\wrapper_base.cpp">
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release_Nightly|Win32'">NotUsing</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release_Nightly|x64'">NotUsing</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
      </AdditionalOptions>
      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release_Nightly|Win32'">
      </AdditionalOptions>
      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
      </AdditionalOptions>
      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
      </AdditionalOptions>
      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release_Nightly|x64'">
      </AdditionalOptions>
      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
      </AdditionalOptions>
    </ClCompile>

From what i was able to understand from the MSBuild documentation on MSDN it can be done, but how … maybe someone is a bit more MSBuild savvy here and could help.