Skip to content

Commit 7f4fbe5

Browse files
slarenggerganov
andauthored
llama : allow building all tests on windows when not using shared libs (#13980)
* llama : allow building all tests on windows when not using shared libraries * add static windows build to ci * tests : enable debug logs for test-chat --------- Co-authored-by: Georgi Gerganov <[email protected]>
1 parent f470bc3 commit 7f4fbe5

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,8 @@ jobs:
687687
strategy:
688688
matrix:
689689
include:
690-
- build: 'cpu-x64'
691-
defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF'
690+
- build: 'cpu-x64 (static)'
691+
defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DBUILD_SHARED_LIBS=OFF'
692692
- build: 'openblas-x64'
693693
defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
694694
- build: 'vulkan-x64'

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ if (LLAMA_LLGUIDANCE)
104104
llama_build_and_test(test-grammar-llguidance.cpp ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../models/ggml-vocab-llama-bpe.gguf)
105105
endif ()
106106

107-
if (NOT WIN32)
108-
# these tests are disabled on Windows because they use internal functions not exported with LLAMA_API
107+
if (NOT WIN32 OR NOT BUILD_SHARED_LIBS)
108+
# these tests are disabled on Windows because they use internal functions not exported with LLAMA_API (when building with shared libraries)
109109
llama_build_and_test(test-sampling.cpp)
110110
llama_build_and_test(test-grammar-parser.cpp)
111111
llama_build_and_test(test-grammar-integration.cpp)

tests/test-chat.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//
88
#include "chat.h"
99

10+
#include "log.h"
11+
1012
#include "../src/unicode.h"
1113
#include "../src/llama-grammar.h"
1214

@@ -1428,6 +1430,8 @@ static void test_msg_diffs_compute() {
14281430
}
14291431

14301432
int main(int argc, char ** argv) {
1433+
common_log_set_verbosity_thold(999);
1434+
14311435
// try {
14321436
#ifndef _WIN32
14331437
if (argc > 1) {

0 commit comments

Comments
 (0)