Overview
llama.cpp provides extensive CMake options to customize your build. Options are specified with-D flag:
General Options
Build Type
Debug build
Static build
Optimization Options
GGML_NATIVE=ON optimizes for your current CPU but may not work on other systems.Portable build (no native optimization)
Build Targets
Minimal build (library only)
GPU Backend Options
CUDA (NVIDIA)
HIP (AMD)
Linux HIP build
Windows HIP build
Metal (Apple)
Disable Metal
Vulkan
Vulkan with validation
SYCL (Intel GPU)
CPU Backend Options
BLAS Libraries
CPU Instruction Sets
* Default is
ON unless GGML_NATIVE=OFF
Enable AVX-512
ARM CPU Options
Arm KleidiAI
Special Purpose Backends
CANN (Ascend NPU)
ZenDNN (AMD EPYC)
OpenCL (Qualcomm Adreno)
RPC Backend
Advanced Options
Threading
Disable OpenMP
Debugging & Diagnostics
Build with sanitizers
Backend Dynamic Loading
GGML_BACKEND_DL requires BUILD_SHARED_LIBS=ON.Dynamic backend loading
HTTPS/SSL Support
Disable OpenSSL

