<div dir="ltr"><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">As one ballpark datapoint: a "superbuild" of 3D Slicer (<a href="http://slicer.org">slicer.org</a>) has a similar object and library count:</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">macbook-pro:s5nj inorton$ find ./ -name *.o | wc -l<br>   14127</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">macbook-pro:s5nj inorton$ find ./ -name *.dylib -or -name *.so | wc -l<br>    2158</blockquote></span></div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Based on a few quick tests, the aggregate cmake time is probably about 6-8 minutes for the ninja generator, over the multi-hour build (each dependency is configured and built as a separate sub-project via CMake's ExternalProject mechanism) -- with the caveat that each of those cmake runs is doing lengthy checks that should only be done once if your project strictly uses `add_subdirectory`.</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div>As a more concrete point of comparison, building VTK generates 5747 object files, and a clean configure on my 2-core macbook takes about 90s.</div><div><div><br></div></div><div>Isaiah</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 4, 2018 at 2:16 PM, Patrick E Gartung <span dir="ltr"><<a href="mailto:gartung@fnal.gov" target="_blank">gartung@fnal.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just to be clear, the memory and time used are just to configure and generate the makefiles or Ninja file. The build itself can take several hours.<br>
<div class="HOEnZb"><div class="h5"><br>
On 4/30/18, 4:55 PM, "R0b0t1" <<a href="mailto:r030t1@gmail.com">r030t1@gmail.com</a>> wrote:<br>
<br>
    On Mon, Apr 30, 2018 at 4:44 PM, Patrick E Gartung <<a href="mailto:gartung@fnal.gov">gartung@fnal.gov</a>> wrote:<br>
    >  Hi,<br>
    ><br>
    > We have a large c/c++/fortran project, CMSSW, that is built with a custom tool, scram. <br>
    ><br>
    > <a href="https://github.com/cms-sw/cmssw" rel="noreferrer" target="_blank">https://github.com/cms-sw/<wbr>cmssw</a><br>
    ><br>
    > The project might move to a cmake based build in the future. The scripts to convert to CmakeLists.tx has been written<br>
    ><br>
    > <a href="https://github.com/cms-sw/cmssw2cmake" rel="noreferrer" target="_blank">https://github.com/cms-sw/<wbr>cmssw2cmake</a><br>
    ><br>
    > 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.<br>
    ><br>
    > The project builds 14k object files, 2.2k libraries, ~600 binaries, 500 generated source files with links to ~100 external libraries.<br>
    ><br>
    > Is this amount of memory usage and time typical for a project of this size?<br>
    ><br>
<br>
    I'm inclined to say "yes" as many builds such as Firefox, its<br>
    supporting libraries, and Chrome all take lots of time and memory.<br>
    Chrome uses Ninja, I might add. But the issue is not CMake itself.<br>
    CMake tends to produce better builds.<br>
<br>
    As I am not intimately familiar with your project, I can't make good<br>
    concrete suggestions. You may enjoy reading<br>
    <a href="https://news.ycombinator.com/item?id=14733829" rel="noreferrer" target="_blank">https://news.ycombinator.com/<wbr>item?id=14733829</a> and searching for build<br>
    optimization strategies.<br>
<br>
    Keep in mind a lot of the blame falls on C++ and Windows, should you<br>
    be using Windows. If you aren't using Windows, then the advice in the<br>
    comments above should still be relevant, and give you something to go<br>
    on.<br>
<br>
    Cheers,<br>
         R0b0t1<br>
<br>
    > Patrick Gartung<br>
    > Fermilab<br>
    ><br>
<br>
</div></div><br>-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
<br></blockquote></div><br></div>