MantisBT - Community
View Issue Details
0028417Community[OCCT] OCCT:Codingpublic2017-01-31 11:072017-09-29 16:28
erossignon 
bugmaster 
normalfeature 
closedfixed 
[OCCT] 7.1.0 
[OCCT] 7.2.0[OCCT] 7.2.0 
Not required
0028417: Using PRECOMPILED HEADER to speed up compilation time
I proposing to use cotire to speed up OpenCascade Compilation time.

My first experiement show that it takes less than 25 minutes to compile allmost all OCCT libraries using such a technique.

see https://github.com/OpenWebCAD/occt_builder [^]
see https://travis-ci.org/OpenWebCAD/occt_builder/jobs/196410242 [^] for linux
and
https://ci.appveyor.com/project/erossignon/occt-builder/branch/master [^] for windows


The change impac the CMakelist.txt files, some addition inside adm , and a few changes located in the code as highlighted in this patch
https://github.com/OpenWebCAD/occt_builder/blob/master/add_cotire_to_7.1.0.patch#L4013 [^]


Fix pushed to CR28417_3, please review
No tags attached.
duplicate of 0027407closed abv Open CASCADE Accelerate OCCT build on Visual Studio by use of precompiled headers 
parent of 0028452closed bugmaster Open CASCADE VIS - MSVC 14 compiler warnings 
parent of 0028838closed bugmaster Open CASCADE Configuration - undefine macros coming from X11 headers in place of collision 
Issue History
2017-01-31 11:07erossignonNew Issue
2017-01-31 11:07erossignonAssigned To => erossignon
2017-01-31 11:10kgvRelationship addedduplicate of 0027407
2017-01-31 11:13kgvNote Added: 0063242
2017-01-31 11:21abvNote Added: 0063244
2017-01-31 13:21erossignonNote Added: 0063252
2017-01-31 18:49abvAssigned Toerossignon => abv
2017-01-31 18:49abvStatusnew => assigned
2017-02-01 08:45gitNote Added: 0063275
2017-02-01 08:52abvNote Added: 0063276
2017-02-01 09:28abvNote Edited: 0063276bug_revision_view_page.php?bugnote_id=63276#r15983
2017-02-01 09:29abvAssigned Toabv => ski
2017-02-01 09:30abvNote Added: 0063277
2017-02-01 17:02amlNote Added: 0063309
2017-02-01 18:20kgvNote Added: 0063315
2017-02-01 23:03kgvNote Added: 0063333
2017-02-01 23:07kgvNote Added: 0063334
2017-02-01 23:12kgvNote Edited: 0063333bug_revision_view_page.php?bugnote_id=63333#r15995
2017-02-01 23:14kgvNote Edited: 0063333bug_revision_view_page.php?bugnote_id=63333#r15996
2017-02-02 09:46kgvNote Edited: 0063333bug_revision_view_page.php?bugnote_id=63333#r15997
2017-02-03 21:41gitNote Added: 0063430
2017-02-03 21:50kgvNote Added: 0063431
2017-02-03 21:50kgvNote Edited: 0063431bug_revision_view_page.php?bugnote_id=63431#r16014
2017-02-03 21:50kgvNote Edited: 0063431bug_revision_view_page.php?bugnote_id=63431#r16015
2017-02-03 21:51kgvNote Edited: 0063334bug_revision_view_page.php?bugnote_id=63334#r16017
2017-02-03 22:27gitNote Added: 0063432
2017-02-04 10:50gitNote Added: 0063437
2017-02-04 11:18gitNote Added: 0063438
2017-02-04 11:28kgvNote Added: 0063439
2017-02-04 13:56gitNote Added: 0063440
2017-02-04 13:56kgvNote Edited: 0063439bug_revision_view_page.php?bugnote_id=63439#r16021
2017-02-04 18:39gitNote Added: 0063441
2017-02-05 11:43gitNote Added: 0063445
2017-02-05 11:58gitNote Added: 0063446
2017-02-06 19:37skiNote Added: 0063466
2017-02-06 19:37skiAssigned Toski => abv
2017-02-06 19:37skiStatusassigned => feedback
2017-02-08 19:41skiNote Added: 0063714
2017-02-08 19:57gitNote Added: 0063715
2017-02-08 19:58kgvNote Added: 0063716
2017-02-09 13:49skiNote Added: 0063729
2017-02-09 14:03abvNote Added: 0063730
2017-02-09 14:03abvAssigned Toabv => ski
2017-02-09 17:14gitNote Added: 0063741
2017-02-11 19:43gitNote Added: 0063761
2017-02-11 19:57gitNote Added: 0063762
2017-02-13 12:16abvNote Added: 0063771
2017-02-16 19:09gitNote Added: 0063856
2017-02-20 18:34gitNote Added: 0063927
2017-02-21 19:05gitNote Added: 0063952
2017-02-27 16:56gitNote Added: 0064014
2017-02-28 12:01gitNote Added: 0064021
2017-02-28 12:18gitNote Added: 0064022
2017-03-06 12:26gitNote Added: 0064140
2017-03-06 16:40abvRelationship addedparent of 0028452
2017-03-24 18:24gitNote Added: 0064695
2017-03-30 11:49skiStatusfeedback => assigned
2017-03-30 11:58gitNote Added: 0064800
2017-03-30 12:11gitNote Added: 0064803
2017-03-30 12:28gitNote Added: 0064807
2017-06-13 08:36kgvRelationship addedparent of 0028838
2017-07-01 08:44gitNote Added: 0067840
2017-07-02 22:57gitNote Added: 0067842
2017-07-02 23:12abvAssigned Toski => kgv
2017-07-02 23:12abvStatusassigned => resolved
2017-07-02 23:12abvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17010#r17010
2017-07-03 07:22kgvNote Added: 0067843
2017-07-03 07:22kgvAssigned Tokgv => bugmaster
2017-07-03 07:22kgvStatusresolved => reviewed
2017-07-03 07:22kgvTarget Version => 7.2.0
2017-07-03 08:40gitNote Added: 0067844
2017-07-03 09:31gitNote Added: 0067921
2017-07-03 09:39abvNote Added: 0067924
2017-07-03 10:02gitNote Added: 0067926
2017-07-03 16:55gitNote Added: 0067950
2017-07-03 17:23bugmasterAssigned Tobugmaster => apv
2017-07-03 17:24bugmasterNote Added: 0067951
2017-07-03 18:22abvNote Added: 0067952
2017-07-03 22:09bugmasterNote Added: 0067957
2017-07-04 11:51apvTest case number => Not needed
2017-07-04 11:54apvNote Added: 0067963
2017-07-04 11:54apvAssigned Toapv => bugmaster
2017-07-04 11:54apvStatusreviewed => tested
2017-07-04 11:55apvTest case numberNot needed => Not required
2017-07-04 11:55apvNote Added: 0067964
2017-07-07 17:25bugmasterChangeset attached => occt master 896faa72
2017-07-07 17:25bugmasterStatustested => verified
2017-07-07 17:25bugmasterResolutionopen => fixed
2017-07-10 08:58gitNote Added: 0068115
2017-07-10 08:58gitNote Added: 0068116
2017-07-10 08:58gitNote Added: 0068117
2017-07-10 08:58gitNote Added: 0068118
2017-09-29 16:18aivFixed in Version => 7.2.0
2017-09-29 16:28aivStatusverified => closed

Notes
(0063242)
kgv   
2017-01-31 11:13   
Dear erossignon,

please use bug 0027407 for discussing precompiled headers feature.
(0063244)
abv   
2017-01-31 11:21   
Hello Etienne,

Can you please indicate what was a level of speed-up in your experiments? What is the workstation and compiler you are using? The time indicated in bug description (25 min) is quite typical for building OCCT on modern workstations out of the box.
(0063252)
erossignon   
2017-01-31 13:21   
The effect is phenomenal on my box and on Travis and Appveyor.
Travis and Appveyor are providing standard VM and without cotire the build (even using -j <numproc>" exceeds an hour and can never finished within the allowed time slot

The compilation time is divided by 2 to 4 at least !
Try it ! and see by yourself
(0063275)
git   
2017-02-01 08:45   
Branch CR28417 has been created by abv.

SHA-1: fefde4787a74671ef7790f0342502a69a08a9915


Detailed log of new commits:

Author: abv
Date: Wed Feb 1 08:45:13 2017 +0300

    Hack: temporarily disable Cotire for TKV3d, TKDraw, and TKService to avoid failures

Author: abv
Date: Wed Feb 1 08:44:23 2017 +0300

    Rename or rearrange some locally defined variables in TKV3d to reduce errors in unity builds

Author: erossignon
Date: Tue Jan 31 21:44:28 2017 +0300

    0028417: Using PRECOMPILED HEADER to speed up compilation time
    
    Use of Cotire tool is introduced for acceleration of CMake builds, via precompiled headers and unity builds.
    
    Code is corrected to avoid conflicts in (some) unity builds.
(0063276)
abv   
2017-02-01 08:52   
(edited on: 2017-02-01 09:28)
Wow! It works! Cotire is great tool, it provides all that we needed (and tried to achieve in 0027407) for accelerating builds via PCH and unity builds. Thank you Etienne for pointing this out!

So far I achieved building on Windows with VS 2015 (with single strange link error in TKDraw due to unresolved symbol -- to be investigated). I had to disable Cotire for TKDraw and TKService (conflicts when using PCH due to symbols defined in Windows and third-party headers), and TKV3d (conflicts in unity build due to local symbols with same names).

The timing on my machine (i7-4790 CPU, system and Visual Studio are on SSD, OCCT code and build on HDD) is:

master (CMake): 37 min
CR28417 (CMake + Cotire): 23 min

(0063277)
abv   
2017-02-01 09:30   
Sergey, please try to build branch CR27407 on Linux (GCC and CLang), to see if it works, and compare build time against master.
(0063309)
aml   
2017-02-01 17:02   
I confirm speedup. I've got the following results on my workstation:

I7-6700k, OS + MSVS 2015 on SSD, occt sources on the HDD.

master: 13.5 min
CR28417: 9.5 min
(0063315)
kgv   
2017-02-01 18:20   
i5-6500, Win10 x64, SSD.
android-ndk-r12 + MinGW-w64, target: armv7a, static libraries:
master:  build 00:25:38 / install 00:06:43
CR28417: build 00:26:28 / install 00:06:42
(0063333)
kgv   
2017-02-01 23:03   
(edited on: 2017-02-02 09:46)
AMD FX-8350, Win7 x64, SSD.
VS2015, target: x64, dynamic libraries:
master:  build 00:14:15 (gen. 00:00:48 / build 00:14:27) / install 00:00:22
CR28417: build 00:11:30 (gen. 00:01:56 / build 00:09:34) / install 00:00:32


i5-6500, Win10 x64, SSD.
VS2015, target: x64, dynamic libraries:
master:  build 00:20:21 (gen. 00:00:55 / build 00:19:16) / install 00:01:02
CR28417: build 00:14:37 (gen. 00:01:48 / build 00:12:49) / install 00:01:08


But not all targets have been build with cotire:
1>     Creating library C:/work/occt/master/occt_cmake/work/wnt-vc14-win64-make/win64/vc14/lib/TKDraw.lib 
and object C:/work/occt/master/occt_cmake/work/wnt-vc14-win64-make/win64/vc14/lib/TKDraw.exp
1>Draw_Commands.obj : error LNK2019: unresolved external symbol "public: bool __cdecl Message_Messenger::AddPrinter(class 
opencascade::handle<class Message_Printer> const &)" (?AddPrinter@Message_Messenger@@QEAA_NAEBV?$handle@VMessage_Printer@@@opencascade@@@Z) 
referenced in function "public: static void __cdecl Draw::Commands(class Draw_Interpretor &)" 
(?Commands@Draw@@SAXAEAVDraw_Interpretor@@@Z)
1>C:\work\occt\master\occt_cmake\work\wnt-vc14-win64-make\win64\vc14\bin\TKDraw.dll : fatal error 
LNK1120: 1 unresolved externals


(0063334)
kgv   
2017-02-01 23:07   
(edited on: 2017-02-03 21:51)
VS2015, cotire pch files increase working (CMake + building) folder from 933 MiB to 2.38 GiB.

(0063430)
git   
2017-02-03 21:41   
Branch CR28417 has been updated by kgv.

SHA-1: 93336c675cb03da55777480f474743b3c57debe0


Detailed log of new commits:

Author: kgv
Date: Fri Feb 3 21:38:30 2017 +0300

    Fixed TKOpenGl compilation with cotire on OS X

(0063431)
kgv   
2017-02-03 21:50   
Core 2 Duo, OS X 10.10, slow HDD.
XCode 6.4, target: x64, dynamic libraries:

master:  build 00:56:59 (gen. 00:00:48 / build 00:56:11) / install 00:01:15
CR28417: build 00:38:10 (gen. 00:02:31 / build 00:35:39) / install 00:01:15

Cotire pch files increase working (CMake + building)
folder from 485 MiB to 823 MiB.

(0063432)
git   
2017-02-03 22:27   
Branch CR28417 has been updated forcibly by kgv.

SHA-1: e4a38aaf87c126b0086b45789e44f694fa49a045
(0063437)
git   
2017-02-04 10:50   
Branch CR28417_1 has been created by abv.

SHA-1: fa32c668ead5eaa63333135788696880b640b66a


Detailed log of new commits:

Author: kgv
Date: Fri Feb 3 23:27:02 2017 +0400

    Fixed TKOpenGl compilation with cotire on OS X

Author: abv
Date: Wed Feb 1 08:45:13 2017 +0300

    Hack: temporarily disable Cotire for TKV3d, TKDraw, and TKService to avoid failures

Author: abv
Date: Wed Feb 1 08:44:23 2017 +0300

    Rename or rearrange some locally defined variables in TKV3d to reduce errors in unity builds

Author: erossignon
Date: Tue Jan 31 21:44:28 2017 +0300

    0028417: Using PRECOMPILED HEADER to speed up compilation time
    
    Use of Cotire tool is introduced for acceleration of CMake builds, via precompiled headers and unity builds.
    
    Code is corrected to avoid conflicts in (some) unity builds.
(0063438)
git   
2017-02-04 11:18   
Branch CR28417 has been updated by kgv.

SHA-1: 06844558758a15b5121d9aea9c954a658e134cd9


Detailed log of new commits:

Author: kgv
Date: Sat Feb 4 12:17:02 2017 +0400

    The macros Status, Convex, Opposite, FillSolid (coming from X11 headers)
    are now undefined in place of definition of methods with same name in OCCT headers.
    The usage of variables with name Status is now avoided.

(0063439)
kgv   
2017-02-04 11:28   
(edited on: 2017-02-04 13:56)
AMD FX-8350, Ubuntu 14.04 x64, SSD.
gcc 4.8.2, target: x64, dynamic libraries:

master:  build 00:17:07  (gen. 00:00:52 / build 00:16:15) / install 00:00:29
CR28417: build 00:15:02  (gen. 00:02:17 / build 00:12:45) / install 00:00:29


Cotire pch files increase working (CMake + building)
folder from 554 MiB to 1.9 GiB.

(0063440)
git   
2017-02-04 13:56   
Branch CR28417 has been updated by kgv.

SHA-1: 44dc33b8acf14a2cc556dbfdb2978b16c1dde15c


Detailed log of new commits:

Author: kgv
Date: Sat Feb 4 13:55:42 2017 +0300

    The macros AddPrinter (coming from WinAPI headers) is now undefined
    within Message_Messenger class definition having method with the same name.

(0063441)
git   
2017-02-04 18:39   
Branch CR28417_1 has been updated by abv.

SHA-1: de04dcf0f3eb778818260c01af710a44a0389138


Detailed log of new commits:

Author: abv
Date: Sat Feb 4 17:47:01 2017 +0300

    Adaptations for building TKDraw and TKV3d with cotire (PCH only) on Windows
    
    Remove useless header WNT_UInt.hxx
    Avoid usage of local variable conflicting with X11 macro in Draw_Viewer.cxx
    Rename local variables in AIS_ConcentricRelation.cxx to avoid conflict with macros defined in windows.h

Author: kgv
Date: Sat Feb 4 13:55:42 2017 +0300

    The macros AddPrinter (coming from WinAPI headers) is now undefined
    within Message_Messenger class definition having method with the same name.

Author: kgv
Date: Sat Feb 4 12:17:02 2017 +0400

    The macros Status, Convex, Opposite, FillSolid (coming from X11 headers)
    are now undefined in place of definition of methods with same name in OCCT headers.
    The usage of variables with name Status is now avoided.

(0063445)
git   
2017-02-05 11:43   
Branch CR28417_1 has been updated by abv.

SHA-1: edf32834e52fafbd75f355e4433bf9245425f542


Detailed log of new commits:

Author: abv
Date: Sun Feb 5 11:43:04 2017 +0300

    Add CMake option BUILD_USE_PCH to enable / disable use of precompiled headers

Author: abv
Date: Sun Feb 5 11:41:35 2017 +0300

    Remove useless pragmas disabling warnings on MSVC

(0063446)
git   
2017-02-05 11:58   
Branch CR28417_1 has been updated by abv.

SHA-1: 764a8c2532af1d36fe3d150c5a4a7ef411db9932


Detailed log of new commits:

Author: abv
Date: Sun Feb 5 11:58:03 2017 +0300

    // minor correction

(0063466)
ski   
2017-02-06 19:37   
I have tried to build branch CR28417_1 on Debian70-64 (gcc (Debian 4.7.2-5) 4.7.2) using virtual machine (we use it for certification) and on local station (via cygwin) with next results:

Error appears:
occt/src/NCollection/NCollection_HeapAllocator.cxx: In member function 'virtual void* NCollection_HeapAllocator::Allocate(Standard_Size)':
occt/src/NCollection/NCollection_HeapAllocator.cxx:36:46: error: expected ')' before 'PRIuPTR'

After that i have tried to build the branch on virtual machine with Ubuntu 1604-64. Compilation was successfully finished with next time results:
master: build 00:42:17
CR28417_1: build 00:31:01
(0063714)
ski   
2017-02-08 19:41   
The reason of such behavior on our Debian stations is that file
occt\build\src\TKernel\cotire\TKernel_CXX_prefix.cxx
contains including of header file /usr/include/inttypes.h

Header file inttypes.h defines PRIuPTR only in case:
#if !defined __cplusplus || defined __STD_FORMAT_MACROS
__cplusplus is defined, but __STD_FORMAT_MACROS seems to be not defined

Header file inttypes.h can be included only once.

In case of usual build without pch file occt\src\Standard\Standard_TypeDef.hxx contains next lines:
  #ifndef __STDC_FORMAT_MACROS
    #define __STDC_FORMAT_MACROS
  #endif
  #include <inttypes.h>
  
So, PRIuPTR is defined here.

In case of virtual machine with Ubuntu1604 header file inttypes.h does not have such condition:
#if !defined __cplusplus || defined __STD_FORMAT_MACROS
(0063715)
git   
2017-02-08 19:57   
Branch CR28417_1 has been updated by kgv.

SHA-1: 38bb5db2c7789cd52d84fa81a30cb3f683ae0224


Detailed log of new commits:

Author: kgv
Date: Wed Feb 8 19:57:31 2017 +0300

    Workaround bug in headers within old gcc versions

(0063716)
kgv   
2017-02-08 19:58   
Try updated patch then.
(0063729)
ski   
2017-02-09 13:49   
Dear kgv,

i think it should be
add_definitions("-D__STDC_FORMAT_MACROS")
instead of
add_definitions("__STDC_FORMAT_MACROS")

With this patch all is OK on our Debian70-64 stations
master: build 00:19:28
CR28417_1: build 00:16:04
(0063730)
abv   
2017-02-09 14:03   
I propose that all additional pre-processor definitions needed for building with PCH should be defined in one place and only when needed (i.e. when BUILD_USE_PCH is defined, and if reasonable, for relevant platform / compiler version etc.). Sergey, can you do this?
(0063741)
git   
2017-02-09 17:14   
Branch CR28417_1 has been updated by ski.

SHA-1: 44f8bb6e7d7a3cd1ae946725190fd90aaa30d68b


Detailed log of new commits:

Author: ski
Date: Thu Feb 9 17:14:44 2017 +0300

    Corrected adding of __STDC_FORMAT_MACROS definition.
    All additional pre-processor definitions needed for building with PCH are defined only when needed.

(0063761)
git   
2017-02-11 19:43   
Branch CR28417_1 has been updated by abv.

SHA-1: fdd154126c71248b6d831e2c6166e70b3496d9ed


Detailed log of new commits:

Author: abv
Date: Sat Feb 11 19:43:12 2017 +0300

    Define macro STRSAFE_NO_DEPRECATE on Windows to prevent declaring functions of standard C library as deprecated by #pragma

Author: abv
Date: Sat Feb 11 09:16:31 2017 +0300

    Add option BUILD_USE_PCH_TOTAL to allow inclusion of OCCT own headers in PCH
    
    Cotire tuned to put windows.h first in PCH files to reduce conflicts

Author: abv
Date: Sat Feb 11 09:15:32 2017 +0300

    Undefine CurrentDirectory macro in OSD_Process.hxx to avoid conflict due to possible previous inclusion of windows.h

Author: abv
Date: Sat Feb 11 01:34:22 2017 +0300

    Remove duplicate definitions of global symbols causing conflicts when building with PCH; HXX files containing code are renamed to PXX or merged with corresponding CXX files.

(0063762)
git   
2017-02-11 19:57   
Branch CR28417_1 has been updated by abv.

SHA-1: 4a0169a180a476d31d25624b885377d7bf749f4b


Detailed log of new commits:

Author: abv
Date: Sat Feb 11 19:57:10 2017 +0300

    lost file

(0063771)
abv   
2017-02-13 12:16   
I have experimenting with PCH trying to put all headers in it (i.e. including own OCCT ones, like OCE do). For that, separate (temporary) option BUILD_USE_PCH_TOTAL is added. For VS 2015 and 2010, the build time is reduced from 13 min to 9 min; on Ubuntu build failed in my environment due to insufficient disk space. The size of build dir increased till 4.5 Gb.
(0063856)
git   
2017-02-16 19:09   
Branch CR28417_1 has been updated by ski.

SHA-1: dd3dc8cb8c65fe376acc4106fa54251acabae1bf


Detailed log of new commits:

Author: ski
Date: Wed Feb 15 16:49:23 2017 +0300

    Fixed compile error about the order of strsafe.h and tchar.h header files

(0063927)
git   
2017-02-20 18:34   
Branch CR28417_1 has been updated forcibly by ski.

SHA-1: 07cb408533ef43706d9b80ba1088847a6b674223
(0063952)
git   
2017-02-21 19:05   
Branch CR28417_1 has been updated forcibly by ski.

SHA-1: 585236cc25f7192550961901e8f6c4216cf9c1fb
(0064014)
git   
2017-02-27 16:56   
Branch CR28417_1 has been updated by ski.

SHA-1: 9fab3ae915d346417e8c6c4343725de4ffe3a7a1


Detailed log of new commits:

Author: ski
Date: Mon Feb 27 16:56:11 2017 +0300

    Fix compilation error for Debug configuration

(0064021)
git   
2017-02-28 12:01   
Branch CR28417_1 has been updated forcibly by ski.

SHA-1: ce7d07430a76607f991be667d496ac2f14c92862
(0064022)
git   
2017-02-28 12:18   
Branch CR28417_1 has been updated by ski.

SHA-1: 394f59876cf3f1a911b45dd916bab504eb0d7372


Detailed log of new commits:

Author: ski
Date: Mon Feb 27 16:56:11 2017 +0300

    Fix compilation error for products samples.

(0064140)
git   
2017-03-06 12:26   
Branch CR28417_2 has been created by ski.

SHA-1: b1cf74a32b05867e562c65d133337349d412d884


Detailed log of new commits:

Author: ski
Date: Wed Feb 15 16:49:23 2017 +0300

    Fixed compile error about the order of strsafe.h and tchar.h header files
    Do not use Cotire tool in TKIVtkDraw toolkit.
    Fix compilation error for Debug configuration
    Fix compilation error for products samples.

Author: abv
Date: Sat Feb 11 19:57:10 2017 +0300

    lost file

Author: abv
Date: Sat Feb 11 19:43:12 2017 +0300

    Define macro STRSAFE_NO_DEPRECATE on Windows to prevent declaring functions of standard C library as deprecated by #pragma

Author: abv
Date: Sat Feb 11 09:16:31 2017 +0300

    Add option BUILD_USE_PCH_TOTAL to allow inclusion of OCCT own headers in PCH
    
    Cotire tuned to put windows.h first in PCH files to reduce conflicts

Author: abv
Date: Sat Feb 11 01:34:22 2017 +0300

    Remove duplicate definitions of global symbols causing conflicts when building with PCH; HXX files containing code are renamed to PXX or merged with corresponding CXX files.

Author: abv
Date: Sat Feb 11 09:15:32 2017 +0300

    Undefine CurrentDirectory macro in OSD_Process.hxx to avoid conflict due to possible previous inclusion of windows.h

Author: ski
Date: Thu Feb 9 17:14:44 2017 +0300

    Corrected adding of __STDC_FORMAT_MACROS definition.
    All additional pre-processor definitions needed for building with PCH are defined only when needed.

Author: kgv
Date: Wed Feb 8 19:57:31 2017 +0300

    Workaround bug in headers within old gcc versions

Author: abv
Date: Sun Feb 5 11:58:03 2017 +0300

    // minor correction

Author: abv
Date: Sun Feb 5 11:43:04 2017 +0300

    Add CMake option BUILD_USE_PCH to enable / disable use of precompiled headers

Author: abv
Date: Sun Feb 5 11:41:35 2017 +0300

    Remove useless pragmas disabling warnings on MSVC

Author: abv
Date: Sat Feb 4 17:47:01 2017 +0300

    Adaptations for building TKDraw and TKV3d with cotire (PCH only) on Windows
    
    Remove useless header WNT_UInt.hxx
    Avoid usage of local variable conflicting with X11 macro in Draw_Viewer.cxx
    Rename local variables in AIS_ConcentricRelation.cxx to avoid conflict with macros defined in windows.h

Author: kgv
Date: Sat Feb 4 13:55:42 2017 +0300

    The macros AddPrinter (coming from WinAPI headers) is now undefined
    within Message_Messenger class definition having method with the same name.

Author: kgv
Date: Sat Feb 4 12:17:02 2017 +0400

    The macros Status, Convex, Opposite, FillSolid (coming from X11 headers)
    are now undefined in place of definition of methods with same name in OCCT headers.
    The usage of variables with name Status is now avoided.

Author: kgv
Date: Fri Feb 3 23:27:02 2017 +0400

    Fixed TKOpenGl compilation with cotire on OS X

Author: abv
Date: Wed Feb 1 08:45:13 2017 +0300

    Hack: temporarily disable Cotire for TKV3d, TKDraw, and TKService to avoid failures

Author: erossignon
Date: Tue Jan 31 21:44:28 2017 +0300

    0028417: Using PRECOMPILED HEADER to speed up compilation time
    
    Use of Cotire tool is introduced for acceleration of CMake builds, via precompiled headers and unity builds.
    
    Code is corrected to avoid conflicts in (some) unity builds.

Author: abv
Date: Wed Feb 1 08:44:23 2017 +0300

    Rename or rearrange some locally defined variables in TKV3d to reduce errors in unity builds
(0064695)
git   
2017-03-24 18:24   
Branch CR28417_2 has been updated forcibly by ski.

SHA-1: 9978f6889e550f918456a9264112611cfbf3b9f6
(0064800)
git   
2017-03-30 11:58   
Branch CR28417_2 has been updated by ski.

SHA-1: b21c8552e04a8fa6a8ae13aae12466e632e2a2f4


Detailed log of new commits:

Author: ski
Date: Wed Mar 29 17:07:36 2017 +0300

    Suppress GCC warning -Wclobbered for pch build.

(0064803)
git   
2017-03-30 12:11   
Branch CR28417_2 has been updated forcibly by ski.

SHA-1: dc7e4be67aaeede779069850f5da298c4367392e
(0064807)
git   
2017-03-30 12:28   
Branch CR28417_2 has been updated forcibly by ski.

SHA-1: a6cf3f8911ad7412c7d181947714fe6d0ad0610f
(0067840)
git   
2017-07-01 08:44   
Branch CR28417_3 has been created by abv.

SHA-1: 99d74069d27dd11c5de6cef2b6f9b0284adc36fd


Detailed log of new commits:

Author: abv
Date: Thu Jun 29 20:17:39 2017 +0300

    0028417: Using PRECOMPILED HEADER to speed up compilation time
    
    Use of Cotire tool is introduced for acceleration of CMake builds, by usage of precompiled headers.
    CMake option BUILD_USE_PCH is added to enable / disable use of precompiled headers
    
    When precompiled headers are used, additional compiler macros are defined globally in the build system to avoid problems due to different order of included files:
    - NOMINMAX is defined on Windows to prevent defining "min" and "max" as macros by windows.h
    - STRSAFE_NO_DEPRECATE and _SCL_SECURE_NO_WARNINGS are defined on Windows to prevent declaring functions of standard C library as deprecated by #pragma, and other warnings in system headers
    - GL_GLEXT_LEGACY and GLX_GLEXT_LEGACY are defined to ensure that only OCCT's own glext.h is used
    - __STDC_FORMAT_MACROS is defined to have standard C print format macros always defined
    
    Code is corrected to avoid conflicts with system headers and in case of compiling together as unity builds (partially):
    - Some locally defined variables in TKV3d, TKHLR are renamed to be unique
    - Duplicated definitions of macros and global functions are eliminated in TKSTEP
    - Useless header WNT_UInt.hxx is removed
    - Usage of local variables conflicting with X11 macro is avoided in Draw_Viewer.cxx
    - Local variables in AIS_ConcentricRelation.cxx are renamed to avoid conflict with macros defined in windows.h
    - HXX files containing code are renamed to PXX or merged with corresponding CXX files.
    
    IVtkTools classes are corrected to avoid compiler warnings disabled in non-PCH builds by inclusion of VTK headers.
    
    Useless pragmas disabling warnings on MSVC are removed
(0067842)
git   
2017-07-02 22:57   
Branch CR28417_3 has been updated forcibly by abv.

SHA-1: e160f9ffa83afe7ae89758ea0576100db218cce3
(0067843)
kgv   
2017-07-03 07:22   
Please test the patch.

-#define STRICT
+//#define STRICT
 #include <windows.h>

I'm not sure it makes sense keeping this define commented in several places - better removing it.
(0067844)
git   
2017-07-03 08:40   
Branch CR28417_3 has been updated by abv.

SHA-1: 7a03939476b5e33cc086592f7cd610a5d0f24751


Detailed log of new commits:

Author: abv
Date: Mon Jul 3 08:40:06 2017 +0300

    # corrected according to review remark

(0067921)
git   
2017-07-03 09:31   
Branch CR28417_3 has been updated by abv.

SHA-1: be6318d52b69750c7e90ccfb99ebd6ac1fb0ffaa


Detailed log of new commits:

Author: abv
Date: Mon Jul 3 09:23:23 2017 +0300

    # fix compiler warning in mm files on MacOS

(0067924)
abv   
2017-07-03 09:39   
For testing, please use branch CR28417 in products.

Before testing, please remove CMake command options BUILD_USE_PCH and BUILD_USE_PCH_TOTAL in Jenkins job: for certification, we need to test with default setting!
(0067926)
git   
2017-07-03 10:02   
Branch CR28417_3 has been updated by abv.

SHA-1: fbc7e93bde8627eabdc8bb7875754b1c9ff975e3


Detailed log of new commits:

Author: abv
Date: Mon Jul 3 10:02:33 2017 +0300

    # macro SetForm defined by windows.h is undefined where this name is used for a class method

(0067950)
git   
2017-07-03 16:55   
Branch CR28417_3 has been updated by abv.

SHA-1: 6aee7feb2e9ab6ae45b6c4ade0cf8aa8e393c55e


Detailed log of new commits:

Author: abv
Date: Mon Jul 3 16:54:50 2017 +0300

    # correction of arguments of constructor of the class WNT_WClass to be usable from C# without extra casts

(0067951)
bugmaster   
2017-07-03 17:24   
Alexey,

ABV asked me to remove BUILD_USE_PCH and BUILD_USE_PCH_TOTAL cmake definitions at all. So you can launch testing on jenkins-test-09.
(0067952)
abv   
2017-07-03 18:22   
Note that I have just passed through Jenkins compilation and build on standard platforms with current setting of BUILD_USE_PCH=1, and everything seems to build fine, but do not give any noticeable performance benefit (see CR28417_3_PCH-master-abv). Thus it remains to run full testing in non-PCH mode. Please remove builds remaining in CR28417_3_PCH-master-abv as soon as you do not need them -- I guess they occupy a lot of disk space.
(0067957)
bugmaster   
2017-07-03 22:09   
Alexey,

I removed CR28417_3_PCH-master-abv from jenkins-test-10.
Please start certification on from jenkins-test-09
(0067963)
apv   
2017-07-04 11:54   
Dear BugMaster,

Branch CR28417_3 from occt git-repository (and CR28417 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 6aee7feb2e9ab6ae45b6c4ade0cf8aa8e393c55e
SHA-1: bd93a77fc47f8a25d74401b2f080cb9568450301

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 64
   Windows: 0
   MacOS: 1215

Regressions/Differences:
Not detected

Testing cases:
Not required

Testing on Linux:
occt component:
Total MEMORY difference: 92556987 / 92186209 [+0.40%]
Total CPU difference: 18924.47000000016 / 18926.030000000348 [-0.01%]
products component:
Total MEMORY difference: 37679293 / 37533520 [+0.39%]
Total CPU difference: 6379.100000000064 / 6405.870000000062 [-0.42%]

Testing on Windows:
occt component:
Total MEMORY difference: 58848312 / 58850236 [-0.00%]
Total CPU difference: 17457.74430789863 / 17597.770805498705 [-0.80%]
products component:
Total MEMORY difference: 27836531 / 27837358 [-0.00%]
Total CPU difference: 6516.879374600079 / 6587.376226500077 [-1.07%]
(0067964)
apv   
2017-07-04 11:55   
Dear BugMaster,

Please integrate branch CR28417_3 into the occt git-repository master.
Please integrate branch CR28417 into the products git-repository master.
(0068115)
git   
2017-07-10 08:58   
Branch CR28417 has been deleted by kgv.

SHA-1: 44dc33b8acf14a2cc556dbfdb2978b16c1dde15c
(0068116)
git   
2017-07-10 08:58   
Branch CR28417_1 has been deleted by kgv.

SHA-1: 394f59876cf3f1a911b45dd916bab504eb0d7372
(0068117)
git   
2017-07-10 08:58   
Branch CR28417_2 has been deleted by kgv.

SHA-1: a6cf3f8911ad7412c7d181947714fe6d0ad0610f
(0068118)
git   
2017-07-10 08:58   
Branch CR28417_3 has been deleted by kgv.

SHA-1: 6aee7feb2e9ab6ae45b6c4ade0cf8aa8e393c55e