cmake build for Windows clarifications

This commit is contained in:
AndreasKunar 2024-07-18 18:45:45 +02:00
parent 028eebf180
commit 6f2366210d

View file

@ -60,15 +60,17 @@ In order to build llama.cpp you have four different options.
cmake -B build -G "Xcode" cmake -B build -G "Xcode"
cmake --build build --config Debug cmake --build build --config Debug
``` ```
- Building for Windows on ARM: - Building for Windows (x86, x64 and arm64) with MSVC or clang as compilers:
- Install MSVC / Visual Studio 2022 (VS2022), e.g. via the [Community Edition](https://visualstudio.microsoft.com/de/vs/community/). In the installer select the workload "Desktop-development with C++". This also automatically installs the required toola CMake and Ninja. - Install Visual Studio 2022, e.g. via the [Community Edition](https://visualstudio.microsoft.com/de/vs/community/). In the installer, select at least the following options (this also automatically installs the required additional tools like CMake,...):
- 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-\<version\>-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. - Tab Workload: Desktop-development with C++
- Then build _in a Developer Command Prompt / PowerShell for VS2022_ with: - Tab Components (select quickly via search): C++-_CMake_ Tools for Windows, _Git_ for Windows, C++-_Clang_ Compiler for Windows, MS-Build Support for LLVM-Toolset (clang)
- Please remember to always use a Developer Command Prompt / PowerShell for VS2022 for git, build, test
- For Wndows on ARM (arm64, WoA) build with:
```bash ```bash
cmake --preset arm64-windows-llvm-release cmake --preset arm64-windows-llvm-release -D GGML_OPENMP=OFF
cmake --build build-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. Note: Building for arm64 could also be done just with MSVC (with the build-arm64-windows-MSVC preset, or the standard CMake build instructions). But MSVC does not support inline ARM assembly-code, used e.g. for the accelerated Q4_0_4_8 CPU kernels.
- Using `gmake` (FreeBSD): - Using `gmake` (FreeBSD):