summaryrefslogtreecommitdiffstats
path: root/meta-offline-voice-agent/recipes-vosk/vosk-kaldi
diff options
context:
space:
mode:
Diffstat (limited to 'meta-offline-voice-agent/recipes-vosk/vosk-kaldi')
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch101
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb1
2 files changed, 102 insertions, 0 deletions
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch
new file mode 100644
index 00000000..a4d6b6bc
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch
@@ -0,0 +1,101 @@
+From e23562daf660dbf2aed0fe0ee3bd47165f73c437 Mon Sep 17 00:00:00 2001
+From: Anuj Solanki <anuj603362@gmail.com>
+Date: Fri, 7 Jun 2024 16:54:08 +0200
+Subject: [PATCH] Fixup wrappers for compilation with openblas 0.3.27
+
+vosk-kaldi if compiled with openblas from meta-python-ai
+needs these wrappers adapted to function.
+
+Upstream-Status: Inaproppriate.
+Signed-off-by: Anuj Solanki <anuj603362@gmail.com>
+---
+ src/matrix/cblas-wrappers.h | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/matrix/cblas-wrappers.h b/src/matrix/cblas-wrappers.h
+index f869ab7e0..0bb306ba9 100644
+--- a/src/matrix/cblas-wrappers.h
++++ b/src/matrix/cblas-wrappers.h
+@@ -383,33 +383,33 @@ inline void mul_elements(
+ // add clapack here
+ #if !defined(HAVE_ATLAS)
+ inline void clapack_Xtptri(KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *result) {
+- stptri_(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
++ LAPACK_stptri(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
+ }
+ inline void clapack_Xtptri(KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *result) {
+- dtptri_(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
++ LAPACK_dtptri(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
+ }
+ //
+ inline void clapack_Xgetrf2(KaldiBlasInt *num_rows, KaldiBlasInt *num_cols,
+ float *Mdata, KaldiBlasInt *stride, KaldiBlasInt *pivot,
+ KaldiBlasInt *result) {
+- sgetrf_(num_rows, num_cols, Mdata, stride, pivot, result);
++ LAPACK_sgetrf(num_rows, num_cols, Mdata, stride, pivot, result);
+ }
+ inline void clapack_Xgetrf2(KaldiBlasInt *num_rows, KaldiBlasInt *num_cols,
+ double *Mdata, KaldiBlasInt *stride, KaldiBlasInt *pivot,
+ KaldiBlasInt *result) {
+- dgetrf_(num_rows, num_cols, Mdata, stride, pivot, result);
++ LAPACK_dgetrf(num_rows, num_cols, Mdata, stride, pivot, result);
+ }
+
+ //
+ inline void clapack_Xgetri2(KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *stride,
+ KaldiBlasInt *pivot, float *p_work,
+ KaldiBlasInt *l_work, KaldiBlasInt *result) {
+- sgetri_(num_rows, Mdata, stride, pivot, p_work, l_work, result);
++ LAPACK_sgetri(num_rows, Mdata, stride, pivot, p_work, l_work, result);
+ }
+ inline void clapack_Xgetri2(KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *stride,
+ KaldiBlasInt *pivot, double *p_work,
+ KaldiBlasInt *l_work, KaldiBlasInt *result) {
+- dgetri_(num_rows, Mdata, stride, pivot, p_work, l_work, result);
++ LAPACK_dgetri(num_rows, Mdata, stride, pivot, p_work, l_work, result);
+ }
+ //
+ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+@@ -417,7 +417,7 @@ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+ float *sv, float *Vdata, KaldiBlasInt *vstride,
+ float *Udata, KaldiBlasInt *ustride, float *p_work,
+ KaldiBlasInt *l_work, KaldiBlasInt *result) {
+- sgesvd_(v, u,
++ LAPACK_sgesvd(v, u,
+ num_cols, num_rows, Mdata, stride,
+ sv, Vdata, vstride, Udata, ustride,
+ p_work, l_work, result);
+@@ -427,7 +427,7 @@ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+ double *sv, double *Vdata, KaldiBlasInt *vstride,
+ double *Udata, KaldiBlasInt *ustride, double *p_work,
+ KaldiBlasInt *l_work, KaldiBlasInt *result) {
+- dgesvd_(v, u,
++ LAPACK_dgesvd(v, u,
+ num_cols, num_rows, Mdata, stride,
+ sv, Vdata, vstride, Udata, ustride,
+ p_work, l_work, result);
+@@ -435,20 +435,20 @@ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+ //
+ void inline clapack_Xsptri(KaldiBlasInt *num_rows, float *Mdata,
+ KaldiBlasInt *ipiv, float *work, KaldiBlasInt *result) {
+- ssptri_(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
++ LAPACK_ssptri(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
+ }
+ void inline clapack_Xsptri(KaldiBlasInt *num_rows, double *Mdata,
+ KaldiBlasInt *ipiv, double *work, KaldiBlasInt *result) {
+- dsptri_(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
++ LAPACK_dsptri(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
+ }
+ //
+ void inline clapack_Xsptrf(KaldiBlasInt *num_rows, float *Mdata,
+ KaldiBlasInt *ipiv, KaldiBlasInt *result) {
+- ssptrf_(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
++ LAPACK_ssptrf(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
+ }
+ void inline clapack_Xsptrf(KaldiBlasInt *num_rows, double *Mdata,
+ KaldiBlasInt *ipiv, KaldiBlasInt *result) {
+- dsptrf_(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
++ LAPACK_dsptrf(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
+ }
+ #else
+ inline void clapack_Xgetrf(MatrixIndexT num_rows, MatrixIndexT num_cols,
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb
index 19206d9a..0630abcb 100644
--- a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://../COPYING;md5=a10e448a64dbd3723ff3fb2f397fba2e \
SRC_URI = "git://github.com/alphacep/kaldi.git;protocol=https;branch=vosk \
file://0001-Fixes-for-shared-library-compilation.patch \
+ file://0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch;patchdir=.. \
"
PV = "1.0+git${SRCPV}"