Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » TheIDE precompiled headers: again
TheIDE precompiled headers: again [message #44139] Sun, 04 January 2015 07:47 Go to next message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
I wrote patch for proper PCH handling three years ago, but have no feedback yet.
Now TheIDE build system has global flag "Allow precompiled headers" per build method.

This is not good way. Let's examine why:

0. you cannot set PCH flag for specific package - it's global. PCH has effect only for frequent builds (1..5 changing packages, not all).
1. PCH is supported only by MSC Builder. GCH is not supported.
2. only <package name>.h header can be precompiled
3. any file in package must include it (see "add check" TODO's in source code)
4. PCH building at begin and not in parallel with other files
5. you cannot set specific defines or compiler options for some .cpp file
6. additional temporary .cpp file is created
7. PCH can be used only with BLITZ

My patch is more flexible:

0. PCH flag can be set per package (at Output mode package grid, near BLITZ checkbox). Now you can check it for current developing packages
1. PCH is supported by MSC (include v7.0) and GCC too (GCH)
2. any single header file can be used as precompiled (mark it by adding PCH compiler option at Package Organizer)
3. inclusion of PCH is made automatically ("-FI" for MSC and "-include" for GCC)
4. PCH builds in parallel with other files. When it built, it can be used
5. files with specific defines or compiler options are compiled without PCH
6. no additional source files is created (header compiles as is)
7. PCH can be used with or without BLITZ

There is only one breaking change: build-time defines bm* (bmYEAR, bmMONTH, bmDAY, bmHOUR, bmMINUTE, bmSECOND) are deprecated.

Working with PCH header is also simple:
http://shire.noip.me/upp/pch-step-1.jpg http://shire.noip.me/upp/pch-step-2.jpg

Marking header by compiler option is just workaround for package format compatibilty. In future, marker can be checkbox near "Optimize the file for speed".

Patch published on GitHub, also you can test prebuilt TheIDE binaries for Debian 7 x64 (GCC 4.7.2) or Win32 (MSC10)

[Updated on: Mon, 05 January 2015 14:01]

Report message to a moderator

Re: TheIDE precompiled headers: again [message #44140 is a reply to message #44139] Sun, 04 January 2015 18:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Hi,

thanks. That "Allow precompiled headers" option was meant as just the start of the work, which really has not got too far at that point.

I will investigate your patch soon. Some points:

- I believe that PCH should be more or less completely automated, that is why I wanted to precompile "Package.h" header. For most packages it is the right thing to do... Providing "No PCH" flag (akin "No BLITZ") per package is however a good idea anyway.

- bmYear etc... is pity, but I understand that they are incomapatible with PCH. We will have to provide some alternative way how to get them into the code. I guess that one possible way is to create temporary .cpp file with those #defines which could be included where that info is needed.

Mirek
Re: TheIDE precompiled headers: again [message #44142 is a reply to message #44140] Mon, 05 January 2015 13:53 Go to previous messageGo to next message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
mirek wrote on Sun, 04 January 2015 23:52

- I believe that PCH should be more or less completely automated, that is why I wanted to precompile "Package.h" header. For most packages it is the right thing to do...


PCH is huge file (for example, ~70Mb per package PCH on MSC32, and ~190Mb for GCC32), and it's build time is too long. Enabling PCH for any package will eat many output directory space and will significally increase first build time. Any change in any dependent header will cause PCH rebuild, and efficiency of most PCH'es will be negative.
That's why I prefer default setting "off".
Hardcoding <package_name>.h is not good when you writing plugins. I make precompiled "common.h" header with UPP and plugin private headers.

[Updated on: Mon, 05 January 2015 13:59]

Report message to a moderator

Re: TheIDE precompiled headers: again [message #44143 is a reply to message #44142] Mon, 05 January 2015 19:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Shire wrote on Mon, 05 January 2015 13:53
mirek wrote on Sun, 04 January 2015 23:52

- I believe that PCH should be more or less completely automated, that is why I wanted to precompile "Package.h" header. For most packages it is the right thing to do...


PCH is huge file (for example, ~70Mb per package PCH on MSC32, and ~190Mb for GCC32), and it's build time is too long. Enabling PCH for any package will eat many output directory space and will significally increase first build time. Any change in any dependent header will cause PCH rebuild, and efficiency of most PCH'es will be negative.
That's why I prefer default setting "off".
Hardcoding <package_name>.h is not good when you writing plugins. I make precompiled "common.h" header with UPP and plugin private headers.


Good points, thanks.

BTW, have you investigated clang?

Mirek
Re: TheIDE precompiled headers: again [message #44150 is a reply to message #44143] Fri, 09 January 2015 06:39 Go to previous message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
Sorry for delay.
mirek wrote on Tue, 06 January 2015 00:49

BTW, have you investigated clang?

No, I have no actual version clang and, therefore, can't test it with UPP.
Clang v3.0 fails to build UPP, and rebuilds all every time.

According clang documentation, there is one difference - ".pch" instead ".gch", and, maybe, "-x c++-header" must be added.

[Updated on: Fri, 09 January 2015 06:40]

Report message to a moderator

Previous Topic: Debugging via ssh
Next Topic: Cannot Compile TheIDE with MSVC12
Goto Forum:
  


Current Time: Thu Mar 28 09:51:33 CET 2024

Total time taken to generate the page: 0.00877 seconds