[llvm-dev] [help] How to speed up compilation?

Sunghyun Park via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 18 21:16:04 PDT 2016


Thank you, all!
I switch to use ninja with gold and shared library, and also put the memory
limitation.
Now the compilation is as nimble as Ninja!!
Full-build(build after clean) now takes about 40 min, which is MUCH better
than freezing!
Awesome!

Again, appreciate all your helps!

On Tue, Oct 18, 2016 at 2:21 PM, Bruce Hoult <bruce at hoult.org> wrote:

> cmake should be a lot faster, especially using ninja instead of makefiles,
> because it can run the maximum number of jobs to keep all the cores busy
> more of the time.
>
> The problem looks like with eight cores (and therefore 8 parallel jobs)
> and only 8 GB of RAM, you don't have enough RAM for the number of cores, so
> you'll be using swap a lot. That's mostly true for linking. c++ build steps
> don't use all that much RAM.
>
> On Tue, Oct 18, 2016 at 8:25 PM, Sunghyun Park via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> I'm adding feature to detect customized pragma and mark those region in
>> LLVM IR using Metadata. I want to let programmer give additional directives
>> to compiler.
>> So I put some functions, variables, and 'cout' on clang.
>>
>> So, based on my understanding on your comment, it may be natural to have
>> long compilation time.
>> My machine has Intel Xeon(R) CPU E31230 @ 3.20GHz * 8 with 8GM RAM, which
>> is far behind the recommended build environment ( Intel Core i7-4770K CPU @
>> 3.50Hz, 16 GM RAM, and a 1TB 7200RPM HDD or SSD, ref :
>> https://blogs.s-osg.org/an-introduction-to-accelerating-your
>> -build-with-clang/ )
>> Do you think it would be great help if I upgrade my machine?
>> I've wanted to upgrade it at some point, but I haven't find right excuse
>> to tell my boss. haha
>>
>> Thank you so much!
>>
>> On Tue, Oct 18, 2016 at 1:08 PM, Renato Golin <renato.golin at linaro.org>
>> wrote:
>>
>>> On 18 October 2016 at 17:56, Sunghyun Park <sunggg at umich.edu> wrote:
>>> > Personally, it feels like compilation become much slower than previous
>>> > versions after adopting 'cmake'.
>>> > Is this natural when we adopt cmake or are there other big changes on
>>> build
>>> > structure?
>>>
>>> So, I decided not to respond to that specific part of your original
>>> post because I don't have enough information on what you changed, but
>>> we have deprecated autoconf for a while now, so everyone uses CMake.
>>>
>>> If you're comparing LLVM a long time ago with autoconf versus LLVM
>>> today with CMake, then the changes are most likely because LLVM has
>>> grown a lot.
>>>
>>> If you're building LLVM trunk today with autoconf, then it's possible
>>> that you're missing a lot of source files from your build (and I'm
>>> surprised it worked).
>>>
>>> But overall, CMake should make absolutely no difference in building
>>> speeds, since the number of compilation jobs should (hopefully) be the
>>> same and in the same way. But I may be missing something... :)
>>>
>>> cheers,
>>> --renato
>>>
>>
>>
>>
>> --
>> Best, Sung
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>>
>


-- 
Best, Sung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161019/c479cbad/attachment.html>


More information about the llvm-dev mailing list