[CMake] Tips on reducing configure time

Poughon Victor Victor.Poughon at cnes.fr
Wed Nov 14 04:10:27 EST 2018


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




More information about the CMake mailing list