[PATCH] D75425: [docs] Added solutions to slow build under common problems

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 07:24:22 PST 2020


nhaehnle added a comment.

In D75425#1900044 <https://reviews.llvm.org/D75425#1900044>, @Meinersbur wrote:

> - Use ninja instead of make
> - BUILD_SHARED_LIBS=ON


Absolutely, though this should also mention the dynamic library build without BUILD_SHARED_LIBS -- some downstream uses of LLVM have a hard time with BUILD_SHARED_LIBS.

> - Separate debug symbols file (`-gsplit-dwarf`)

There's a CMake option for that -- LLVM_USE_SPLIT_DWARF.

Also worth mentioning is generating the gdb-index, which makes a **ridiculous** difference for debugging.



================
Comment at: llvm/docs/GettingStarted.rst:1107
+
+ * -DLLVM_PARALLEL_LINK_JOBS  
+   Set this equal to number of jobs you wish to run simultaneously. This is 
----------------
abrachet wrote:
> lebedev.ri wrote:
> > Should mention that this is ninja specific.
> > And i think `similar to the -j option used with make.` is missing words "but for link jobs only"
> We could also mention `PARALLEL_COMPILE_JOBS` but it's impact is much less significant.
Personally, I think using PARALLEL_COMPILE_JOBS is an anti-pattern. You should just tell `ninja` (or `make`, but really you should be using ninja) to parallelize the build. Ninja uses all hardware threads by default, and you can easily teach this to make as well.

The reason for setting PARALLEL_LINK_JOBS is to **reduce** the parallelism during linking to avoid out-of-memory conditions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75425/new/

https://reviews.llvm.org/D75425





More information about the llvm-commits mailing list