Jump to content

Llvm: cara install: Difference between revisions

From Haidhi Wiki
Created page with "<syntaxhighlight lang=bash> git clone https://github.com/llvm/llvm-project.git cmake -S llvm -B build -G Ninja -DCMAKE_BUILD_TYPE=Release </syntaxhighlight>"
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
git clone https://github.com/llvm/llvm-project.git
git clone https://github.com/llvm/llvm-project.git
cmake -S llvm -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
 
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
</syntaxhighlight>
kalo udah keinstall coba cek:
<syntaxhighlight lang=bash>
/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                               
</syntaxhighlight>
biar gampang gak usah ngetik panjang-panjang
<syntaxhighlight lang=bash>
echo 'export PATH=/usr/local/llvm/bin:$PATH' >> ~/.zshrc
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 03:45, 1 November 2025

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

biar gampang gak usah ngetik panjang-panjang

echo 'export PATH=/usr/local/llvm/bin:$PATH' >> ~/.zshrc