Compilation times
A rebuild of the full solutions can be as long as 10 mins, depending on the configuration. A few tricks can be used to reduce build times.
- Unity build: Cmake offers an option to batch source files to reduce the number of files for faster compilation. This is used on some build servers and on some development workstations.
- Caching using
buildcache
. When GitHub actions was introduced, there was a need to have a build cache working for both Linux and Windows. At that time,buildcache
was the only option for one crossplatform tool.buildcache
caching is now used on ResInsight GitHub Actions. - Recent deveopment has now made
ccache
easily available on Windows. The speedup in compilation time can be quite impressive. A complete rebuild of the ResInsight solution takes 1.10 on one workstation.
Configuration and use of ccache (Windows)
- Download and install ccache https://ccache.dev/download.html
- In the
ResInsight
CMake defines, set the full path to theccache.exe
for the define “ccache_exe” - Make sure that all
CXX_*
compiler flags use/Z7
instead of/Zi
. If/Zi
is used, ccache will not work. - To see where your cache is located on your system, use the
ccache -p