[CMake] Memory usage and configuration time for large project

R0b0t1 r030t1 at gmail.com
Mon Apr 30 17:55:44 EDT 2018


On Mon, Apr 30, 2018 at 4:44 PM, Patrick E Gartung <gartung at fnal.gov> wrote:
>  Hi,
>
> We have a large c/c++/fortran project, CMSSW, that is built with a custom tool, scram. 
>
> https://github.com/cms-sw/cmssw
>
> The project might move to a cmake based build in the future. The scripts to convert to CmakeLists.tx has been written
>
> https://github.com/cms-sw/cmssw2cmake
>
> Tests show that with the cmake files generated with this script, configuring the project uses up to 1.5GB of ram and takes 11 minutes when using -GMakefiles. Using -GNinja and using the latest cmake, this time can be reduced to 8 minutes.
>
> The project builds 14k object files, 2.2k libraries, ~600 binaries, 500 generated source files with links to ~100 external libraries.
>
> Is this amount of memory usage and time typical for a project of this size?
>

I'm inclined to say "yes" as many builds such as Firefox, its
supporting libraries, and Chrome all take lots of time and memory.
Chrome uses Ninja, I might add. But the issue is not CMake itself.
CMake tends to produce better builds.

As I am not intimately familiar with your project, I can't make good
concrete suggestions. You may enjoy reading
https://news.ycombinator.com/item?id=14733829 and searching for build
optimization strategies.

Keep in mind a lot of the blame falls on C++ and Windows, should you
be using Windows. If you aren't using Windows, then the advice in the
comments above should still be relevant, and give you something to go
on.

Cheers,
     R0b0t1

> Patrick Gartung
> Fermilab
>


More information about the CMake mailing list