From b7ee2d080118301e4da5fbcdbbf65367c9cf2df8 Mon Sep 17 00:00:00 2001 From: Tamotsu Takahashi Date: Mon, 28 Oct 2024 02:15:38 +0900 Subject: [PATCH] install openblas and pkgconfiglite - choco install pkgconfiglite (vcpkg-pkgconf doesn't contain pkg-config executable?) - vcpkg install openblas (otherwise it is not detected now) --- .github/workflows/build.yml | 144 ++++++++++++++++++------------------ 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d6c0d1a1eb..e9fe767302e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ on: [push, pull_request] env: ubuntu_image: "ubuntu:22.04" + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" jobs: ubuntu-latest: @@ -371,77 +372,78 @@ jobs: name: whisper-bin-${{ matrix.arch }} path: build/bin/${{ matrix.build }} -# TODO: fails for some reason: https://github.com/ggerganov/whisper.cpp/actions/runs/11516781296/job/32060139298?pr=2511 -# windows-blas: -# runs-on: windows-latest -# -# strategy: -# matrix: -# build: [Release] -# arch: [Win32, x64] -# blas: [ON] -# sdl2: [ON] -# include: -# - arch: Win32 -# obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x86.zip -# s2arc: x86 -# - arch: x64 -# obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x64.zip -# s2arc: x64 -# - sdl2: ON -# s2ver: 2.28.5 -# -# steps: -# - name: Clone -# uses: actions/checkout@v4 -# -# - name: Add msbuild to PATH -# uses: microsoft/setup-msbuild@v2 -# -# - name: Fetch OpenBLAS -# if: matrix.blas == 'ON' -# run: | -# C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }} -# 7z x blas.zip -oblas -y -# copy blas/include/cblas.h . -# copy blas/include/openblas_config.h . -# echo "OPENBLAS_PATH=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV -# -# - name: Fetch SDL2 and set SDL2_DIR -# if: matrix.sdl2 == 'ON' -# run: | -# C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${{ matrix.s2ver }}/SDL2-devel-${{ matrix.s2ver }}-VC.zip -# 7z x sdl2.zip -# echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV -# -# - name: Configure -# run: > -# cmake -S . -B ./build -A ${{ matrix.arch }} -# -DCMAKE_BUILD_TYPE=${{ matrix.build }} -# -DGGML_BLAS=${{ matrix.blas }} -# -DGGML_BLAS_VENDOR=OpenBLAS -# -DCMAKE_LIBRARY_PATH="$env:OPENBLAS_PATH/lib" -# -DWHISPER_SDL2=${{ matrix.sdl2 }} -# -# - name: Build -# run: | -# cd ./build -# msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }} -# -# - name: Copy libopenblas.dll -# if: matrix.blas == 'ON' -# run: copy "$env:OPENBLAS_PATH/bin/libopenblas.dll" build/bin/${{ matrix.build }} -# -# - name: Copy SDL2.dll -# if: matrix.sdl2 == 'ON' -# run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }} -# -# - name: Upload binaries -# if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' -# uses: actions/upload-artifact@v4 -# with: -# name: whisper-blas-bin-${{ matrix.arch }} -# path: build/bin/${{ matrix.build }} + windows-blas: + runs-on: windows-latest + + strategy: + matrix: + build: [Release] + arch: [Win32, x64] + blas: [ON] + sdl2: [ON] + include: + - arch: Win32 + s2arc: x86 + - arch: x64 + s2arc: x64 + - sdl2: ON + s2ver: 2.28.5 + + steps: + - name: Clone + uses: actions/checkout@v4 + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Install OpenBLAS and pkgconfiglite + if: matrix.blas == 'ON' + run: | + vcpkg install --triplet=${{ matrix.s2arc }}-windows openblas + choco install pkgconfiglite + + - name: Fetch SDL2 and set SDL2_DIR + if: matrix.sdl2 == 'ON' + run: | + C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${{ matrix.s2ver }}/SDL2-devel-${{ matrix.s2ver }}-VC.zip + 7z x sdl2.zip + echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV + + - name: Configure + run: > + cmake -S . -B ./build -A ${{ matrix.arch }} + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" + -DCMAKE_BUILD_TYPE=${{ matrix.build }} + -DGGML_BLAS=${{ matrix.blas }} + -DGGML_BLAS_VENDOR=OpenBLAS + -DWHISPER_SDL2=${{ matrix.sdl2 }} + + - name: Build + run: | + cd ./build + msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }} + + - name: Copy openblas.dll + if: matrix.blas == 'ON' + run: copy "C:/vcpkg/packages/openblas_${{ matrix.s2arc }}-windows/bin/openblas.dll" build/bin/${{ matrix.build }} + + - name: Copy SDL2.dll + if: matrix.sdl2 == 'ON' + run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }} + + - name: Upload binaries + if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' + uses: actions/upload-artifact@v4 + with: + name: whisper-blas-bin-${{ matrix.arch }} + path: build/bin/${{ matrix.build }} windows-cublas: runs-on: windows-2019