Skip to content

Commit

Permalink
Add win32 wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
nshmyrev committed Feb 7, 2021
1 parent 3d1e21d commit 415d192
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
3 changes: 3 additions & 0 deletions travis/Dockerfile.win
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ RUN apt-get update && \
git \
python3 \
python3-pip \
python3-wheel \
python3-setuptools \
python3-cffi \
zlib1g-dev \
patch \
cmake \
Expand Down
9 changes: 4 additions & 5 deletions travis/Dockerfile.win32
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ RUN apt-get update && \
wget \
git \
python3 \
python3-pip \
python3-wheel \
python3-setuptools \
python3-cffi \
zlib1g-dev \
patch \
cmake \
Expand Down Expand Up @@ -58,8 +62,3 @@ RUN cd /opt/kaldi \
--fst-root=/opt/kaldi/local --fst-version=1.8.0 \
&& make depend -j \
&& make -j $(nproc) online2 lm

RUN cd /opt/kaldi \
&& git clone https://github.com/alphacep/vosk-api \
&& cd vosk-api/src \
&& make -j $(nproc) CXX=i686-w64-mingw32-g++-posix EXT=dll KALDI_ROOT=/opt/kaldi/kaldi OPENFST_ROOT=/opt/kaldi/local OPENBLAS_ROOT=/opt/kaldi/local
5 changes: 5 additions & 0 deletions travis/build-docker-win32.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e -x
docker build --file Dockerfile.win32 --tag alphacep/kaldi-win32:latest .
docker run --rm -v `realpath ..`:/io alphacep/kaldi-win32 /io/travis/build-wheels-win32.sh
1 change: 0 additions & 1 deletion travis/build-wheels-win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /opt/vosk-api/src
export VOSK_SOURCE=/opt/vosk-api
export VOSK_PLATFORM=Windows
export VOSK_ARCHITECTURE=64bit
pip3 install wheel setuptools
python3 -m pip -v wheel /opt/vosk-api/python --no-deps -w /io/wheelhouse
16 changes: 16 additions & 0 deletions travis/build-wheels-win32.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e -x

cd /opt
git clone https://github.com/alphacep/vosk-api
cd vosk-api/src
CXX=i686-w64-mingw32-g++-posix EXT=dll KALDI_ROOT=/opt/kaldi/kaldi OPENFST_ROOT=/opt/kaldi/local OPENBLAS_ROOT=/opt/kaldi/local make -j $(nproc)

cp /usr/lib/gcc/i686-w64-mingw32/*-posix/libstdc++-6.dll /opt/vosk-api/src
cp /usr/lib/gcc/i686-w64-mingw32/*-posix/libgcc_s_sjlj-1.dll /opt/vosk-api/src
cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll /opt/vosk-api/src

export VOSK_SOURCE=/opt/vosk-api
export VOSK_PLATFORM=Windows
export VOSK_ARCHITECTURE=32bit
python3 -m pip -v wheel /opt/vosk-api/python --no-deps -w /io/wheelhouse

0 comments on commit 415d192

Please sign in to comment.