Ticket #2817 (closed: fixed)
Experiment with Unity Builds
Reported by: | Owen Arnold | Owned by: | Owen Arnold |
---|---|---|---|
Priority: | major | Milestone: | Iteration 28 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Janik Zikovsky |
Description
As project is growing in size, build times getting too long. Affects productivity of developers.
Create an experimental unity build CMake configuration.
Change History
comment:3 Changed 9 years ago by Owen Arnold
- Status changed from accepted to verify
- Resolution set to fixed
Experimental unity build provided. Much faster build times. Further ticket required if this is to be scaled up to all platforms and all projects.
comment:4 Changed 9 years ago by Janik Zikovsky
- Status changed from verify to verifying
- Tester set to Janik Zikovsky
comment:5 Changed 9 years ago by Janik Zikovsky
- Status changed from verifying to closed
This works! I think the improvement is largest for single- or few-core machines because the one big unity source file can only be compiled on one core at a time. On my machine, recompiling a small change took longer because it could not use all 8 cores.
comment:6 Changed 9 years ago by Owen Arnold
The macro enable_unity_builds i.e. enable_unity_build(MDEvents SRC_FILES SRC_UNITY_IGNORE_FILES 5) includes a final argument which specifies the maximum number of *.cpp files to have in each unity build file. In all cases this has been hardcoded to 1000. However, a machine dependent optimum could be found. This would be a trade-off between the use of multiple cores (lots of smaller files) and the bottleneck of high IO. This may go some way towards solving the issues identified by Janik.
(In [10780]) re #2817 Components for unity builds/cmake. Tested on Linux ubuntu 32 and 64 bit. Not yet windows compatible. Build time is half!, would be even quicker with MantidPlot sorted for UnityBuilds.