Tamotsu Takahashi commited on
Commit
71bf396
·
1 Parent(s): f500082

Build with OpenBLAS and SDL2 on windows

Browse files
Files changed (1) hide show
  1. .github/workflows/build.yml +50 -9
.github/workflows/build.yml CHANGED
@@ -119,7 +119,19 @@ jobs:
119
 
120
  strategy:
121
  matrix:
122
- arch: ["Win32", "x64"]
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  steps:
125
  - name: Clone
@@ -128,17 +140,46 @@ jobs:
128
  - name: Add msbuild to PATH
129
  uses: microsoft/setup-msbuild@v1
130
 
131
- - name: CMake
132
- shell: powershell
133
- run: cmake -S . -B ./build_${{matrix.arch}} -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=Release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
- - name: MSBuild
136
  run: |
137
- cd ./build_${{matrix.arch}}
138
- msbuild INSTALL.vcxproj /t:build /p:configuration=Release /p:platform=${{matrix.arch}} -maxcpucount
 
 
 
 
 
 
 
 
139
 
140
  - name: Upload binaries
 
141
  uses: actions/upload-artifact@v1
142
  with:
143
- name: whisper-bin-${{matrix.arch}}
144
- path: build_${{matrix.arch}}/bin/Release
 
119
 
120
  strategy:
121
  matrix:
122
+ build: [RelWithDebInfo]
123
+ arch: [Win32, x64]
124
+ blas: [ON]
125
+ sdl2: [ON]
126
+ include:
127
+ - arch: Win32
128
+ obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
129
+ s2arc: x86
130
+ - arch: x64
131
+ obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
132
+ s2arc: x64
133
+ - sdl2: ON
134
+ s2ver: 2.26.0
135
 
136
  steps:
137
  - name: Clone
 
140
  - name: Add msbuild to PATH
141
  uses: microsoft/setup-msbuild@v1
142
 
143
+ - name: Fetch OpenBLAS
144
+ if: matrix.blas == 'ON'
145
+ run: |
146
+ C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
147
+ 7z x blas.zip -oblas -y
148
+ copy blas/include/cblas.h .
149
+ copy blas/include/openblas_config.h .
150
+ echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
151
+
152
+ - name: Fetch SDL2 and set SDL2_DIR
153
+ if: matrix.sdl2 == 'ON'
154
+ run: |
155
+ 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
156
+ 7z x sdl2.zip
157
+ echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV
158
+
159
+ - name: Configure
160
+ run: >
161
+ cmake -S . -B ./build -A ${{ matrix.arch }}
162
+ -DCMAKE_BUILD_TYPE=${{ matrix.build }}
163
+ -DWHISPER_SUPPORT_OPENBLAS=${{ matrix.blas }}
164
+ -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
165
+ -DWHISPER_SUPPORT_SDL2=${{ matrix.sdl2 }}
166
 
167
+ - name: Build
168
  run: |
169
+ cd ./build
170
+ msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
171
+
172
+ - name: Copy libopenblas.dll
173
+ if: matrix.blas == 'ON'
174
+ run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
175
+
176
+ - name: Copy SDL2.dll
177
+ if: matrix.sdl2 == 'ON'
178
+ run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }}
179
 
180
  - name: Upload binaries
181
+ if: matrix.blas == 'ON' && matrix.sdl2 == 'ON'
182
  uses: actions/upload-artifact@v1
183
  with:
184
+ name: whisper-bin-${{ matrix.arch }}
185
+ path: build/bin/${{ matrix.build }}