Skip to content

Commit

Permalink
[build] Fix openblas build for aarch64 (#2806)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanleary authored and danpovey committed Oct 30, 2018
1 parent d68c00a commit 8b4a1bf
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,8 @@ elif [ "`uname`" == "Linux" ]; then
echo >> kaldi.mk
if [[ "$TARGET_ARCH" == arm* ]]; then
cat makefiles/linux_openblas_arm.mk >> kaldi.mk
elif [[ "$TARGET_ARCH" == aarch64* ]]; then
cat makefiles/linux_openblas_aarch64.mk >> kaldi.mk
elif [[ "$TARGET_ARCH" == ppc64le ]]; then
cat makefiles/linux_openblas_ppc64le.mk >> kaldi.mk
else
Expand Down
39 changes: 39 additions & 0 deletions src/makefiles/linux_openblas_aarch64.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# OpenBLAS specific Linux ARM configuration

ifndef DOUBLE_PRECISION
$(error DOUBLE_PRECISION not defined.)
endif
ifndef OPENFSTINC
$(error OPENFSTINC not defined.)
endif
ifndef OPENFSTLIBS
$(error OPENFSTLIBS not defined.)
endif
ifndef OPENBLASINC
$(error OPENBLASINC not defined.)
endif
ifndef OPENBLASLIBS
$(error OPENBLASLIBS not defined.)
endif

CXXFLAGS = -std=c++11 -I.. -isystem $(OPENFSTINC) -O1 $(EXTRA_CXXFLAGS) \
-Wall -Wno-sign-compare -Wno-unused-local-typedefs \
-Wno-deprecated-declarations -Winit-self \
-DKALDI_DOUBLEPRECISION=$(DOUBLE_PRECISION) \
-DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_OPENBLAS -I$(OPENBLASINC) \
-ftree-vectorize -pthread \
-g # -O0 -DKALDI_PARANOID

ifeq ($(KALDI_FLAVOR), dynamic)
CXXFLAGS += -fPIC
endif

# Compiler specific flags
COMPILER = $(shell $(CXX) -v 2>&1)
ifeq ($(findstring clang,$(COMPILER)),clang)
# Suppress annoying clang warnings that are perfectly valid per spec.
CXXFLAGS += -Wno-mismatched-tags
endif

LDFLAGS = $(EXTRA_LDFLAGS) $(OPENFSTLDFLAGS) -rdynamic
LDLIBS = $(EXTRA_LDLIBS) $(OPENFSTLIBS) $(OPENBLASLIBS) -lm -lpthread -ldl

0 comments on commit 8b4a1bf

Please sign in to comment.