Requirements [1]:
- CMake >=3.13.4
- GCC >=7.1.0
- Python >=3.6 (automated test suite)
- zlib >=1.2.3.4
- GNU Make >=3.79
Notes:
- Extracted source occupies ~1.3 GB
- Configure with
CMAKE_BUILD_TYPE=Release
, which defaults toDebug
- Build of LLVM, Clang and LLD uses ~4 GB extra disk space
- Build takes ~42 minutes on Xeon E5-2630v4 (2.2 GHz) with 8 jobs
- Installation uses ~1.8 GB
-
Install dependencies
$ yum -y install centos-release-scl $ yum makecache fast $ yum -y install devtoolset-11 cmake3
-
Download source tarball and extract
$ wget https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-13.0.1.tar.gz \ -O llvm-project-llvmorg-13.0.1.tar.gz $ tar xf llvm-project-llvmorg-13.0.1.tar.gz $ cd llvm-project-llvmorg-13.0.1
-
Build
$ . /opt/rh/devtoolset-11/enable $ cmake3 -S llvm -B build -G 'Unix Makefiles' \ -DLLVM_ENABLE_PROJECTS='clang;lld' \ -DCMAKE_BUILD_TYPE=Release $ cmake3 --build build -j8
-
Install
$ cmake3 --install build