@@ -4,9 +4,11 @@ OPENFST_ROOT?=$(KALDI_ROOT)/tools/openfst
44OPENBLAS_ROOT? =$(KALDI_ROOT ) /tools/OpenBLAS/install
55MKL_ROOT? =/opt/intel/mkl
66CUDA_ROOT? =/usr/local/cuda
7- USE_SHARED? =0
7+ USE_SHARED_KALDI? =0
8+ USE_SHARED_MATH? =0
89# Math libraries
910HAVE_OPENBLAS_CLAPACK? =1
11+ HAVE_OPENBLAS? =0
1012HAVE_MKL? =0
1113HAVE_ACCELERATE =0
1214HAVE_CUDA? =0
@@ -37,7 +39,7 @@ CFLAGS=-g -O3 -std=c++17 -Wno-deprecated-declarations -fPIC -DFST_NO_DYNAMIC_LIN
3739
3840LDFLAGS =
3941
40- ifeq ($(USE_SHARED ) , 0)
42+ ifeq ($(USE_SHARED_KALDI ) , 0)
4143 LIBS = \
4244 $(KALDI_ROOT ) /src/online2/kaldi-online2.a \
4345 $(KALDI_ROOT ) /src/decoder/kaldi-decoder.a \
6971
7072ifeq ($(HAVE_OPENBLAS_CLAPACK ) , 1)
7173 CFLAGS += -I$(OPENBLAS_ROOT ) /include
72- ifeq ($(USE_SHARED ), 0)
74+ ifeq ($(USE_SHARED_MATH ), 0)
7375 LIBS += \
7476 $(OPENBLAS_ROOT ) /lib/libopenblas.a \
7577 $(OPENBLAS_ROOT ) /lib/liblapack.a \
@@ -80,6 +82,15 @@ ifeq ($(HAVE_OPENBLAS_CLAPACK), 1)
8082 endif
8183endif
8284
85+ ifeq ($(HAVE_OPENBLAS ) , 1)
86+ CFLAGS += -I$(OPENBLAS_ROOT ) /include
87+ ifeq ($(USE_SHARED_MATH), 0)
88+ LIBS += $(OPENBLAS_ROOT ) /lib/libopenblas.a
89+ else
90+ LDFLAGS += -lopenblas -lgfortran
91+ endif
92+ endif
93+
8394ifeq ($(HAVE_MKL ) , 1)
8495 CFLAGS += -DHAVE_MKL=1 -I$(MKL_ROOT ) /include
8596 LDFLAGS += -L$(MKL_ROOT ) /lib/intel64 -Wl,-rpath=$(MKL_ROOT ) /lib/intel64 -lmkl_rt -lmkl_intel_lp64 -lmkl_core -lmkl_sequential
0 commit comments