[llvm-dev] Improving llvm-projects build

Florian Hahn via llvm-dev llvm-dev at lists.llvm.org
Sun Feb 14 05:22:14 PST 2021


Hi,


> On Feb 14, 2021, at 13:15, Manas via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi everyone,
> 
> I fairly regularly build LLVM (a forked up-to-date repo containing some
> custom LLVM passes). But when the build is large, it takes up almost all of 
> my remaining RAM (~4 to 5 gigs). I usually run those builds at nights for it
> to complete.
> 
> Though I would like the build to not clog up entire RAM and just use some 
> portion of it, so that I can also work alongside (and my system won't
> freeze). My current CMAKE command is:
> 
> ```
> cmake -G Ninja -DLLVM_TARGETS_TO_BUILD="X86;AMDGPU" \
>    -DLLVM_ENABLE_ASSERTIONS=ON \
>    -DCMAKE_C_COMPILER=/usr/bin/clang \
>    -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
>    -DCMAKE_BUILD_TYPE=Debug \
>    -DLLVM_CCACHE_BUILD=ON \
>    -DLLVM_USE_LINKER=gold \
>    -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
>    ../llvm/
> ```

Building llvm with debug info requires a large amount of RAM. See https://llvm.org/docs/GettingStarted.html#common-problems <https://llvm.org/docs/GettingStarted.html#common-problems> for some pointers.

Cheers,
Florian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210214/07d4513d/attachment.html>


More information about the llvm-dev mailing list