alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
8k stars 1.11k forks source link

vosk on riscv #989

Closed kush930 closed 2 years ago

kush930 commented 2 years ago

Hi all,

I want to build vosk-0.3.42 speech recognition on Riscv platform using pip3 , please anyone tell me the steps to build vosk on Riscv platform, I am using python3 version-3.8.5 and pip3 version 20.0.2 .

$ pip3 install vosk

I am getting below error

ERROR: Could not find a version that satisfies the requirement vosk (from versions: none) ERROR: No matching distribution found for vosk

T&R Kush

nshmyrev commented 2 years ago

Easiest way would be to use dockcross, like here:

https://github.com/alphacep/vosk-api/blob/master/travis/Dockerfile.dockcross https://github.com/alphacep/vosk-api/blob/master/travis/build-dockcross.sh

just use dockcross/risv64 architecture.

kush930 commented 2 years ago

Hi nshmyrev ,

Thanks for your suggestion, it worked fine for buillding vosk on Riscv platform. i successfully completed without any error

when i am running command to verify vosk, getting issue-

>>> import vosk Traceback (most recent call last): File "", line 1, in File "/home/root/vosk-api/python/vosk/init.py", line 9, in from .vosk_cffi import ffi as _ffi ModuleNotFoundError: No module named 'vosk.vosk_cffi'**

**

T&R Kush

nshmyrev commented 2 years ago

I've also uploaded https://github.com/alphacep/vosk-api/releases/download/v0.3.42/vosk-0.3.42-py3-none-linux_riscv64.whl

and updated the build scripts

kush930 commented 2 years ago

Hi nshmyrev,

I am following this procedure, facing this issue-

root@kush-Linux-1:~# python3 -m pip install vosk-0.3.42-py3-none-linux_riscv64.whl

Processing ./vosk-0.3.42-py3-none-linux_riscv64.whl Requirement already satisfied: cffi>=1.0 in /usr/lib/python3.8/site-packages (from vosk==0.3.42) (1.14.3) Requirement already satisfied: srt in /usr/lib/python3.8/site-packages (from vosk==0.3.42) (3.5.2) Requirement already satisfied: tqdm in /usr/lib/python3.8/site-packages (from vosk==0.3.42) (4.64.0) Requirement already satisfied: requests in /usr/lib/python3.8/site-packages (from vosk==0.3.42) (2.27.1) Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi>=1.0->vosk==0.3.42) (2.20) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.8/site-packages (from requests->vosk==0.3.42) (1.26.9) Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in /usr/lib/python3.8/site-packages (from requests->vosk==0.3.42) (2.0.12) Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.8/site-packages (from requests->vosk==0.3.42) (2022.5.18.1) Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in /usr/lib/python3.8/site-packages (from requests->vosk==0.3.42) (3.3) Installing collected packages: vosk Successfully installed vosk-0.3.42

root@kush-Linux-1:~# python3 Python 3.8.5 (default, May 24 2022, 07:20:33) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import vosk Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/site-packages/vosk/init.py", line 32, in _c = open_dll() File "/usr/lib/python3.8/site-packages/vosk/init.py", line 26, in open_dll return _ffi.dlopen(os.path.join(dlldir, "libvosk.so")) OSError: cannot load library '/usr/lib/python3.8/site-packages/vosk/libvosk.so': /lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/python3.8/site-packages/vosk/libvosk.so)

I am using glibc-2.32 version.

T&R Kush

nshmyrev commented 2 years ago

I am using glibc-2.32 version.

Maybe you can upgrade this or use older dockcross image for build.

kush930 commented 2 years ago

Hi nshmyrev,

As per your suggestion, i upgraded glibc-2.34 and got issue-

root@kush-Linux-1:~# python3 Python 3.8.5 (default, May 24 2022, 07:20:33) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

>>> import vosk Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/site-packages/vosk/init.py", line 32, in _c = open_dll() File "/usr/lib/python3.8/site-packages/vosk/init.py", line 26, in open_dll return _ffi.dlopen(os.path.join(dlldir, "libvosk.so")) OSError: cannot load library '/usr/lib/python3.8/site-packages/vosk/libvosk.so': /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/python3.8/site-packages/vosk/libvosk.so)

T&R Kush

nshmyrev commented 2 years ago

Nice, now you need newer libstdc++

kush930 commented 2 years ago

Hi nshmyrev,

I cant update gcc for libstdc++ because we are using gcc-10.2 version and glibc-2.32 version, for that i want to try lower version of vosk can u please suggest me which version of vosk is compatible for gcc-10.2 and glibc-2.32

please help me to build, through what steps u tried for building vosk , so that i can try those steps and build it on riscv64 platform

T&R Kush

nshmyrev commented 2 years ago

Build steps are in docker file https://github.com/alphacep/vosk-api/blob/master/travis/Dockerfile.dockcross and post-docker script https://github.com/alphacep/vosk-api/blob/master/travis/build-wheels-dockcross.sh

kush930 commented 2 years ago

Hi nshmyrev,

As per your suggestion, I tried to build vosk on riscv64 platform, but i faced issue-- can you help me to build vosk on riscv64.

root@kush-Linux-1:~/vosk-api/travis# **./build-wheels-dockcross.sh** 

+ cd /opt
+ git clone https://github.com/alphacep/vosk-api
Cloning into 'vosk-api'...
remote: Enumerating objects: 3114, done.
remote: Counting objects: 100% (216/216), done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 3114 (delta 111), reused 190 (delta 95), pack-reused 2898
Receiving objects: 100% (3114/3114), 756.94 KiB | 4.48 MiB/s, done.
Resolving deltas: 100% (1760/1760), done.
+ cd /opt/vosk-api/src
++ nproc
+ KALDI_ROOT=/opt/kaldi
+ EXTRA_LDFLAGS=-latomic
+ make -j 4
g++ -g -O3 -std=c++17 -Wno-deprecated-declarations -fPIC -DFST_NO_DYNAMIC_LINKING -I. -I/opt/kaldi/src -I/opt/kaldi/tools/openfst/include  -Ic
g++ -g -O3 -std=c++17 -Wno-deprecated-declarations -fPIC -DFST_NO_DYNAMIC_LINKING -I. -I/opt/kaldi/src -I/opt/kaldi/tools/openfst/include  -Ic
g++ -g -O3 -std=c++17 -Wno-deprecated-declarations -fPIC -DFST_NO_DYNAMIC_LINKING -I. -I/opt/kaldi/src -I/opt/kaldi/tools/openfst/include  -Ic
g++ -g -O3 -std=c++17 -Wno-deprecated-declarations -fPIC -DFST_NO_DYNAMIC_LINKING -I. -I/opt/kaldi/src -I/opt/kaldi/tools/openfst/include  -Ic
**model.cc:25:10: fatal error: fst/extensions/ngram/ngram-fst.h: No such file or directory**
   **25 | #include <fst/extensions/ngram/ngram-fst.h>**
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**compilation terminated.**
**make: *** [Makefile:112: model.o] Error 1**

T&R Kush

nshmyrev commented 2 years ago

fst/extensions/ngram/ngram-fst.h

The file must be there, go to openfst include folder and check that file exists. If doesn't repeat openfst build part.

nshmyrev commented 2 years ago

could not load PERL module File::Temp, so could not check compiler compatibility with C11

Install perl in your system

nshmyrev commented 2 years ago

I believe you need to specify ARCH=risv64 instead of OPENBLAS_ARGS, you didn't specify arch atall

kush930 commented 2 years ago

Hi nshmyrev,

I changed OPENBLAS_ARGS into ARCH=riscv64, facing issue, output log I am attaching here

root@kush-Linux-1:/opt/kaldi/tools# make -C OpenBLAS ONLY_CBLAS=1 ${ARCH=riscv64} HOSTCC=gcc USE_LOCKING=1 USE_THREAD=0 all

make: Entering directory '/opt/kaldi/tools/OpenBLAS' getarch_2nd.c: In function 'main': getarch_2nd.c:22:35: error: 'SGEMM_DEFAULT_UNROLL_M' undeclared (first use in this function); did you mean 'SBGEMM_DEFAULT_UNROLL_M'? 22 | printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M); | ^~~~~~~~~~~~~~~~~~~~~~ | SBGEMM_DEFAULT_UNROLL_M getarch_2nd.c:22:35: note: each undeclared identifier is reported only once for each function it appears in getarch_2nd.c:23:35: error: 'SGEMM_DEFAULT_UNROLL_N' undeclared (first use in this function); did you mean 'SBGEMM_DEFAULT_UNROLL_N'? 23 | printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N); | ^~~~~~~~~~~~~~~~~~~~~~ | SBGEMM_DEFAULT_UNROLL_N getarch_2nd.c:24:35: error: 'DGEMM_DEFAULT_UNROLL_M' undeclared (first use in this function); did you mean 'XGEMM_DEFAULT_UNROLL_M'? 24 | printf("DGEMM_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M); | ^~~~~~~~~~~~~~~~~~~~~~ | XGEMM_DEFAULT_UNROLL_M getarch_2nd.c:25:35: error: 'DGEMM_DEFAULT_UNROLL_N' undeclared (first use in this function); did you mean 'XGEMM_DEFAULT_UNROLL_N'? 25 | printf("DGEMM_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N); | ^~~~~~~~~~~~~~~~~~~~~~ | XGEMM_DEFAULT_UNROLL_N getarch_2nd.c:29:35: error: 'CGEMM_DEFAULT_UNROLL_M' undeclared (first use in this function); did you mean 'XGEMM_DEFAULT_UNROLL_M'? 29 | printf("CGEMM_UNROLL_M=%d\n", CGEMM_DEFAULT_UNROLL_M); | ^~~~~~~~~~~~~~~~~~~~~~ | XGEMM_DEFAULT_UNROLL_M getarch_2nd.c:30:35: error: 'CGEMM_DEFAULT_UNROLL_N' undeclared (first use in this function); did you mean 'XGEMM_DEFAULT_UNROLL_N'? 30 | printf("CGEMM_UNROLL_N=%d\n", CGEMM_DEFAULT_UNROLL_N); | ^~~~~~~~~~~~~~~~~~~~~~ | XGEMM_DEFAULT_UNROLL_N getarch_2nd.c:31:35: error: 'ZGEMM_DEFAULT_UNROLL_M' undeclared (first use in this function); did you mean 'XGEMM_DEFAULT_UNROLL_M'? 31 | printf("ZGEMM_UNROLL_M=%d\n", ZGEMM_DEFAULT_UNROLL_M); | ^~~~~~~~~~~~~~~~~~~~~~ | XGEMM_DEFAULT_UNROLL_M getarch_2nd.c:32:35: error: 'ZGEMM_DEFAULT_UNROLL_N' undeclared (first use in this function); did you mean 'XGEMM_DEFAULT_UNROLL_N'? 32 | printf("ZGEMM_UNROLL_N=%d\n", ZGEMM_DEFAULT_UNROLL_N); | ^~~~~~~~~~~~~~~~~~~~~~ | XGEMM_DEFAULT_UNROLL_N getarch_2nd.c:39:6: error: invalid preprocessing directive #printf 39 | # printf("CGEMM3M_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M); | ^~~~~~ getarch_2nd.c:45:6: error: invalid preprocessing directive #printf 45 | # printf("CGEMM3M_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N); | ^~~~~~ getarch_2nd.c:51:6: error: invalid preprocessing directive #printf 51 | # printf("ZGEMM3M_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M); | ^~~~~~ getarch_2nd.c:57:6: error: invalid preprocessing directive #printf 57 | # printf("ZGEMM3M_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N); | ^~~~~~ make: *** [Makefile.prebuild:78: getarch_2nd] Error 1 make: *** No rule to make target 'risv64'. Stop. make: Leaving directory '/opt/kaldi/tools/OpenBLAS'

T&R Kush

nshmyrev commented 2 years ago

Instead ${ARCH=riscv64} you should use TARGET=RISCV64_GENERIC ARCH=riscv64 as in our docker

nshmyrev commented 2 years ago

It seems you edited that source yourself somehow, I suggest you to start from a clean checkout.

I also recommend you to close https://github.com/xianyi/OpenBLAS/issues/3646

kush930 commented 2 years ago

Hi nshmyrev,

Thanks for your help, openblas builded successfully. now i am facing issue here can you help me where i am wrong.

root@kush-Linux-1:/opt/kaldi/src# make -j 4 online2 lm rnnlm

test -d /opt/kaldi/src/lib || mkdir /opt/kaldi/src/lib The version of configure script matches kaldi.mk version. Good. make -C base make[1]: Entering directory '/opt/kaldi/src/base' c++ -std=c++17 -I.. -isystem /opt/kaldi/tools/openfst/include -O1 -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_OPENBLAS -I/opt/kaldi/tools/OpenBLAS/install/include -msse -msse2 -pthread -g -fPIC -DUSE_KALDI_SVD -c -o kaldi-math.o kaldi-math.cc c++ -std=c++17 -I.. -isystem /opt/kaldi/tools/openfst/include -O1 -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_OPENBLAS -I/opt/kaldi/tools/OpenBLAS/install/include -msse -msse2 -pthread -g -fPIC -DUSE_KALDI_SVD -c -o kaldi-error.o kaldi-error.cc c++ -std=c++17 -I.. -isystem /opt/kaldi/tools/openfst/include -O1 -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_OPENBLAS -I/opt/kaldi/tools/OpenBLAS/install/include -msse -msse2 -pthread -g -fPIC -DUSE_KALDI_SVD -c -o io-funcs.o io-funcs.cc c++ -std=c++17 -I.. -isystem /opt/kaldi/tools/openfst/include -O1 -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_OPENBLAS -I/opt/kaldi/tools/OpenBLAS/install/include -msse -msse2 -pthread -g -fPIC -DUSE_KALDI_SVD -c -o kaldi-utils.o kaldi-utils.cc c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse2' make[1]: *** [<builtin>: kaldi-math.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [<builtin>: kaldi-error.o] Error 1 make[1]: *** [<builtin>: kaldi-utils.o] Error 1 make[1]: *** [<builtin>: io-funcs.o] Error 1 make[1]: Leaving directory '/opt/kaldi/src/base' make: *** [Makefile:147: base] Error 2 T&R Kush

nshmyrev commented 2 years ago

You already asked it in https://github.com/kaldi-asr/kaldi/issues/4756

kush930 commented 2 years ago

Hi nshmyrev,

I cloned kaldi from github link:-https://github.com/alphacep/kaldi/blob/master

I am not getting (kaldi.mk line 46) from https://github.com/alphacep/kaldi/blob/master/src/Makefile

Not getting exact line, what should I remove, can you make me clear.

T&R Kush

nshmyrev commented 2 years ago

What exactly is the error

kush930 commented 2 years ago

Hi nshmyrev,

root@kush-Linux-1:/opt/kaldi/src# make -j 4 online2 lm rnnlm

I am attaching here issue log:-

c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse2' make[1]: *** [<builtin>: kaldi-math.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [<builtin>: kaldi-error.o] Error 1 make[1]: *** [<builtin>: io-funcs.o] Error 1 make[1]: *** [<builtin>: kaldi-utils.o] Error 1 make[1]: Leaving directory '/opt/kaldi/src/base' make: *** [Makefile:164: base] Error 2

T&R Kush

kush930 commented 2 years ago

Hi nshmyrev,

I am facing issue during compilation of kaldi, can you help me where i am wrong.

root@kush-Linux-1:/opt/kaldi/src# make -j 4 online2 lm rnnlm

I am attaching here issue log:-

c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse2' c++: error: unrecognized command-line option '-msse2' make[1]: *** [<builtin>: kaldi-math.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [<builtin>: kaldi-error.o] Error 1 make[1]: *** [<builtin>: io-funcs.o] Error 1 make[1]: *** [<builtin>: kaldi-utils.o] Error 1 make[1]: Leaving directory '/opt/kaldi/src/base' make: *** [Makefile:164: base] Error 2

T&R Kush

nshmyrev commented 2 years ago

Please format your post properly using formatting tools

kush930 commented 2 years ago

Hi nshmyrev,

I am using link- https://github.com/alphacep/vosk-api/blob/master/travis/Dockerfile.dockcross , to build vosk on riscv64 platform.

previous I successfully executed the command, now I am facing issue, can you make me clear where i am wrong.

root@kush-Linux-1:/opt/kaldi/src# sed -i "s: -O1 : -O3 :g" makefiles/linux_openblas_riscv64.mk

root@kush-Linux-1:/opt/kaldi/src# ./configure --mathlib=OPENBLAS_CLAPACK --shared --use-cuda=no

Configuring KALDI to use OPENBLAS_CLAPACK. Checking compiler c++ ... Checking OpenFst library in /opt/kaldi/tools/openfst ... ***configure failed: Static=[false] OpenFST library not found: See ../tools/INSTALL ***

T&R Kush kumar

nshmyrev commented 2 years ago

openfst must be in /opt/kaldi/tools/openfst, probably you have it in other folder.

kush930 commented 2 years ago

Hi nshmyrev,

openfst is in /opt/kaldi/tools

root@kush-Linux-1:/opt/kaldi/tools# ls

ATLAS_headers INSTALL OpenBLAS config install_pfile_utils.sh install_speex.sh openfst CLAPACK Makefile clapack extras install_portaudio.sh install_srilm.sh

root@kush-Linux-1:/opt/kaldi/tools/openfst# ls

AUTHORS Makefile README ar-lib config.h config.sub include ltmain.sh stamp-h1 BUILD.bazel Makefile.am WORKSPACE autom4te.cache config.h.in configure install-sh m4 test-driver COPYING Makefile.in WORKSPACE.bazel compile config.log configure.ac lib missing INSTALL NEWS aclocal.m4 config.guess config.status depcomp libtool src

T&R Kush

nshmyrev commented 2 years ago

Check contents of /opt/kaldi/tools/openfst/lib, there must be a file libfst.a, you probably do not have it.

kush930 commented 2 years ago

Hi nshmyrev,

I checked contents of /opt/kaldi/tools/openfst/lib, libfst.a is present.

root@kush-Linux-1:/opt/kaldi/tools/openfst/lib# ls

fst libfst.a libfst.la libfstfar.a libfstfar.la libfstlookahead.a libfstlookahead.la libfstngram.a libfstngram.la

T&R Kush Kumar

nshmyrev commented 2 years ago

Add 'set -x' to configure script line 2, run configure again and provide full output.

nshmyrev commented 2 years ago

Please format your post properly. It is the last time I write you about formatting. Next time I simply will not reply if you don't format.

kush930 commented 2 years ago

Hi nshmyrev

I added 'set -x' in /opt/kaldi/src/configure in line 2, i am getting--

root@kush-Linux-1:/opt/kaldi/src# vi configure

#!/bin/bash
set -x
# This configure script is hand-generated, not auto-generated.  It creates the
# file kaldi.mk, which is %included by the Makefiles in the subdirectories.
# The file kaldi.mk is editable by hand -- for example, you may want to
# uncomment the options -O0 -DKALDI_PARANOID, or edit the DOUBLE_PRECISION
# variable (to be 1 not 0).

root@kush-Linux-1:/opt/kaldi/src# ./configure --mathlib=OPENBLAS_CLAPACK --shared --use-cuda=no

+ [[ 5.0.18(1)-release < 3.2 ]]
+ '[' -x /opt/kaldi/src/configure ']'
+ ATLASROOT=
+ CLAPACKROOT=
+ MATHLIB=
+ MKLLIBDIR=
+ MKLROOT=
+ OPENBLASROOT=
+ HOST=
+ ENV_CXXFLAGS=
+ ENV_LDFLAGS=
+ ENV_LDLIBS=
+ debug_level=1
+ double_precision=false
+ dynamic_kaldi=false
+ use_cuda=true
+ with_cudadecoder=true
+ static_fst=false
+ static_math=false
+ static_speex=false
+ android=false
+ enable_kenlm=false
+ enable_tcmalloc=false
++ rel2abs ../tools/openfst
++ [[ -n ../tools/openfst ]]
++ cd -P ../tools/openfst
++ pwd
+ FSTROOT=/opt/kaldi/tools/openfst
++ rel2abs ../tools/cub
++ [[ -n ../tools/cub ]]
++ cd -P ../tools/cub
+ CUBROOT=
+ cmd_line='./configure --mathlib=OPENBLAS_CLAPACK --shared --use-cuda=no'
+ '[' 3 -gt 0 ']'
+ case "$1" in
+ GetSwitchValueOrDie MATHLIB --mathlib=OPENBLAS_CLAPACK
+ GetSwitchValue MATHLIB --mathlib=OPENBLAS_CLAPACK
+ IFS==
+ read -r -- _ MATHLIB
+ [[ -n OPENBLAS_CLAPACK ]]
+ shift
+ '[' 2 -gt 0 ']'
+ case "$1" in
+ dynamic_kaldi=true
+ static_math=false
+ static_fst=false
+ static_speex=false
+ shift
+ '[' 1 -gt 0 ']'
+ case "$1" in
+ use_cuda=false
+ shift
+ '[' 0 -gt 0 ']'
+ case "$debug_level" in
+ touch cudamatrix/cu-common.h
+ false
+ is_set
+ local myvar=notset
+ '[' notset == notset ']'
+ return 1
+ TARGET_ARCH=riscv64
+ HOST_CXX=c++
+ HOST_AR=ar
+ HOST_AS=as
+ HOST_RANLIB=ranlib
+ CXX=c++
+ AR=ar
+ AS=as
+ RANLIB=ranlib
+ declare -a mathlibs
+ declare -a incompat
+ auto_lib=
+ case $MATHLIB in
+ :
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ shopt -s nocasematch
+ [[ -n OPENBLAS_CLAPACK ]]
+ [[ -n '' ]]
+ shopt -u nocasematch
+ [[ 0 -gt 1 ]]
+ [[ -n '' ]]
+ [[ ! -n '' ]]
+ [[ ! -n OPENBLAS_CLAPACK ]]
+ : OPENBLAS_CLAPACK
+ case $MATHLIB in
+ unset auto_lib incompat libpfx mathlibs
+ echo 'Configuring KALDI to use OPENBLAS_CLAPACK.'
Configuring KALDI to use OPENBLAS_CLAPACK.
+ '[' -f kaldi.mk ']'
+ echo '# This file was generated using the following command:'
+ echo '# ./configure --mathlib=OPENBLAS_CLAPACK --shared --use-cuda=no'
+ echo
+ echo 'CONFIGURE_VERSION := 14'
+ echo
+ echo '# Toolchain configuration'
+ echo
+ echo 'CXX = c++'
+ echo 'AR = ar'
+ echo 'AS = as'
+ echo 'RANLIB = ranlib'
+ echo
+ echo 'Checking compiler c++ ...'
Checking compiler c++ ...
+ check_compiler c++
+ local 'supported_compiler=GNU g++ >= 5.0, Apple clang >= 6.0 or LLVM clang >= 3.5'
+ local compiler=c++
+ local compiler_ver_info compiler_ver compiler_ver_num
++ c++ --version
+ compiler_ver_info='c++ (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'
+ case $compiler_ver_info in
++ c++ -dumpversion
+ compiler_ver=10.2.0
++ echo 10.2.0
++ sed 's/\./ /g'
++ xargs printf %d%02d%02d
+ compiler_ver_num=100200
+ ((  compiler_ver_num < 50000  ))
+ echo '# Target achitecture'
+ echo 'ARCH = riscv64'
+ echo
+ echo '# Base configuration'
+ echo
+ true
++ pwd
+ KALDILIBDIR=/opt/kaldi/src/lib
+ echo 'KALDI_FLAVOR := dynamic'
+ echo 'KALDILIBDIR := /opt/kaldi/src/lib'
+ echo 'DEBUG_LEVEL = 1'
+ false
+ echo 'DOUBLE_PRECISION = 0'
+ echo 'Checking OpenFst library in /opt/kaldi/tools/openfst ...'
Checking OpenFst library in /opt/kaldi/tools/openfst ...
+ '[' '!' -f /opt/kaldi/tools/openfst/include/fst/fst.h ']'
++ grep PACKAGE_VERSION /opt/kaldi/tools/openfst/Makefile
++ sed -e 's:.*= ::'
+ OPENFST_VER=1.8.0
++ echo 1.8.0
++ sed 's/\./ /g'
++ xargs printf %d%02d%02d
+ OPENFST_VER_NUM=10800
+ '[' 10800 -lt 10600 ']'
+ echo 'OPENFSTINC = /opt/kaldi/tools/openfst/include'
+ false
++ uname
+ '[' Linux == Darwin ']'
++ uname
++ uname
+ '[' Linux == Linux -o Linux == FreeBSD ']'
+ OPENFSTLIBS=/opt/kaldi/tools/openfst/lib/libfst.so
+ OPENFSTLDFLAGS=-Wl,-rpath=/opt/kaldi/tools/openfst/lib
+ '[' '!' -f /opt/kaldi/tools/openfst/lib/libfst.so ']'
+ failure 'Static=[false] OpenFST library not found:  See ../tools/INSTALL'
+ echo '***configure failed: Static=[false] OpenFST library not found:  See ../tools/INSTALL ***'
***configure failed: Static=[false] OpenFST library not found:  See ../tools/INSTALL ***
+ rm -f kaldi.mk
+ exit 1
root@Exaleap-Unmatched-Linux-1:/opt/kaldi/src# vi configure 
root@Exaleap-Unmatched-Linux-1:/opt/kaldi/src# ./configure --mathlib=OPENBLAS_CLAPACK --shared --use-cuda=no
+ CONFIGURE_VERSION=14
+ [[ 5.0.18(1)-release < 3.2 ]]
+ '[' -x /opt/kaldi/src/configure ']'
+ ATLASROOT=
+ CLAPACKROOT=
+ MATHLIB=
+ MKLLIBDIR=
+ MKLROOT=
+ OPENBLASROOT=
+ HOST=
+ ENV_CXXFLAGS=
+ ENV_LDFLAGS=
+ ENV_LDLIBS=
+ debug_level=1
+ double_precision=false
+ dynamic_kaldi=false
+ use_cuda=true
+ with_cudadecoder=true
+ static_fst=false
+ static_math=false
+ static_speex=false
+ android=false
+ enable_kenlm=false
+ enable_tcmalloc=false
++ rel2abs ../tools/openfst
++ [[ -n ../tools/openfst ]]
++ cd -P ../tools/openfst
++ pwd
+ FSTROOT=/opt/kaldi/tools/openfst
++ rel2abs ../tools/cub
++ [[ -n ../tools/cub ]]
++ cd -P ../tools/cub
+ CUBROOT=
+ cmd_line='./configure --mathlib=OPENBLAS_CLAPACK --shared --use-cuda=no'
+ '[' 3 -gt 0 ']'
+ case "$1" in
+ GetSwitchValueOrDie MATHLIB --mathlib=OPENBLAS_CLAPACK
+ GetSwitchValue MATHLIB --mathlib=OPENBLAS_CLAPACK
+ IFS==
+ read -r -- _ MATHLIB
+ [[ -n OPENBLAS_CLAPACK ]]
+ shift
+ '[' 2 -gt 0 ']'
+ case "$1" in
+ dynamic_kaldi=true
+ static_math=false
+ static_fst=false
+ static_speex=false
+ shift
+ '[' 1 -gt 0 ']'
+ case "$1" in
+ use_cuda=false
+ shift
+ '[' 0 -gt 0 ']'
+ case "$debug_level" in
+ touch cudamatrix/cu-common.h
+ false
+ is_set
+ local myvar=notset
+ '[' notset == notset ']'
+ return 1
+ TARGET_ARCH=riscv64
+ HOST_CXX=c++
+ HOST_AR=ar
+ HOST_AS=as
+ HOST_RANLIB=ranlib
+ CXX=c++
+ AR=ar
+ AS=as
+ RANLIB=ranlib
+ declare -a mathlibs
+ declare -a incompat
+ auto_lib=
+ case $MATHLIB in
+ :
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ shopt -s nocasematch
+ [[ -n OPENBLAS_CLAPACK ]]
+ [[ -n '' ]]
+ shopt -u nocasematch
+ [[ 0 -gt 1 ]]
+ [[ -n '' ]]
+ [[ ! -n '' ]]
+ [[ ! -n OPENBLAS_CLAPACK ]]
+ : OPENBLAS_CLAPACK
+ case $MATHLIB in
+ unset auto_lib incompat libpfx mathlibs
+ echo 'Configuring KALDI to use OPENBLAS_CLAPACK.'
Configuring KALDI to use OPENBLAS_CLAPACK.
+ '[' -f kaldi.mk ']'
+ echo '# This file was generated using the following command:'
+ echo '# ./configure --mathlib=OPENBLAS_CLAPACK --shared --use-cuda=no'
+ echo
+ echo 'CONFIGURE_VERSION := 14'
+ echo
+ echo '# Toolchain configuration'
+ echo
+ echo 'CXX = c++'
+ echo 'AR = ar'
+ echo 'AS = as'
+ echo 'RANLIB = ranlib'
+ echo
+ echo 'Checking compiler c++ ...'
Checking compiler c++ ...
+ check_compiler c++
+ local 'supported_compiler=GNU g++ >= 5.0, Apple clang >= 6.0 or LLVM clang >= 3.5'
+ local compiler=c++
+ local compiler_ver_info compiler_ver compiler_ver_num
++ c++ --version
+ compiler_ver_info='c++ (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'
+ case $compiler_ver_info in
++ c++ -dumpversion
+ compiler_ver=10.2.0
++ echo 10.2.0
++ sed 's/\./ /g'
++ xargs printf %d%02d%02d
+ compiler_ver_num=100200
+ ((  compiler_ver_num < 50000  ))
+ echo '# Target achitecture'
+ echo 'ARCH = riscv64'
+ echo
+ echo '# Base configuration'
+ echo
+ true
++ pwd
+ KALDILIBDIR=/opt/kaldi/src/lib
+ echo 'KALDI_FLAVOR := dynamic'
+ echo 'KALDILIBDIR := /opt/kaldi/src/lib'
+ echo 'DEBUG_LEVEL = 1'
+ false
+ echo 'DOUBLE_PRECISION = 0'
+ echo 'Checking OpenFst library in /opt/kaldi/tools/openfst ...'
Checking OpenFst library in /opt/kaldi/tools/openfst ...
+ '[' '!' -f /opt/kaldi/tools/openfst/include/fst/fst.h ']'
++ grep PACKAGE_VERSION /opt/kaldi/tools/openfst/Makefile
++ sed -e 's:.*= ::'
+ OPENFST_VER=1.8.0
++ echo 1.8.0
++ sed 's/\./ /g'
++ xargs printf %d%02d%02d
+ OPENFST_VER_NUM=10800
+ '[' 10800 -lt 10600 ']'
+ echo 'OPENFSTINC = /opt/kaldi/tools/openfst/include'
+ false
++ uname
+ '[' Linux == Darwin ']'
++ uname
++ uname
+ '[' Linux == Linux -o Linux == FreeBSD ']'
+ OPENFSTLIBS=/opt/kaldi/tools/openfst/lib/libfst.so
+ OPENFSTLDFLAGS=-Wl,-rpath=/opt/kaldi/tools/openfst/lib
+ '[' '!' -f /opt/kaldi/tools/openfst/lib/libfst.so ']'
+ failure 'Static=[false] OpenFST library not found:  See ../tools/INSTALL'
+ echo '***configure failed: Static=[false] OpenFST library not found:  See ../tools/INSTALL ***'
***configure failed: Static=[false] OpenFST library not found:  See ../tools/INSTALL ***
+ rm -f kaldi.mk
+ exit 1

T&R Kush

nshmyrev commented 2 years ago

It says /opt/kaldi/tools/openfst/lib/libfst.so is missing. You didn't compile it.

kush930 commented 2 years ago

Hi nshmyrev,

Thanks for your help to make all steps successfully on riscv64, now i want to know how to build vosk on riscv64 platform, please help me to build.

I successfully completed manually, whatever steps you given in this link-https://github.com/alphacep/vosk-api/blob/master/travis/Dockerfile.dockcross

T&R Kush

kush930 commented 2 years ago

Hi nshmyrev,

Thanks for your support, vosk is builded successfully on riscv64.

T&R Kush

nshmyrev commented 2 years ago

@kush930 congratulations!