[CMake] Tips on reducing configure time

Cristian Adam cristian.adam at gmail.com
Wed Nov 14 05:16:58 EST 2018


On Wed, Nov 14, 2018 at 10:20 AM Poughon Victor <Victor.Poughon at cnes.fr>
wrote:

> Hi all
>
> I am working on a large C++ project using CMake (
> https://www.orfeo-toolbox.org/) and our 'configure' step takes quite a
> lot of time. This can be annoying for developers working on features where
> the configure step needs to be re-run, or for CI in general.
>
> We have looked into it a bit and it seems like one issue is that the
> configure/generate steps do a lot of small files I/O. Specifically, using:
>
>     inotofy-wait -mr <build_dir>
>
> shows that "cmake ." causes about 150K file access/modify, etc. There are
> some especially guilty looking files like 'Makefile2.tmp' or 'progress.tmp'
> that appear thousands of times in most of the log file.
>
> I have an SSD which somewhat helps, but for colleagues still on mechanical
> drives this is especially painful. Is there a way to disable writing all
> those files to the disk?
>
> Any other tips on optimizing the performance of 'cmake .'?
>
> Thanks,
>
> Victor Poughon
>
>
Hi,

if a subsequent CMake  run is faster than the initial one, you can have a
look at
https://github.com/cristianadam/cmake-checks-cache

If you cache the results of the configure checks you can have the initial
run as fast as subsequent ones!

Cheers,
Cristian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181114/bdb69745/attachment-0001.html>


More information about the CMake mailing list