1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-16 12:45:18 +03:00
aports/testing/vosk-api/vosk-openblas.patch
John Gebbie f7c96ab46e testing/vosk-api: new aport
https://alphacephei.com/vosk
Offline speech recognition toolkit
2023-02-11 13:00:47 +01:00

64 lines
1.8 KiB
Diff

https://github.com/alphacep/vosk-api/pull/1268
From 461e869b29df58b824292c5564b743619770e5fd Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Thu, 9 Feb 2023 18:45:53 +0000
Subject: [PATCH] Add OPENBLAS and USE_SHARED_MATH
---
src/Makefile | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index cd697b1..56cb306 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,9 +4,11 @@ OPENFST_ROOT?=$(KALDI_ROOT)/tools/openfst
OPENBLAS_ROOT?=$(KALDI_ROOT)/tools/OpenBLAS/install
MKL_ROOT?=/opt/intel/mkl
CUDA_ROOT?=/usr/local/cuda
-USE_SHARED?=0
+USE_SHARED_KALDI?=0
+USE_SHARED_MATH?=0
# Math libraries
HAVE_OPENBLAS_CLAPACK?=1
+HAVE_OPENBLAS?=0
HAVE_MKL?=0
HAVE_ACCELERATE=0
HAVE_CUDA?=0
@@ -37,7 +39,7 @@ CFLAGS=-g -O3 -std=c++17 -Wno-deprecated-declarations -fPIC -DFST_NO_DYNAMIC_LIN
LDFLAGS=
-ifeq ($(USE_SHARED), 0)
+ifeq ($(USE_SHARED_KALDI), 0)
LIBS = \
$(KALDI_ROOT)/src/online2/kaldi-online2.a \
$(KALDI_ROOT)/src/decoder/kaldi-decoder.a \
@@ -69,7 +71,7 @@ endif
ifeq ($(HAVE_OPENBLAS_CLAPACK), 1)
CFLAGS += -I$(OPENBLAS_ROOT)/include
- ifeq ($(USE_SHARED), 0)
+ ifeq ($(USE_SHARED_MATH), 0)
LIBS += \
$(OPENBLAS_ROOT)/lib/libopenblas.a \
$(OPENBLAS_ROOT)/lib/liblapack.a \
@@ -80,6 +82,15 @@ ifeq ($(HAVE_OPENBLAS_CLAPACK), 1)
endif
endif
+ifeq ($(HAVE_OPENBLAS), 1)
+ CFLAGS += -I$(OPENBLAS_ROOT)/include
+ ifeq ($(USE_SHARED_MATH), 0)
+ LIBS += $(OPENBLAS_ROOT)/lib/libopenblas.a
+ else
+ LDFLAGS += -lopenblas -lgfortran
+ endif
+endif
+
ifeq ($(HAVE_MKL), 1)
CFLAGS += -DHAVE_MKL=1 -I$(MKL_ROOT)/include
LDFLAGS += -L$(MKL_ROOT)/lib/intel64 -Wl,-rpath=$(MKL_ROOT)/lib/intel64 -lmkl_rt -lmkl_intel_lp64 -lmkl_core -lmkl_sequential
--
2.38.3