Files
2026-07-13 12:45:58 +08:00

66 lines
2.3 KiB
Docker

FROM debian:11
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
g++ \
bzip2 \
unzip \
make \
wget \
git \
python3 \
python3-pip \
python3-wheel \
python3-setuptools \
python3-cffi \
zlib1g-dev \
patch \
cmake \
xz-utils \
automake \
autoconf \
libtool \
pkg-config \
sudo \
g++-mingw-w64-i686 \
g++-mingw-w64-x86-64 \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /opt/kaldi \
&& git clone https://github.com/alphacep/openfst \
&& cd openfst \
&& autoreconf -i \
&& CXX=x86_64-w64-mingw32-g++-posix CXXFLAGS="-O3 -ftree-vectorize -DFST_NO_DYNAMIC_LINKING" \
./configure --prefix=/opt/kaldi/local \
--enable-shared --enable-static --with-pic --disable-bin \
--enable-lookahead-fsts --enable-ngram-fsts --host=x86_64-w64-mingw32 \
&& make -j $(nproc) \
&& make install
RUN cd /opt/kaldi \
&& git clone -b v0.3.20 --single-branch https://github.com/xianyi/OpenBLAS \
&& cd OpenBLAS \
&& make HOSTCC=gcc BINARY=64 CC=x86_64-w64-mingw32-gcc ONLY_CBLAS=1 DYNAMIC_ARCH=1 TARGET=NEHALEM USE_LOCKING=1 USE_THREAD=0 -j $(nproc) \
&& make PREFIX=/opt/kaldi/local install
RUN cd /opt/kaldi \
&& git clone -b v3.2.1 --single-branch https://github.com/alphacep/clapack \
&& mkdir clapack/BUILD \
&& cd clapack/BUILD \
&& cmake -DCMAKE_C_COMPILER_TARGET=x86_64-w64-mingw32 -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc-posix -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CROSSCOMPILING=True .. \
&& make -C F2CLIBS/libf2c \
&& make -C BLAS \
&& make -C SRC \
&& find . -name *.a -exec cp {} /opt/kaldi/local/lib \;
RUN cd /opt/kaldi \
&& git clone -b vosk-android --single-branch https://github.com/alphacep/kaldi \
&& cd kaldi/src \
&& CXX=x86_64-w64-mingw32-g++-posix CXXFLAGS="-O3 -ftree-vectorize -DFST_NO_DYNAMIC_LINKING" ./configure --shared --mingw=yes --use-cuda=no \
--mathlib=OPENBLAS_CLAPACK \
--host=x86_64-w64-mingw32 --openblas-clapack-root=/opt/kaldi/local \
--fst-root=/opt/kaldi/local --fst-version=1.8.0 \
&& make depend -j \
&& make -j $(nproc) online2 rnnlm