Skip to content

Commit 6fc7ab9

Browse files
committed
update CI
1 parent c69013b commit 6fc7ab9

File tree

2 files changed

+132
-77
lines changed

2 files changed

+132
-77
lines changed

.github/workflows/build.yml

Lines changed: 131 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,9 @@ on:
1010

1111
jobs:
1212

13-
build-macos:
14-
runs-on: macos-10.15
15-
if: true
16-
env:
17-
MACOSX_DEPLOYMENT_TARGET: 10.9
18-
# MKL_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17172/m_mkl_2020.4.301.dmg
19-
steps:
20-
- uses: actions/checkout@v2
21-
- name: Get KALDI_BRANCH (kag-$TAG tag if commit is tagged; current branch name if not)
22-
run: |
23-
export TAG=$(git tag --points-at HEAD)
24-
if [[ $TAG ]]; then
25-
echo "KALDI_BRANCH=kag-$TAG" >> $GITHUB_ENV
26-
else
27-
echo "KALDI_BRANCH=${GITHUB_REF/refs\/heads\//}" >> $GITHUB_ENV
28-
fi
29-
- name: Dependencies
30-
run: |
31-
python3 -m pip install --upgrade setuptools wheel scikit-build cmake ninja
32-
brew install automake
33-
brew install autoconf
34-
brew install sox
35-
brew install libtool
36-
brew reinstall gfortran # for openblas
37-
- name: MKL
38-
if: ${{ env.MKL_URL != 0 }}
39-
run: |
40-
echo "Installing MKL from: $MKL_URL"
41-
export MKL_FILE=${MKL_URL##*/}
42-
export MKL_FILE=${MKL_FILE%\.dmg}
43-
wget --no-verbose $MKL_URL
44-
hdiutil attach ${MKL_FILE}.dmg
45-
cp /Volumes/${MKL_FILE}/${MKL_FILE}.app/Contents/MacOS/silent.cfg .
46-
sed -i.bak -e 's/decline/accept/g' silent.cfg
47-
sudo /Volumes/${MKL_FILE}/${MKL_FILE}.app/Contents/MacOS/install.sh --silent silent.cfg
48-
- run: |
49-
python3 setup.py bdist_wheel
50-
ls -al dist/
51-
- uses: actions/upload-artifact@v2
52-
with:
53-
name: wheels
54-
path: dist/*
55-
5613
build-linux:
57-
runs-on: ubuntu-18.04
58-
if: true
14+
runs-on: ubuntu-latest
15+
if: false
5916
# env:
6017
# MKL_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16917/l_mkl_2020.4.304.tgz
6118
steps:
@@ -81,16 +38,18 @@ jobs:
8138
just build-dockcross $KALDI_BRANCH $MKL_URL
8239
# cp dist/* wheelhouse/
8340
ls -al wheelhouse/
84-
- uses: actions/upload-artifact@v2
41+
- uses: actions/upload-artifact@v4
8542
with:
86-
name: wheels
43+
name: wheels-linux
8744
path: wheelhouse/*
8845

8946
build-windows:
90-
runs-on: windows-2019
47+
runs-on: windows-2025
9148
if: true
9249
env:
93-
MKL_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17173/w_mkl_2020.4.311.exe
50+
# MKL_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/307bccae-8631-4712-8999-02a8abf51994/intel-onemkl-2025.2.0.630.exe
51+
VS_VERSION: vs2022
52+
PLATFORM_TOOLSET: v143
9453
defaults:
9554
run:
9655
shell: bash
@@ -119,13 +78,13 @@ jobs:
11978
run: |
12079
echo $GITHUB_WORKSPACE
12180
df -h
122-
ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/'
123-
# ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/14.26.28720'
124-
ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/v142'
125-
# ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/14.16.27012/x64/Microsoft.VC141.CRT'
126-
ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/'*/x64/Microsoft.*.CRT
127-
# ls -alR /c/Program\ Files\ \(x86\)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/
128-
# ls -alR '/c/Program Files (x86)/Microsoft Visual Studio/'2019/Enterprise/VC/Redist/MSVC/
81+
# ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/'
82+
# ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/14.26.28720'
83+
# ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/v142'
84+
# ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/14.16.27012/x64/Microsoft.VC141.CRT'
85+
# ls -al '/c/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/'*/x64/Microsoft.*.CRT
86+
# ls -alR /c/Program\ Files\ \(x86\)/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/
87+
# ls -alR '/c/Program Files (x86)/Microsoft Visual Studio/'2022/Enterprise/VC/Redist/MSVC/
12988
vswhere
13089
vswhere -find 'VC\Redist\**\VC_redist.x64.exe'
13190
- name: Setup Kaldi build configuration
@@ -138,54 +97,150 @@ jobs:
13897
# Add openfst location
13998
perl -pi -e 's/<OPENFST>.*<\/OPENFST>/<OPENFST>$ENV{GITHUB_WORKSPACE}\\openfst<\/OPENFST>/g' variables.props
14099
perl -pi -e 's/<OPENFSTLIB>.*<\/OPENFSTLIB>/<OPENFSTLIB>$ENV{GITHUB_WORKSPACE}\\openfst\\build_output<\/OPENFSTLIB>/g' variables.props
141-
perl generate_solution.pl --vsver vs2019 --enable-mkl --noportaudio
100+
perl generate_solution.pl --vsver ${VS_VERSION} --enable-mkl --noportaudio
142101
# Add additional libfstscript library to dragonfly build file
143102
sed -i.bak '$i\
144103
<ItemDefinitionGroup>\
145104
<Link>\
146105
<AdditionalDependencies>libfstscript.lib;%(AdditionalDependencies)</AdditionalDependencies>\
147106
</Link>\
148-
</ItemDefinitionGroup>' ../kaldiwin_vs2019_MKL/kaldiwin/kaldi-dragonfly/kaldi-dragonfly.vcxproj
107+
</ItemDefinitionGroup>' ../kaldiwin_${VS_VERSION}_MKL/kaldiwin/kaldi-dragonfly/kaldi-dragonfly.vcxproj
149108
perl get_version.pl
150109
- name: Add msbuild to PATH
151110
uses: microsoft/setup-msbuild@v1.0.2
152111
- name: Install MKL
153112
if: ${{ env.MKL_URL != 0 }}
154113
run: |
155-
echo "MKL_URL: $MKL_URL"
156-
mkdir -p mkl
157-
cd mkl
158-
curl -s $MKL_URL > mkl.exe
159-
ls -al
160-
./mkl.exe --s --a install --output=$GITHUB_WORKSPACE/mkl/output.txt --eula=accept
161-
cat output.txt
114+
# echo "MKL_URL: $MKL_URL"
115+
# mkdir -p mkl
116+
# cd mkl
117+
# curl -s $MKL_URL > mkl.exe
118+
# ls -al
119+
# ./mkl.exe --s --a install --output=$GITHUB_WORKSPACE/mkl/output.txt --eula=accept
120+
# cat output.txt
121+
winget install --id=Intel.oneMKL -v "2025.1.0" -e --accept-package-agreements --accept-source-agreements --disable-interactivity
162122
- name: Build OpenFST
163-
shell: cmd
164-
run: msbuild -t:Build -p:Configuration=Release -p:Platform=x64 -p:PlatformToolset=v141 -maxCpuCount -verbosity:minimal openfst/openfst.sln
123+
# shell: cmd
124+
run: msbuild -t:Build -p:Configuration=Release -p:Platform=x64 -p:PlatformToolset=${PLATFORM_TOOLSET} -maxCpuCount -verbosity:minimal openfst/openfst.sln
165125
- name: Build Kaldi
166-
shell: cmd
167-
run: |
168-
msbuild -t:Build -p:Configuration=Release -p:Platform=x64 -p:PlatformToolset=v141 -p:WindowsTargetPlatformVersion=10.0.16299.0 -maxCpuCount -verbosity:minimal kaldi/kaldiwin_vs2019_MKL/kaldiwin/kaldi-dragonfly/kaldi-dragonfly.vcxproj
126+
# shell: cmd
127+
run: msbuild -t:Build -p:Configuration=Release -p:Platform=x64 -p:PlatformToolset=${PLATFORM_TOOLSET} -p:WindowsTargetPlatformVersion=10.0.16299.0 -maxCpuCount -verbosity:minimal kaldi/kaldiwin_${VS_VERSION}_MKL/kaldiwin/kaldi-dragonfly/kaldi-dragonfly.vcxproj
169128
- name: Build Python wheel
170129
run: |
171130
cd main
172131
python -m pip -V
173132
python -m pip install --upgrade setuptools wheel scikit-build cmake ninja
174133
# ls -alR ../
175134
mkdir -p kaldi_active_grammar/exec/windows
176-
cp ../kaldi/kaldiwin_vs2019_MKL/kaldiwin/kaldi-dragonfly/x64/Release/kaldi-dragonfly.dll kaldi_active_grammar/exec/windows/
135+
cp ../kaldi/kaldiwin_${VS_VERSION}_MKL/kaldiwin/kaldi-dragonfly/x64/Release/kaldi-dragonfly.dll kaldi_active_grammar/exec/windows/
177136
env KALDIAG_SETUP_RAW=1 python setup.py bdist_wheel
178137
ls -al dist/
179-
- uses: actions/upload-artifact@v2
138+
- uses: actions/upload-artifact@v4
180139
with:
181-
name: wheels
140+
name: wheels-windows
182141
path: main/dist/*
183142
# - name: Copy Windows vc_redist
184143
# run: |
185144
# mkdir -p vc_redist
186-
# cp '/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/14.26.28720'/vc_redist.x64.exe vc_redist/
187-
# cp '/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/14.26.28720'/x64/Microsoft.*.CRT/* vc_redist/
188-
# - uses: actions/upload-artifact@v2
145+
# cp '/c/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/14.26.28720'/vc_redist.x64.exe vc_redist/
146+
# cp '/c/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/14.26.28720'/x64/Microsoft.*.CRT/* vc_redist/
147+
# - uses: actions/upload-artifact@v4
189148
# with:
190149
# name: vc_redist
191150
# path: vc_redist/*
151+
152+
build-macos-arm:
153+
runs-on: macos-15
154+
if: false
155+
env:
156+
MACOSX_DEPLOYMENT_TARGET: 11.0
157+
# MKL_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17172/m_mkl_2020.4.301.dmg
158+
steps:
159+
- uses: actions/checkout@v2
160+
- name: Get KALDI_BRANCH (kag-$TAG tag if commit is tagged; current branch name if not)
161+
run: |
162+
export TAG=$(git tag --points-at HEAD)
163+
if [[ $TAG ]]; then
164+
echo "KALDI_BRANCH=kag-$TAG" >> $GITHUB_ENV
165+
else
166+
echo "KALDI_BRANCH=${GITHUB_REF/refs\/heads\//}" >> $GITHUB_ENV
167+
fi
168+
- name: Dependencies
169+
run: |
170+
python3 -m pip install --break-system-packages --user --upgrade setuptools wheel scikit-build cmake ninja
171+
brew install automake
172+
brew install autoconf
173+
brew install sox
174+
brew install libtool
175+
brew reinstall gfortran # for openblas
176+
- name: MKL
177+
if: ${{ env.MKL_URL != 0 }}
178+
run: |
179+
echo "Installing MKL from: $MKL_URL"
180+
export MKL_FILE=${MKL_URL##*/}
181+
export MKL_FILE=${MKL_FILE%\.dmg}
182+
wget --no-verbose $MKL_URL
183+
hdiutil attach ${MKL_FILE}.dmg
184+
cp /Volumes/${MKL_FILE}/${MKL_FILE}.app/Contents/MacOS/silent.cfg .
185+
sed -i.bak -e 's/decline/accept/g' silent.cfg
186+
sudo /Volumes/${MKL_FILE}/${MKL_FILE}.app/Contents/MacOS/install.sh --silent silent.cfg
187+
- run: |
188+
python3 setup.py bdist_wheel
189+
ls -al dist/
190+
- uses: actions/upload-artifact@v4
191+
with:
192+
name: wheels-macos-arm
193+
path: dist/*
194+
195+
build-macos-intel:
196+
runs-on: macos-13
197+
if: false
198+
env:
199+
MACOSX_DEPLOYMENT_TARGET: 10.9
200+
# MKL_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17172/m_mkl_2020.4.301.dmg
201+
steps:
202+
- uses: actions/checkout@v2
203+
- name: Get KALDI_BRANCH (kag-$TAG tag if commit is tagged; current branch name if not)
204+
run: |
205+
export TAG=$(git tag --points-at HEAD)
206+
if [[ $TAG ]]; then
207+
echo "KALDI_BRANCH=kag-$TAG" >> $GITHUB_ENV
208+
else
209+
echo "KALDI_BRANCH=${GITHUB_REF/refs\/heads\//}" >> $GITHUB_ENV
210+
fi
211+
- name: Dependencies
212+
run: |
213+
python3 -m pip install --break-system-packages --user --upgrade setuptools wheel scikit-build cmake ninja
214+
brew install automake
215+
brew install autoconf
216+
brew install sox
217+
brew install libtool
218+
brew reinstall gfortran # for openblas
219+
- name: MKL
220+
if: ${{ env.MKL_URL != 0 }}
221+
run: |
222+
echo "Installing MKL from: $MKL_URL"
223+
export MKL_FILE=${MKL_URL##*/}
224+
export MKL_FILE=${MKL_FILE%\.dmg}
225+
wget --no-verbose $MKL_URL
226+
hdiutil attach ${MKL_FILE}.dmg
227+
cp /Volumes/${MKL_FILE}/${MKL_FILE}.app/Contents/MacOS/silent.cfg .
228+
sed -i.bak -e 's/decline/accept/g' silent.cfg
229+
sudo /Volumes/${MKL_FILE}/${MKL_FILE}.app/Contents/MacOS/install.sh --silent silent.cfg
230+
- run: |
231+
python3 setup.py bdist_wheel
232+
ls -al dist/
233+
- uses: actions/upload-artifact@v4
234+
with:
235+
name: wheels-macos-intel
236+
path: dist/*
237+
238+
merge-wheels:
239+
runs-on: ubuntu-latest
240+
needs: [build-linux, build-windows, build-macos-arm, build-macos-intel]
241+
steps:
242+
- uses: actions/upload-artifact/merge@v4
243+
with:
244+
name: wheels
245+
pattern: wheels-*
246+
delete-merged: true # Optional: removes the individual artifacts

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ else()
6969
message("Compiling with OpenBLAS")
7070
set(KALDI_CONFIG_FLAGS --shared --static-math --use-cuda=no --mathlib=OPENBLAS)
7171
set(MATHLIB_BUILD_COMMAND cd tools
72-
&& git clone -b v0.3.13 --single-branch https://github.com/xianyi/OpenBLAS
72+
&& git clone -b v0.3.13 --single-branch https://github.com/OpenMathLib/OpenBLAS
7373
&& ${MAKE_EXE} ${MAKE_FLAGS} -C OpenBLAS DYNAMIC_ARCH=1 TARGET=GENERIC USE_LOCKING=1 USE_THREAD=0 all
7474
&& ${MAKE_EXE} ${MAKE_FLAGS} -C OpenBLAS PREFIX=install install
7575
&& cd ..)

0 commit comments

Comments
 (0)