<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><font size="-1">From <a class="moz-txt-link-freetext" href="https://llvm.org/docs/GettingStarted.html">https://llvm.org/docs/GettingStarted.html</a><br>
      </font></p>
    <p><font size="-1">Just finished a clang build on Xubuntu 19.04
        using cpp.<br>
      </font></p>
    <p><font size="-1">cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang"
        ../llvm</font></p>
    <p><font size="-1">Memory usage hit a maximum at the link for
        bin/clang-9 at 13 gigabytes with ninja -j 1.<br>
      </font></p>
    <p><font size="-1">Disk usage for the build directory was 61
        gigabytes.</font></p>
    <p><font size="-1">My sense is that this kinds of usage is more than
        what a typical new user would expect. Perhaps the page above
        might be changed to reflect the expected result and with an
        easier route noted by Erich below.</font></p>
    <div class="moz-cite-prefix"><font size="-1">On 6/20/19 6:56 AM,
        Keane, Erich via cfe-dev wrote:</font><br>
    </div>
    <blockquote type="cite"
cite="mid:D0DD9254EE9DB04FA7C8606D0828DA6AD3A8F5C4@ORSMSX122.amr.corp.intel.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.pre
        {mso-style-name:pre;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Clang
            definitely hits a pathological case in LD that makes it do
            terrible things if you use use more than a process or two in
            DEBUG. 
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">However,
            if you use “gold” or “LLD” instead, it works fine.  Assuming
            you have LLD, you can do:<o:p></o:p></span></p>
        <p class="MsoNormal"><span class="pre"><span
              style="font-size:10.0pt;font-family:"Courier
              New"">-DLLVM_USE_LINKER=lld or –DLLVM_ENABLE_LLD=ON<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span class="pre"><span
              style="font-size:10.0pt;font-family:"Courier
              New""><o:p> </o:p></span></span></p>
        <p class="MsoNormal"><span class="pre"><span
              style="font-size:10.0pt;font-family:"Courier
              New"">Otherwise you should have gold available, which
              you can do with:<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span class="pre"><span
              style="font-size:10.0pt;font-family:"Courier
              New"">-DLLVM_USE_LINKER=gold<o:p></o:p></span></span></p>
        <p class="MsoNormal"><span class="pre"><span
              style="font-size:10.0pt;font-family:"Courier
              New""><o:p> </o:p></span></span></p>
        <p class="MsoNormal"><span class="pre"><span
              style="font-size:10.0pt;font-family:"Courier
              New"">I can only run about 3-4 links at a time with
              LD and can do –j30 with no problems with Gold.</span></span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><a name="_MailEndCompose"
            moz-do-not-send="true"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
        <p class="MsoNormal"><a name="_____replyseparator"
            moz-do-not-send="true"></a><b><span
              style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif">
            cfe-dev [<a class="moz-txt-link-freetext" href="mailto:cfe-dev-bounces@lists.llvm.org">mailto:cfe-dev-bounces@lists.llvm.org</a>]
            <b>On Behalf Of </b>James Courtier-Dutton via cfe-dev<br>
            <b>Sent:</b> Thursday, June 20, 2019 3:27 AM<br>
            <b>To:</b> nick <a class="moz-txt-link-rfc2396E" href="mailto:xerofoify@gmail.com"><xerofoify@gmail.com></a><br>
            <b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a> Developers
            <a class="moz-txt-link-rfc2396E" href="mailto:cfe-dev@lists.llvm.org"><cfe-dev@lists.llvm.org></a><br>
            <b>Subject:</b> Re: [cfe-dev] Out of Memory Building Clang
            and LLVM<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div>
            <p class="MsoNormal"><o:p> </o:p></p>
          </div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <div>
            <div>
              <p class="MsoNormal">On Wed, 19 Jun 2019 at 23:36, nick
                via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org"
                  moz-do-not-send="true">cfe-dev@lists.llvm.org</a>>
                wrote:<o:p></o:p></p>
            </div>
            <blockquote style="border:none;border-left:solid #CCCCCC
              1.0pt;padding:0in 0in 0in
              6.0pt;margin-left:4.8pt;margin-right:0in">
              <p class="MsoNormal" style="margin-bottom:12.0pt">Greetings,
                <br>
                <br>
                Seems I'm running out of memory on a host system trying
                to build llvm, tooling and clang. It was configured<br>
                as:<br>
                cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles"
                ../llvm<br>
                <br>
                and build with:<br>
                <br>
                make -j4 using gcc as the host compiler, version 8.<br>
                <br>
                The dmesg I'm getting is related to the linker and not
                sure if the linker has a bug or it's normal<br>
                to expect 3GB or more used for linking clang. Doesn't
                seem to be but not sure.<br>
                <br>
                dmesg output:<br>
                [186517.023397] Out of memory: Kill process 2143 (ld)
                score 286 or sacrifice child<br>
                [186517.023403] Killed process 2143 (ld)
                total-vm:4622188kB, anon-rss:3202188kB, file-rss:4kB,
                shmem-rss:0kB<br>
                <br>
                <o:p></o:p></p>
            </blockquote>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">HI,<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">I have a 16 Core/32 Thread system
                with 32GB RAM, and it can have difficulty building
                CLANG/LLVM.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">The link stage definitely needs to be
                with make -j1.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">That being said, if you force a
                "Release" version, and not the "Debug" version, much
                less RAM is needed.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Kind Regards<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">James<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
  </body>
</html>