Minimum / Recommended hardware requirements for compiling LLVM

I am interested in building LLVM and I have been searching online for quite a while for an answer to this topic, however I cannot seem to find much information on it other than storage requirements.

I have the following doubts regarding it:

  1. Is it okay to build LLVM on a personal machine, i.e. my laptop? Will it stress the hardware too much to be useful long term?
  2. How much RAM does each thread in a parallel build require on average, if using gcc?
  3. Will a hard drive be too slow to build / link with? How much time can I expect a build to take?
  4. Would it be better to rent a server and do development work on that?

For reference, my hardware configuration is:

  • CPU: AMD Ryzen 7 4800H
  • RAM: 32 GB
  • HDD: 1TB 5400 RPM

Depends on what you aim and your OS too. I can tell on Linux. Building it with clang requires much less RAM than with gcc and is bit slower. Some of the tests require mucg RAM and must be skipped manually since they are not related to hardware. On Windows or Mac I think much RAM is needed but your hardware looks pretty good, At least 10GB RAM may be needed for GPU also or if you build all targets. Debug builds may require 100 GB HDD and much RAM too.

1 - that machine is more than capable of building llvm/clang - I have a 8 core / 32 Gb zen2 laptop that I do some development with when on the go (for both Windows/msvc + WSL2/gcc ninja builds). It definitely gets warm (useful in the winter months!) and can take a while (30mins+) to rebuild from scratch to running the ‘check-llvm’ tests, but incremental builds are usually lightweight.

2 - most source files in optimized gcc builds take up to 1-2Gb RAM, I can’t remember how much the linker uses but I’ve never had a problem on any of my 32Gb machines.

3 - SSDs are better for builds (ideally I prefer a separate drive for development), but I’m not sure how much penalty you’ll see. How much spare disk space do you have?

4 - just try your own machine for a while before you make any avoidable costly decisions.

You didn’t say what llvm work you had in mind - if you are interested in working on llvm development in latest trunk, then you’re likely to see quite a few rebuilds as a lot of cmake/support files changes can cause a full rebuild. But if you’re mainly interested in using llvm for your own projects, then those pulls can be minimised.

@Blis and @RKSimon: Thank you for your inputs. I run Pop!_OS 22.04 LTS, and I would mainly like to contribute to llvm-trunk, for now starting off with bug fixes & documentation as I am interested in learning how LLVM works internally.

I do have one SSD with my OS on it having ~50 GB available which I can increase to 100 GB without issues, however I have heard that building on SSDs can cause a large amount of write cycles to accumulate and kill the drive eventually, which is why I would like to build on a HDD.

Sanitizers will need more resources. E.g. Typical memory overhead introduced by ThreadSanitizer is about 5x-10x. Typical slowdown introduced by MemorySanitizer is 3x. https://clang.llvm.org/docs/MemorySanitizer.html. On Windows runtimes and compilers will require 100-200 GB HDD only for the setup.