I have been trying to install LLVM on my system [i7 + 16GB RAM]. I have been following this tutorial : LLVM Install. But in building, it eats up all the RAM and the terminal closes automatically. Is there any way to solve this?
Thanks.
I have been trying to install LLVM on my system [i7 + 16GB RAM]. I have been following this tutorial : LLVM Install. But in building, it eats up all the RAM and the terminal closes automatically. Is there any way to solve this?
Thanks.
The resources consumed during build can depend on various factors:
BUILD_SHARED_LIBS:ON
) will consume way less memory.-jN
TLDR for reducing RAM pressure:
jN
try, -j(N-2)
). Using -j1
may use less RAM but would take long time to build.LLVM_ENABLE_RUNTIMES
) and targets (e.g., LLVM_TARGETS_TO_BUILD
) as you can. This may not be trivial as it requires spending time with the CMakeCache.txt file.ninja
, invoke ninja clang
, or ninja opt
etc.I've spent half day on this item. I've a PC i7 with 24GB of RAM based un Ubuntu 22.04. I tried (many times) but was not possible to compile with gcc (and I don't why). The system monitor sometimes shown 20GB ram usage and wasn't possible to reach the end of the compilation. The build system (I choosen ninja) crashed many times.
At the end I installed clang. The ram usage never gone over 8GB. I report what I did (if can help anyone)
follow this link How to build clang with clang?