0

I recently compiled llvm from source since I wanted to look at 8. However, it is a whooping 56G in size once installed. That seems excessive.

How can I reduce the size of the installation?

; du -h -d 1 -c .
41M     ./include
22G     ./lib
35G     ./bin
264K    ./share
28K     ./libexec
56G     .
56G     total

size on disk

Build using:

cmake3 -G Ninja  -DCMAKE_INSTALL_PREFIX=~/llvm -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=1 -DLLVM_ENABLE_PROJECTS="all" ../llvm
4
  • You never mention how you configured the project and how you built it. I'm assuming you built it with debugging symbols. My clang-8 binary (on OpenBSD) is 36.8 MB. Commented Aug 12, 2019 at 10:05
  • @Kusalananda I build it following the instructions on the web site Commented Aug 12, 2019 at 10:13
  • But you never read llvm.org/docs/CMake.html#frequently-used-cmake-variables and did not use CMAKE_BUILD_TYPE:Release? Commented Aug 12, 2019 at 10:26
  • @Kusalananda I foolishly assumed that debug was not the default. /sigh. Commented Aug 12, 2019 at 10:31

1 Answer 1

1

Build LLVM in release mode by adding -DCMAKE_BUILD_TYPE=Release to cmake3 invocation.

The default is to build with debugging symbols, which will result in very large files.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.