From 81369189745425619be7637a2624dff1868f8f45 Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Wed, 26 Apr 2023 15:45:01 +0200 Subject: [PATCH] Windows Make instructions Added the instructions to build with Make on Windows --- README.md | 64 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 200d2a9f7..dce554d7c 100644 --- a/README.md +++ b/README.md @@ -169,15 +169,25 @@ cd llama.cpp In order to build llama.cpp you have three different options. -Note: For Windows, CMake or Zig can be used. +- Using `make` + - On Linux or MacOS: -- Using `make` + ```bash + make + ``` - ```bash - make - ``` + - On Windows: + + 1. Download the latest fortran version of [w64devkit](https://github.com/seeto/w64devkit/releases). + 2. Extract `w64devkit` on your pc. + 3. Run `w64devkit.exe`. + 4. Use the `cd` command to reach the `llama.cpp` folder. + 5. From here you can run: + ```bash + make + ``` -- Using CMake +- Using `CMake`: ```bash mkdir build @@ -186,32 +196,47 @@ Note: For Windows, CMake or Zig can be used. cmake --build . --config Release ``` -- Using Zig +- Using `Zig`: ```bash zig build -Drelease-fast ``` -#### BLAS Build +### BLAS Build Building the program with BLAS support may lead to some performance improvements in prompt processing using batch sizes higher than 32 (the default is 512). BLAS doesn't affect the normal generation performance. There are currently three different implementations of it: -- Accelerate Framework +- Accelerate Framework: This is only available on Mac PCs and it's enabled by default. You can just build using the normal instructions. -- OpenBLAS +- OpenBLAS: - This provides BLAS acceleration using only the CPU. Make sure to have OpenBLAS installed on your machine (only for Linux). + This provides BLAS acceleration using only the CPU. Make sure to have OpenBLAS installed on your machine. - - Using `make` - ```bash - make LLAMA_OPENBLAS=1 - ``` - Note: In order to build on Arch Linux with OpenBLAS support enabled you must edit the Makefile adding at the end of the line 105: `-lcblas` + - Using `make` + - On Linux: + ```bash + make LLAMA_OPENBLAS=1 + ``` + Note: In order to build on Arch Linux with OpenBLAS support enabled you must edit the Makefile adding at the end of the line 105: `-lcblas` + - On Windows: - - Using CMake + 1. Download the latest fortran version of [w64devkit](https://github.com/skeeto/w64devkit/releases). + 2. Download the latest version of [OpenBLAS for Windows](https://github.com/xianyi/OpenBLAS/releases). + 3. Extract `w64devkit` on your pc. + 4. From the OpenBLAS zip that you just downloaded copy `libopenblas.a`, located inside the `lib` folder, inside `w64devkit\x86_64-w64-mingw32\lib`. + 5. From the same OpenBLAS zip copy the content of the `include` folder inside `w64devkit\x86_64-w64-mingw32\include`. + 6. Run `w64devkit.exe`. + 7. Use the `cd` command to reach the `llama.cpp` folder. + 8. From here you can run: + + ```bash + make LLAMA_OPENBLAS=1 + ``` + + - Using `CMake` on Linux: ```bash mkdir build @@ -219,14 +244,15 @@ Building the program with BLAS support may lead to some performance improvements cmake .. -DLLAMA_OPENBLAS=ON cmake --build . --config Release ``` + - cuBLAS This provides BLAS acceleration using the CUDA cores of your Nvidia GPU. Make sure to have the CUDA toolkit installed. You can download it from your Linux distro's package manager or from here: [CUDA Toolkit](https://developer.nvidia.com/cuda-downloads). - - Using `make` + - Using `make`: ```bash make LLAMA_CUBLAS=1 ``` - - Using CMake + - Using `CMake`: ```bash mkdir build