<div dir="ltr">Hey Chris,<br><br>Sedat was asking for a way to "to speedup my build" and those blog posts were really helpful to me.<br>Anyway LLVM_DISTRIBUTION_COMPONENTS sounds very cool, hope you will push your code soon!</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 1, 2016 at 11:32 PM, Chris Bieneman <span dir="ltr"><<a href="mailto:cbieneman@apple.com" target="_blank">cbieneman@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Fabio, the work I was mentioning here is an extension beyond those blog posts.<br><div><br></div><div>Some details:</div><div><br></div><div>* The “almost 40%” number I referred to is a multi-stage clang build. That means we build a host-capable compiler, then build the actual compiler we want to ship.</div><div>* I’m at Apple, so points 1 and 2 are already covered (we only use clang, and ld64 is a fast linker).</div><div>* Our system compiler is PGO+LTO’d, but our stage1 isn’t. Stage1 isn’t because the performance improvement of PGO+LTO is less than the time it takes to build, and stage1 is basically a throwaway.</div><div>* We are using Ninja and CMake, but this configuration isn’t really significantly faster than autoconf/make, and actually “ninja install” is slower in my tests than the old autoconf “make install”. The slowdown is almost entirely due to Ninja’s “all” target being a lot bigger.</div><div>* This performance is for clean builds, not incremental so ccache or shared libraries would not be a valid optimization</div><div>* We do use optimized tablegen</div><div>* “Build Less” is exactly what the LLVM_DISTRIBUTION_COMPONENTS enables, just in a friendly wrapper target.</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">-Chris</font></span><div><div class="h5"><br><div><div><br></div><div><br><div><blockquote type="cite"><div>On Mar 1, 2016, at 1:12 PM, Fabio Pagani <<a href="mailto:pagabuc@gmail.com" target="_blank">pagabuc@gmail.com</a>> wrote:</div><br><div><div dir="ltr">For faster builds and rebuilds you should definitely read:<br><a href="https://blogs.s-osg.org/an-introduction-to-accelerating-your-build-with-clang/" target="_blank">https://blogs.s-osg.org/an-introduction-to-accelerating-your-build-with-clang/</a><br><a href="https://blogs.s-osg.org/a-conclusion-to-accelerating-your-build-with-clang/" target="_blank">https://blogs.s-osg.org/a-conclusion-to-accelerating-your-build-with-clang/</a><br><br>Hope this helps! </div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 1, 2016 at 9:17 PM, ChrisBieneman via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
<br>
> On Mar 1, 2016, at 10:01 AM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>> wrote:<br>
><br>
><br>
>> On Mar 1, 2016, at 9:57 AM, Chris Bieneman <<a href="mailto:cbieneman@apple.com" target="_blank">cbieneman@apple.com</a>> wrote:<br>
>><br>
>> There are a few notes I'd like to add to this thread.<br>
>><br>
>> (1) we have a number of places throughout out CMake build where we use features from newer CMakes gated by version checks. Most of these features are performance or usability related. None of them are correctness. Using the latest CMake release will often result in faster builds, so I encourage it.<br>
>><br>
>> (2) CMake's "install" target will pretty much always be slower from clean than the old autoconf/make "install" target. This is because in CMake "install" depends on "all", and our CMake builds more stuff in "all" than autoconf did. To help with this or CMake system has lots of convenient "install-${name}" targets that support component-based installation. Not every component has one of these rules, but if one you need is missing let me know. I also recently (r261681) added a new option (LLVM_DISTRIBUTION_COMPONENTS) that allows you to specify a list of components that have custom install targets. It then creates a new "install-distribution" target that wraps just the components you want. For Apple this is almost a 40% speed up over "ninja install".<br>
><br>
> That sounds great, I want to use it!<br>
> It would even be more awesome with an description/example in docs/CMake.rst :)<br>
<br>
</span>Once I get the last of the kinks worked out for our internal adoption I'm going to open source our config files that use it.<br>
<br>
I've also made a note to remind myself to document it in docs/CMake.rst. I need to do a pass updating that with a bunch of the cool new things we're doing with CMake. Thanks for the reminder.<br>
<span><font color="#888888"><br>
-Chris<br>
</font></span><div><div><br>
><br>
> --<br>
> Mehdi<br>
>><br>
>> On Feb 25, 2016, at 11:08 AM, Sedat Dilek via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>>>> Which combination of cmake/ninja versions are you using (latest are<br>
>>>> v3.4.3 and v1.6.0)?<br>
>>><br>
>>> With this combination I could reduce build-time down from approx. 3h<br>
>>> down to 01h20m.<br>
>>><br>
>>> $ egrep -i 'jobs|ninja' llvm-build/CMakeCache.txt<br>
>>> //Program used to build from build.ninja files.<br>
>>> CMAKE_MAKE_PROGRAM:FILEPATH=/opt/cmake/bin/ninja<br>
>>> //Define the maximum number of concurrent compilation jobs.<br>
>>> LLVM_PARALLEL_COMPILE_JOBS:STRING=3<br>
>>> //Define the maximum number of concurrent link jobs.<br>
>>> LLVM_PARALLEL_LINK_JOBS:STRING=1<br>
>>> CMAKE_GENERATOR:INTERNAL=Ninja<br>
>>><br>
>>> $ LC_ALL=C ls -alt logs/3.8.0rc3_clang-3-8-0-rc3_cmake-3-4-3_ninja-1-6-0/<br>
>>> total 360<br>
>>> drwxr-xr-x 2 wearefam wearefam 4096 Feb 25 19:58 .<br>
>>> drwxr-xr-x 6 wearefam wearefam 4096 Feb 25 19:58 ..<br>
>>> -rw-r--r-- 1 wearefam wearefam 130196 Feb 25 19:54<br>
>>> install-log_llvm-toolchain-3.8.0rc3.txt<br>
>>> -rw-r--r-- 1 wearefam wearefam 205762 Feb 25 19:51<br>
>>> build-log_llvm-toolchain-3.8.0rc3.txt<br>
>>> -rw-r--r-- 1 wearefam wearefam 14331 Feb 25 18:30<br>
>>> configure-log_llvm-toolchain-3.8.0rc3.txt<br>
>>><br>
>>> $ LC_ALL=C du -s -m llvm* /opt/llvm-toolchain-3.8.0rc3<br>
>>> 315 llvm<br>
>>> 941 llvm-build<br>
>>> 609 /opt/llvm-toolchain-3.8.0rc3<br>
>>><br>
>>> - Sedat -<br>
>>><br>
>>> [1] <a href="https://cmake.org/files/v3.5/cmake-3.5.0-rc3-Linux-x86_64.tar.gz" rel="noreferrer" target="_blank">https://cmake.org/files/v3.5/cmake-3.5.0-rc3-Linux-x86_64.tar.gz</a><br>
>>> _______________________________________________<br>
>>> LLVM Developers mailing list<br>
>>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></div></div></blockquote></div><br></div>