Skip to content

Commit

Permalink
Add OPENBLAS and USE_SHARED_MATH
Browse files Browse the repository at this point in the history
  • Loading branch information
johngebbie committed Feb 10, 2023
1 parent fff40ce commit 5ccd600
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit 5ccd600

Please sign in to comment.