ggerganov Tamotsu Takahashi commited on
Commit
b116fe7
·
unverified ·
1 Parent(s): e923761

ci : fix openblas build (#2511)

Browse files

* ci : fix openblas build

* cont : would this work?

* ci : I'm sorry, windows

* cont : disabled wrong build

* ci : fix openblas build with pkgconfiglite (#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]>

Files changed (1) hide show
  1. .github/workflows/build.yml +17 -13
.github/workflows/build.yml CHANGED
@@ -3,6 +3,7 @@ on: [push, pull_request]
3
 
4
  env:
5
  ubuntu_image: "ubuntu:22.04"
 
6
 
7
  jobs:
8
  ubuntu-latest:
@@ -308,7 +309,7 @@ jobs:
308
  - name: Build using CMake w/ OpenBLAS
309
  shell: msys2 {0}
310
  run: |
311
- cmake -B build -DGGML_OPENBLAS=ON
312
  cmake --build build --config ${{ matrix.build }} -j $(nproc)
313
 
314
  windows:
@@ -382,10 +383,8 @@ jobs:
382
  sdl2: [ON]
383
  include:
384
  - arch: Win32
385
- obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x86.zip
386
  s2arc: x86
387
  - arch: x64
388
- obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x64.zip
389
  s2arc: x64
390
  - sdl2: ON
391
  s2ver: 2.28.5
@@ -394,17 +393,21 @@ jobs:
394
  - name: Clone
395
  uses: actions/checkout@v4
396
 
 
 
 
 
 
 
 
397
  - name: Add msbuild to PATH
398
  uses: microsoft/setup-msbuild@v2
399
 
400
- - name: Fetch OpenBLAS
401
  if: matrix.blas == 'ON'
402
  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
408
 
409
  - name: Fetch SDL2 and set SDL2_DIR
410
  if: matrix.sdl2 == 'ON'
@@ -416,9 +419,10 @@ jobs:
416
  - name: Configure
417
  run: >
418
  cmake -S . -B ./build -A ${{ matrix.arch }}
 
419
  -DCMAKE_BUILD_TYPE=${{ matrix.build }}
420
- -DGGML_OPENBLAS=${{ matrix.blas }}
421
- -DCMAKE_LIBRARY_PATH="$env:OPENBLAS_PATH/lib"
422
  -DWHISPER_SDL2=${{ matrix.sdl2 }}
423
 
424
  - name: Build
@@ -426,9 +430,9 @@ jobs:
426
  cd ./build
427
  msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
428
 
429
- - name: Copy libopenblas.dll
430
  if: matrix.blas == 'ON'
431
- run: copy "$env:OPENBLAS_PATH/bin/libopenblas.dll" build/bin/${{ matrix.build }}
432
 
433
  - name: Copy SDL2.dll
434
  if: matrix.sdl2 == 'ON'
 
3
 
4
  env:
5
  ubuntu_image: "ubuntu:22.04"
6
+ VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
7
 
8
  jobs:
9
  ubuntu-latest:
 
309
  - name: Build using CMake w/ OpenBLAS
310
  shell: msys2 {0}
311
  run: |
312
+ cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
313
  cmake --build build --config ${{ matrix.build }} -j $(nproc)
314
 
315
  windows:
 
383
  sdl2: [ON]
384
  include:
385
  - arch: Win32
 
386
  s2arc: x86
387
  - arch: x64
 
388
  s2arc: x64
389
  - sdl2: ON
390
  s2ver: 2.28.5
 
393
  - name: Clone
394
  uses: actions/checkout@v4
395
 
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
+
403
  - name: Add msbuild to PATH
404
  uses: microsoft/setup-msbuild@v2
405
 
406
+ - name: Install OpenBLAS and pkgconfiglite
407
  if: matrix.blas == 'ON'
408
  run: |
409
+ vcpkg install --triplet=${{ matrix.s2arc }}-windows openblas
410
+ choco install pkgconfiglite
 
 
 
411
 
412
  - name: Fetch SDL2 and set SDL2_DIR
413
  if: matrix.sdl2 == 'ON'
 
419
  - name: Configure
420
  run: >
421
  cmake -S . -B ./build -A ${{ matrix.arch }}
422
+ -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
423
  -DCMAKE_BUILD_TYPE=${{ matrix.build }}
424
+ -DGGML_BLAS=${{ matrix.blas }}
425
+ -DGGML_BLAS_VENDOR=OpenBLAS
426
  -DWHISPER_SDL2=${{ matrix.sdl2 }}
427
 
428
  - name: Build
 
430
  cd ./build
431
  msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
432
 
433
+ - name: Copy openblas.dll
434
  if: matrix.blas == 'ON'
435
+ run: copy "C:/vcpkg/packages/openblas_${{ matrix.s2arc }}-windows/bin/openblas.dll" build/bin/${{ matrix.build }}
436
 
437
  - name: Copy SDL2.dll
438
  if: matrix.sdl2 == 'ON'