Skip to content

LLM inference in C/C++

C++ ggml

docs: improve Windows build instructions (#27381)

Niklas Wenzel9a286ac98d2c
diff --git a/docs/build.md b/docs/build.md
index 45fe7f17a2..ed48e7a05e 100644
--- a/docs/build.md
+++ b/docs/build.md
@@ -70,18 +70,23 @@ cmake --build build --config Release
- Tab Workload: Desktop-development with C++
- 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 Windows on ARM (arm64, WoA) build with:
- ```bash
- cmake --preset arm64-windows-llvm-release -D GGML_OPENMP_FETCH=ON
- cmake --build build-arm64-windows-llvm-release
- ```
- `GGML_OPENMP_FETCH` downloads the official LLVM OpenMP runtime and requires Clang, 7-Zip and network access during configuration. CMake selects the runtime from the target architecture, so this also works when cross-compiling for WoA from x64. The extracted header, import library, DLL and OpenMP license are placed under `build/_deps`. The build copies `libomp.dll` and `LICENSE-LLVM-OpenMP` to the runtime output directory and installs them together. Omit the option to use CMake's normal OpenMP detection, or pass `-D GGML_OPENMP=OFF` to disable OpenMP.
- For building with ninja generator and clang compiler as default:
- -set path:set LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64\uwp;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x64
+ - For Windows on ARM (arm64, WoA), build with:
```bash
- cmake --preset x64-windows-llvm-release
- cmake --build build-x64-windows-llvm-release
+ cmake --preset arm64-windows-llvm-release -D GGML_OPENMP_FETCH=ON
+ cmake --build build-arm64-windows-llvm-release
```
+ - Use `ARM64 Native Tools Command Prompt for VS 2022` if you are building on an ARM64 machine.
+ - `GGML_OPENMP_FETCH` downloads the official LLVM OpenMP runtime and requires Clang, 7-Zip and network access during configuration. CMake selects the runtime from the target architecture, so this also works when cross-compiling for WoA from x64. The extracted header, import library, DLL and OpenMP license are placed under `build/_deps`. The build copies `libomp.dll` and `LICENSE-LLVM-OpenMP` to the runtime output directory and installs them together. Omit the option to use CMake's normal OpenMP detection, or pass `-D GGML_OPENMP=OFF` to disable OpenMP.
+ - For building with ninja generator and clang compiler as default:
+ - Set path:
+ ```
+ set LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64\uwp;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x64
+ ```
+ - Run:
+ ```bash
+ cmake --preset x64-windows-llvm-release
+ cmake --build build-x64-windows-llvm-release
+ ```
- If you want HTTPS/TLS features, you may install OpenSSL development libraries. If not installed, the project will build and run without SSL support.
- **Debian / Ubuntu:** `sudo apt-get install libssl-dev`
- **Fedora / RHEL / Rocky / Alma:** `sudo dnf install openssl-devel`