<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">Hey Joan,</div><div dir="ltr"><br></div><div dir="ltr">When looking for build support it is really useful to include a bunch of information about your build up front. Knowing that you are on macOS, and using the Xcode generator are really useful.</div><div dir="ltr"><br></div><div dir="ltr">On macOS, BUILD_SHARED_LIBS won’t really help much because the default linker (ld64) is pretty good. Using an IDE generator and setting LLVM_USE_OPTIMIZED_TABLEGEN will kill your release builds.</div><div dir="ltr"><br></div><div dir="ltr">In general Xcode takes 2x-3x longer than Ninja for incremental builds, and 1.5x-2x as long for clean builds. Lots of people use the Xcode generator to create a project file for navigation and editing, but most people I know doing LLVM development on macOS use Ninja for their builds.</div><div dir="ltr"><br></div><div dir="ltr">-Chris</div><div dir="ltr"><br>On Jun 30, 2019, at 12:18 PM, Joan Lluch via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="Content-Type" content="text/html charset=utf-8">Hi Greg,<div class=""><br class=""></div><div class="">I tried to setup Ninja before on my mac but I mush have done something wrong and I didn’t manage to get it work. I’m not familiarised at all with the procedures involved. I may try that again to see If I have some luck though. It’s a pity that LLVM is not particularly friendly with familiar IDEs such as xCode on macs and Visual Studio on windows.</div><div class=""><br class=""></div><div class="">John</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 30 Jun 2019, at 17:43, Greg Bedwell <<a href="mailto:gregbedwell@gmail.com" class="">gregbedwell@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div dir="auto" class="">This is also the case with the Visual Studio generators. Custom commands in a single cmake file essentially get written out line by line into a single batch file that gets processed as a custom build step. In the VS case this means that it can, for example, run X86 and Aarch64 tablegen steps in parallel with each other but all of the individual X86 invocations get processed serially. I can well imagine that the Xcode situation is similar although I've no experience with it myself to know for sure.</div></div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">As previously mentioned, the best solution is probably to try to adjust your workflow to use the Ninja ( <div class=""><a href="https://ninja-build.org/" class="">https://ninja-build.org</a></div> ) CMake generator if at all possible. It's a bit of an adjustment but it does work very nicely with the LLVM build system.</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">-Greg</div><div dir="auto" class=""><br class=""></div><div dir="auto" class=""><br class=""></div><div class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 30 Jun 2019 at 12:08, Nicolai Hähnle via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are you saying that the TableGen execution isn't parallelized? That <br class="">
seems like an obvious Xcode-specific problem...<br class="">
<br class="">
The TableGen executions are parallelized with cmake/ninja just fine.<br class="">
<br class="">
Cheers,<br class="">
Nicolai<br class="">
<br class="">
On 30.06.19 11:28, Joan Lluch via llvm-dev wrote:<br class="">
> Hi Praveen,<br class="">
> <br class="">
> Thanks for the tip, but Xcode seems to spend all the time running <br class="">
> tablegen "custom shell scripts", one by one at a time, not linking. <br class="">
> Linking is actually very fast, possibly less than a second. The <br class="">
> “scripts” that take longer are “AArch64CommonTableGen" and <br class="">
> “AMDGPUCommonTableGen”. As said this is on LLVM 9.0.<br class="">
> <br class="">
> However, on LLVM 7.0.1, the same process takes just 5-6 seconds in <br class="">
> total, with individual “scripts” taking significantly less than 1 second <br class="">
> each. There must be some difference between LLVM 9.0 and LLVM 7.0 that <br class="">
> might cause this (?)<br class="">
> <br class="">
> John<br class="">
> <br class="">
> <br class="">
>> On 30 Jun 2019, at 11:17, Praveen Velliengiri <br class="">
>> <<a href="mailto:praveenvelliengiri@gmail.com" target="_blank" class="">praveenvelliengiri@gmail.com</a> <mailto:<a href="mailto:praveenvelliengiri@gmail.com" target="_blank" class="">praveenvelliengiri@gmail.com</a>>> <br class="">
>> wrote:<br class="">
>><br class="">
>> *<br class="">
>> *<br class="">
>> cmake *BUILD_SHARED_LIBS* option, it builds llvm as .so not as .a. It <br class="">
>> will use less memory during linking so you can increase the link <br class="">
>> threads and your build time will be lesser.<br class="">
>> Check this in : <a href="https://llvm.org/docs/CMake.html" rel="noreferrer" target="_blank" class="">https://llvm.org/docs/CMake.html</a><br class="">
>><br class="">
>> **<br class="">
>> **<br class="">
>><br class="">
>> On Sun, 30 Jun 2019 at 14:42, Joan Lluch <<a href="mailto:joan.lluch@icloud.com" target="_blank" class="">joan.lluch@icloud.com</a> <br class="">
>> <mailto:<a href="mailto:joan.lluch@icloud.com" target="_blank" class="">joan.lluch@icloud.com</a>>> wrote:<br class="">
>><br class="">
>> Hi Praveen,<br class="">
>><br class="">
>> Please, can you elaborate on this?. What do do mean by “building<br class="">
>> as shared objects”.<br class="">
>><br class="">
>> Thanks,<br class="">
>><br class="">
>> John<br class="">
>><br class="">
>><br class="">
>><br class="">
>>> On 30 Jun 2019, at 07:32, Praveen Velliengiri<br class="">
>>> <<a href="mailto:praveenvelliengiri@gmail.com" target="_blank" class="">praveenvelliengiri@gmail.com</a><br class="">
>>> <mailto:<a href="mailto:praveenvelliengiri@gmail.com" target="_blank" class="">praveenvelliengiri@gmail.com</a>>> wrote:<br class="">
>>><br class="">
>>> Maybe try building llvm as a shared objects..<br class="">
>>><br class="">
>>> On Jun 30, 2019 1:30 AM, "Joan Lluch via llvm-dev"<br class="">
>>> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>>> wrote:<br class="">
>>><br class="">
>>> Hi Florian,<br class="">
>>><br class="">
>>> Ok, I ran this:<br class="">
>>><br class="">
>>> cmake -S LLVM -DCMAKE_INSTALL_PREFIX=INSTALL<br class="">
>>> -DLLVM_OPTIMIZED_TABLEGEN=On -G Xcode<br class="">
>>><br class="">
>>> Compiled it again from clean, and the situation is worse than<br class="">
>>> before. Incremental builds take an incredible amount of time<br class="">
>>> stuck in running Tablegen scripts for all targets. Now this<br class="">
>>> happens both in Release and Debug configurations. Just before<br class="">
>>> this, at least Release compiled fine, but that’s no longer<br class="">
>>> the case.<br class="">
>>><br class="">
>>> Any other suggestions? What could actually cause this?<br class="">
>>><br class="">
>>> Thanks<br class="">
>>> John<br class="">
>>><br class="">
>>><br class="">
>>><br class="">
>>>> On 29 Jun 2019, at 19:37, Florian Hahn<br class="">
>>>> <<a href="mailto:florian_hahn@apple.com" target="_blank" class="">florian_hahn@apple.com</a> <mailto:<a href="mailto:florian_hahn@apple.com" target="_blank" class="">florian_hahn@apple.com</a>>> wrote:<br class="">
>>>><br class="">
>>>> Hi,<br class="">
>>>><br class="">
>>>>> On Jun 29, 2019, at 18:26, Joan Lluch via llvm-dev<br class="">
>>>>> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>>><br class="">
>>>>> wrote:<br class="">
>>>>><br class="">
>>>>> Hi all,<br class="">
>>>>><br class="">
>>>>> On LLVM version 7.0.1, incremental builds are very fast for<br class="">
>>>>> both Release and Debug. I’m compiling with Xcode<br class="">
>>>>><br class="">
>>>>> I recently downloaded LLVM 9.0 from the LLVM-mirror Github<br class="">
>>>>> repository and found that Incremental "Debug” builds take a<br class="">
>>>>> ridiculously long time due to Tablegen taking ages<br class="">
>>>>> (literally more than 10 minutes) to generate files. This<br class="">
>>>>> makes it totally unusable for debug purposes. However,<br class="">
>>>>> incremental ‘Release’ builds only take a few seconds.<br class="">
>>>>><br class="">
>>>>> Why is that?. Any suggestions?.<br class="">
>>>><br class="">
>>>><br class="">
>>>><br class="">
>>>> You could give setting LLVM_OPTIMIZED_TABLEGEN a try<br class="">
>>>> (<a href="https://llvm.org/docs/CMake.html" rel="noreferrer" target="_blank" class="">https://llvm.org/docs/CMake.html</a>).<br class="">
>>>><br class="">
>>>> Cheers,<br class="">
>>>> Florian<br class="">
>>><br class="">
>>><br class="">
>>> _______________________________________________<br class="">
>>> LLVM Developers mailing list<br class="">
>>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>><br class="">
>>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
>>><br class="">
>><br class="">
> <br class="">
> <br class="">
> _______________________________________________<br class="">
> LLVM Developers mailing list<br class="">
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
> <br class="">
<br class="">
-- <br class="">
Lerne, wie die Welt wirklich ist,<br class="">
Aber vergiss niemals, wie sie sein sollte.<br class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</blockquote></div></div>
</div></blockquote></div><br class=""></div></div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>LLVM Developers mailing list</span><br><span><a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a></span><br><span><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></span><br></div></blockquote></body></html>