Jump to content

Llvm: cara install

From Haidhi Wiki
Revision as of 03:33, 1 November 2025 by SanzSkuy (talk | contribs)
git clone https://github.com/llvm/llvm-project.git

cd llvm-project

cmake -S llvm -B build -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
  -DLLVM_TARGETS_TO_BUILD="X86" \
  -DCMAKE_INSTALL_PREFIX=/usr/local/llvm

cmake --build build -j $(nproc)

sudo cmake --install build

kalo udah keinstall coba cek:

/usr/local/llvm/bin/clang --version
# Output
clang version 22.0.0git (https://github.com/llvm/llvm-project.git cc271437553452ede002d871d32abc02084341a8)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/llvm/bi

/usr/local/llvm/bin/llc --version
# Output
LLVM (http://llvm.org/):
  LLVM version 22.0.0git
  Optimized build.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: raptorlake

  Registered Targets:
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64