I built llvm-6.0.0
from source and everything works fine. I'm just wondering how come its size is so huge (42G
). Can I easily erase some object files or other to make the build directory smaller?
$ du -hs ~/GIT/llvm-6.0.0/build/
42G /home/oren/GIT/llvm-6.0.0/build/
An LLVM-only build will need about 1-3 GB of space. A full build of LLVM and Clang will need around 15-20 GB of disk space. The exact space requirements will vary by system. (It is so large because of all the debugging information and the fact that the libraries are statically linked into multiple tools).
The server this runs on only has 2 cores, so a full LLVM build can take more than two hours. For smaller changes, building LLVM from ccache and compiling the benchmarks takes about 20 minutes.
The Clang project provides a language front-end and tooling infrastructure for languages in the C language family (C, C++, Objective C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. Both a GCC-compatible compiler driver (clang) and an MSVC-compatible compiler driver (clang-cl.exe) are provided.
You're building without shared libraries, which means that a number of very large libraries are linked statically into a large number of (otherwise small) tools. I'm guessing that you may also be building for all targets (32-bit ARM, 64-bit ARM, a few dozens more, 32-bit X86, 64-bit X86).
If you run cmake -DLLVM_TARGETS_TO_BUILD=HOST -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=on .
, you should reduce the space use to about 10G. (At least I have a 10G build tree produced from a similar command line. I also have bigger trees, because those settings aren't the best match for all purposes.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With