Skip to content

Commit

Permalink
Remove armv6, too slow anyway. Build with new dockcross.
Browse files Browse the repository at this point in the history
  • Loading branch information
nshmyrev committed Jan 6, 2021
1 parent 02b7312 commit 9d398ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def run(self):
'src/base/kaldi-base.a',
'tools/openfst/lib/libfst.a',
'tools/openfst/lib/libfstngram.a']
kaldi_link_args = ['-s']
kaldi_link_args = ['-s', '-latomic', '-lpthread', '-lm']
kaldi_libraries = []

if sys.platform.startswith('darwin'):
Expand All @@ -71,7 +71,7 @@ def run(self):
extra_objects = [kaldi_root + '/' + x for x in kaldi_static_libs],
sources = ['vosk/' + x for x in sources],
extra_link_args = kaldi_link_args,
extra_compile_args = ['-std=c++17', '-Wno-sign-compare', '-Wno-unused-variable', '-Wno-unused-local-typedefs'])
extra_compile_args = ['-O3', '-std=c++17', '-Wno-sign-compare', '-Wno-unused-variable', '-Wno-unused-local-typedefs'])

setuptools.setup(
name="vosk",
Expand Down
13 changes: 9 additions & 4 deletions travis/Dockerfile.dockcross
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN apt-get update && \
automake \
autoconf \
libtool \
cmake \
&& rm -rf /var/lib/apt/lists/*

RUN cd /opt \
Expand Down Expand Up @@ -86,11 +87,15 @@ RUN cd /opt \
ARG OPENBLAS_ARCH=ARMV7
ARG ARM_HARDWARE_OPTS="-mfloat-abi=hard -mfpu=neon"
RUN cd /opt \
&& git clone -b lookahead --single-branch https://github.com/alphacep/kaldi \
&& git clone -b lookahead-1.8.0 --single-branch https://github.com/alphacep/kaldi \
&& cd kaldi/tools \
&& git clone -b v0.3.7 --single-branch https://github.com/xianyi/OpenBLAS \
&& make PREFIX=$(pwd)/OpenBLAS/install TARGET="${OPENBLAS_ARCH}" HOSTCC=gcc USE_LOCKING=1 USE_THREAD=0 -C OpenBLAS all install \
&& git clone -b old-gcc --single-branch https://github.com/alphacep/openfst openfst \
&& git clone -b v0.3.13 --single-branch https://github.com/xianyi/OpenBLAS \
&& git clone -b v3.2.1 --single-branch https://github.com/alphacep/clapack \
&& make -C OpenBLAS ONLY_CBLAS=1 TARGET="${OPENBLAS_ARCH}" HOSTCC=gcc USE_LOCKING=1 USE_THREAD=0 all \
&& make -C OpenBLAS PREFIX=$(pwd)/OpenBLAS/install install \
&& mkdir -p clapack/BUILD && cd clapack/BUILD && cmake .. && make -j 10 && find . -name "*.a" | xargs cp -t ../../OpenBLAS/install/lib \
&& cd /opt/kaldi/tools \
&& git clone --single-branch https://github.com/alphacep/openfst openfst \
&& cd openfst \
&& autoreconf -i \
&& ./configure --prefix=/opt/kaldi/tools/openfst --enable-static --enable-shared --enable-far --enable-ngram-fsts --enable-lookahead-fsts --with-pic --disable-bin --host=${CROSS_TRIPLE} --build=x86-linux-gnu \
Expand Down
2 changes: 0 additions & 2 deletions travis/build-dockcross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set -e
set -x

docker build --build-arg="DOCKCROSS_IMAGE=linux-armv7" --build-arg="OPENBLAS_ARCH=ARMV7" --file Dockerfile.dockcross --tag alphacep/kaldi-dockcross-armv7:latest .
docker build --build-arg="DOCKCROSS_IMAGE=linux-armv6" --build-arg="OPENBLAS_ARCH=ARMV6" --build-arg="ARM_HARDWARE_OPTS=" --file Dockerfile.dockcross --tag alphacep/kaldi-dockcross-armv6:latest .
docker build --build-arg="DOCKCROSS_IMAGE=linux-arm64" --build-arg="OPENBLAS_ARCH=ARMV8" --file Dockerfile.dockcross --tag alphacep/kaldi-dockcross-arm64:latest .

docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-armv6 /io/travis/build-wheels-dockcross.sh
docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-armv7 /io/travis/build-wheels-dockcross.sh
docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-arm64 /io/travis/build-wheels-dockcross.sh
3 changes: 3 additions & 0 deletions travis/build-wheels-dockcross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ for pyver in 3.6 3.7 3.8; do
if [ $pyver == "3.8" ]; then
sysconfig_bit=""
fi
if [ $pyver == "3.9" ]; then
sysconfig_bit=""
fi

case $CROSS_TRIPLE in
*arm-*)
Expand Down

0 comments on commit 9d398ef

Please sign in to comment.