diff --git a/docs/build.md b/docs/build.md index 34a8cde09..47b357901 100644 --- a/docs/build.md +++ b/docs/build.md @@ -31,13 +31,6 @@ In order to build llama.cpp you have four different options. - For `Q4_0_4_4` quantization type build, add the `GGML_NO_LLAMAFILE=1` flag. For example, use `make GGML_NO_LLAMAFILE=1`. - For faster compilation, add the `-j` argument to run multiple jobs in parallel. For example, `make -j 8` will run 8 jobs in parallel. - For faster repeated compilation, install [ccache](https://ccache.dev/). - - For Windows: - - Install cmake e.g. via `winget install cmake`: - - As alternative to the w64devkit mentioned in "using make" above, install MSVC (e.g. via Visual Studio 2022 Community Edition). - - For Windows on ARM you need MSVC installed and _additonally_: - - Install [clang via LLVM for woa64](https://releases.llvm.org) to enable better ARM optimizations (clang needs the MSVC backend). - - For using clang, the first build step needs to be `cmake --preset arm64-windows-llvm-release` (instead of the `cmake -B ...` which defaults to MSVC). - - Note: Building for ARM can also be done just with MSVC (without installing clang or using the preset), but this does not support e.g. the accelerated Q_4_0_4_4/Q_4_0_4_8 kernels (a 2-2.5x prompt-processing speed improvement on the CPU), because the MSVC frontend cannot inline ARM assembly-code. - For debug builds, run `make LLAMA_DEBUG=1` - Using `CMake`: @@ -67,6 +60,15 @@ In order to build llama.cpp you have four different options. cmake -B build -G "Xcode" cmake --build build --config Debug ``` + - Building for Windows on ARM: + - Install MSVC / Visual Studio 2022 (VS2022), e.g. via the [Community Edition](https://visualstudio.microsoft.com/de/vs/community/). The latest VS2022 automatically installs the required CMake and Ninja tools. + - Also install the clang compiler + tools (LLVM). Either via direct download [clang/LLVM for Windows](https://github.com/llvm/llvm-project/releases/) (use the file "LLVM-\-woa64.exe"), or alternatively install via the [Chocolatey (choco) package manager](https://chocolatey.org/install) with `choco install llvm`. This LLVM for Windows requires an installed MSVC, and therefore always use it in a Develoer Command Prompt / PowerShell. + - Then build _in a Developer Command Prompt / PowerShell for VS2022_ with: + ```bash + cmake --preset arm64-windows-llvm-release + cmake --build build-arm64-windows-llvm-release + ``` + - Note: Building for ARM can also be done just with MSVC (without installing clang and the preset above), but this does not support e.g. the accelerated Q_4_0_4_4/Q_4_0_4_8 kernels (a 2-2.5x prompt-processing speed improvement on the CPU), because the MSVC frontend cannot inline ARM assembly-code. - Using `gmake` (FreeBSD):