diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84984ba..59e9108 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -977,14 +977,23 @@ jobs: key: cache-windows-${{ matrix.arch }}-${{ matrix.instruction }} path: | ${{ github.workspace }}\build + ${{ github.workspace }}\.cache + - name: Deps + run: | + $ErrorActionPreference = "Stop" + $ProgressPreference = 'SilentlyContinue' + + choco install ccache ninja curl -y - name: Build + env: + CCACHE_DIR: "${{ github.workspace }}\\.cache\\ccache" run: | $ErrorActionPreference = "Stop" $ProgressPreference = 'SilentlyContinue' Write-Host "===== BUILD =====" New-Item -Force -ItemType Directory -Path "${{ github.workspace }}\.cache" -ErrorAction Ignore | Out-Null - cmake -S ${{ github.workspace }} -B ${{ github.workspace }}\build -DCMAKE_BUILD_TYPE=Release ` + cmake ${{ matrix.arch == 'arm64' && '-G "Ninja"'|| '' }} -S ${{ github.workspace }} -B ${{ github.workspace }}\build -DCMAKE_BUILD_TYPE=Release ` ${{ matrix.arch == 'arm64' && format('-DCMAKE_TOOLCHAIN_FILE={0}\llama-box\scripts\build-windows-arm64.cmake', github.workspace) || '' }} ` -DGGML_NATIVE=off ` ${{ matrix.instruction == 'avx2' && '-DGGML_AVX=on -DGGML_AVX2=on' || '' }} ` @@ -992,7 +1001,7 @@ jobs: -DGGML_STATIC=on ` -DGGML_OPENMP=off ` -DGGML_RPC=on - cmake --build ${{ github.workspace }}\build --target llama-box --config Release -- /m:${env:NUMBER_OF_PROCESSORS} + cmake --build ${{ github.workspace }}\build --target llama-box --config Release -- -j ${env:NUMBER_OF_PROCESSORS} Write-Host "===== RESULT =====" Get-ChildItem -Path "${{ github.workspace }}\build\bin\Release\" -File -ErrorAction Ignore if (Test-Path -Path "${{ github.workspace }}\build\bin\Release\llama-box.exe") { diff --git a/llama-box/scripts/build-windows-arm64.cmake b/llama-box/scripts/build-windows-arm64.cmake index 0350378..f545c89 100644 --- a/llama-box/scripts/build-windows-arm64.cmake +++ b/llama-box/scripts/build-windows-arm64.cmake @@ -1,16 +1,13 @@ -set(CMAKE_CROSSCOMPILING TRUE) - set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR arm64) -set(CMAKE_GENERATOR_PLATFORM arm64 CACHE INTERNAL "") set(target arm64-pc-windows-msvc) -set( CMAKE_C_COMPILER clang ) -set( CMAKE_CXX_COMPILER clang++ ) -set( CMAKE_C_COMPILER_TARGET ${target} ) -set( CMAKE_CXX_COMPILER_TARGET ${target} ) +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_C_COMPILER_TARGET ${target}) +set(CMAKE_CXX_COMPILER_TARGET ${target}) -set( arch_c_flags "-march=armv8.7-a -fvectorize -ffp-model=fast -fno-finite-math-only" ) -set( warn_c_flags "-Wno-format -Wno-unused-variable -Wno-unused-function -Wno-gnu-zero-variadic-macro-arguments" ) -set( CMAKE_C_FLAGS_INIT "${arch_c_flags} ${warn_c_flags}" ) -set( CMAKE_CXX_FLAGS_INIT "${arch_c_flags} ${warn_c_flags}" ) +set(arch_c_flags "-march=armv8.7-a -fvectorize -ffp-model=fast -fno-finite-math-only") +set(warn_c_flags "-Wno-format -Wno-unused-variable -Wno-unused-function -Wno-gnu-zero-variadic-macro-arguments") +set(CMAKE_C_FLAGS_INIT "${arch_c_flags} ${warn_c_flags}") +set(CMAKE_CXX_FLAGS_INIT "${arch_c_flags} ${warn_c_flags}")