Skip to content

Commit 2670ff9

Browse files
ggerganovtamo
authored andcommitted
ci : fix openblas build (ggml-org#2511)
* ci : fix openblas build * cont : would this work? * ci : I'm sorry, windows * cont : disabled wrong build * ci : fix openblas build with pkgconfiglite (ggml-org#2517) - choco install pkgconfiglite (vcpkg-pkgconf doesn't contain pkg-config executable?) - vcpkg install openblas (otherwise it is not detected now) --------- Co-authored-by: Tamotsu Takahashi <[email protected]>
1 parent 9bcd52a commit 2670ff9

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on: [push, pull_request]
33

44
env:
55
ubuntu_image: "ubuntu:22.04"
6+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
67

78
jobs:
89
ubuntu-latest:
@@ -308,7 +309,7 @@ jobs:
308309
- name: Build using CMake w/ OpenBLAS
309310
shell: msys2 {0}
310311
run: |
311-
cmake -B build -DGGML_OPENBLAS=ON
312+
cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
312313
cmake --build build --config ${{ matrix.build }} -j $(nproc)
313314
314315
windows:
@@ -382,10 +383,8 @@ jobs:
382383
sdl2: [ON]
383384
include:
384385
- arch: Win32
385-
obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x86.zip
386386
s2arc: x86
387387
- arch: x64
388-
obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x64.zip
389388
s2arc: x64
390389
- sdl2: ON
391390
s2ver: 2.28.5
@@ -394,17 +393,21 @@ jobs:
394393
- name: Clone
395394
uses: actions/checkout@v4
396395

396+
- name: Export GitHub Actions cache environment variables
397+
uses: actions/github-script@v7
398+
with:
399+
script: |
400+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
401+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
402+
397403
- name: Add msbuild to PATH
398404
uses: microsoft/setup-msbuild@v2
399405

400-
- name: Fetch OpenBLAS
406+
- name: Install OpenBLAS and pkgconfiglite
401407
if: matrix.blas == 'ON'
402408
run: |
403-
C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
404-
7z x blas.zip -oblas -y
405-
copy blas/include/cblas.h .
406-
copy blas/include/openblas_config.h .
407-
echo "OPENBLAS_PATH=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
409+
vcpkg install --triplet=${{ matrix.s2arc }}-windows openblas
410+
choco install pkgconfiglite
408411
409412
- name: Fetch SDL2 and set SDL2_DIR
410413
if: matrix.sdl2 == 'ON'
@@ -416,19 +419,20 @@ jobs:
416419
- name: Configure
417420
run: >
418421
cmake -S . -B ./build -A ${{ matrix.arch }}
422+
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
419423
-DCMAKE_BUILD_TYPE=${{ matrix.build }}
420-
-DGGML_OPENBLAS=${{ matrix.blas }}
421-
-DCMAKE_LIBRARY_PATH="$env:OPENBLAS_PATH/lib"
424+
-DGGML_BLAS=${{ matrix.blas }}
425+
-DGGML_BLAS_VENDOR=OpenBLAS
422426
-DWHISPER_SDL2=${{ matrix.sdl2 }}
423427
424428
- name: Build
425429
run: |
426430
cd ./build
427431
msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
428432
429-
- name: Copy libopenblas.dll
433+
- name: Copy openblas.dll
430434
if: matrix.blas == 'ON'
431-
run: copy "$env:OPENBLAS_PATH/bin/libopenblas.dll" build/bin/${{ matrix.build }}
435+
run: copy "C:/vcpkg/packages/openblas_${{ matrix.s2arc }}-windows/bin/openblas.dll" build/bin/${{ matrix.build }}
432436

433437
- name: Copy SDL2.dll
434438
if: matrix.sdl2 == 'ON'

0 commit comments

Comments
 (0)