void-packages/srcpkgs/vosk-api/patches/vosk-lapack.patch

42 lines
1.2 KiB
Diff

https://github.com/alphacep/vosk-api/pull/1215
From 6c28207334bb1281d98a94f799757fdfa8f6b336 Mon Sep 17 00:00:00 2001
From: John Gebbie <me@johngebbie.com>
Date: Sat, 3 Dec 2022 17:53:21 +0000
Subject: [PATCH] Add OPENBLAS_NO_F2C math library option
---
src/Makefile | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/Makefile b/src/Makefile
index cd697b15..97654883 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -7,6 +7,7 @@ CUDA_ROOT?=/usr/local/cuda
USE_SHARED?=0
# Math libraries
HAVE_OPENBLAS_CLAPACK?=1
+HAVE_OPENBLAS_NO_F2C?=0
HAVE_MKL?=0
HAVE_ACCELERATE=0
HAVE_CUDA?=0
@@ -80,6 +81,18 @@ ifeq ($(HAVE_OPENBLAS_CLAPACK), 1)
endif
endif
+ifeq ($(HAVE_OPENBLAS_NO_F2C), 1)
+ CFLAGS += -I$(OPENBLAS_ROOT)/include
+ ifeq ($(USE_SHARED), 0)
+ LIBS += \
+ $(OPENBLAS_ROOT)/lib/libopenblas.a \
+ $(OPENBLAS_ROOT)/lib/liblapack.a \
+ $(OPENBLAS_ROOT)/lib/libblas.a
+ else
+ LDFLAGS += -lopenblas -llapack -lblas
+ 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