summaryrefslogtreecommitdiff
path: root/kaldi_seq/Makefile
diff options
context:
space:
mode:
authorYimmon Zhuang <[email protected]>2015-09-18 22:18:47 +0800
committerYimmon Zhuang <[email protected]>2015-09-18 22:18:47 +0800
commit74809198a31cb7d902de23c217ca7492b5f8a29b (patch)
treef14bf7081491f4b40b2a9fcccc17228b0142181f /kaldi_seq/Makefile
parent84a91188a4c6e660c1c3d5df2f450c177f4e2fe8 (diff)
mpe implement
Diffstat (limited to 'kaldi_seq/Makefile')
-rw-r--r--kaldi_seq/Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/kaldi_seq/Makefile b/kaldi_seq/Makefile
new file mode 100644
index 0000000..9ac1625
--- /dev/null
+++ b/kaldi_seq/Makefile
@@ -0,0 +1,40 @@
+# Change KDIR to `kaldi-trunk' path (Kaldi must be compiled with --share)
+KDIR := /slfs6/users/ymz09/kaldi/
+
+SHELL := /bin/bash
+BUILD_DIR := $(CURDIR)/build
+INC_PATH := $(LUA_BINDIR)/../include/
+OBJS := init.o src/kaldi_mpe.o src/init.o
+LIBS := libkaldiseq.so
+INCLUDE := -I $(LUA_INCDIR) -I $(INC_PATH) -DLUA_USE_APICHECK
+
+SUBDIR := src
+OBJ_DIR := $(BUILD_DIR)/objs
+LUA_DIR := $(INST_LUADIR)/kaldi_seq
+KALDIINCLUDE := -I $(KDIR)/tools/ATLAS/include/ -I $(KDIR)/tools/openfst/include/ -I $(KDIR)/src/
+
+OBJS := $(addprefix $(OBJ_DIR)/,$(OBJS))
+LIBS := $(addprefix $(INST_LIBDIR)/,$(LIBS))
+OBJ_SUBDIR := $(addprefix $(OBJ_DIR)/,$(SUBDIR))
+LUA_SUBDIR := $(addprefix $(LUA_DIR)/,$(SUBDIR))
+LIB_PATH := $(LUA_BINDIR)/../lib
+
+build: $(OBJ_DIR) $(OBJ_SUBDIR) $(OBJS)
+install: $(LUA_DIR) $(LUA_SUBDIR) $(LIBS)
+
+include $(KDIR)/src/kaldi.mk
+KL := -L/home/slhome/ymz09/mylibs/ -L$(KDIR)/tools/openfst-1.3.4/lib/ $(KDIR)/src/feat/kaldi-feat.a $(KDIR)/src/matrix/kaldi-matrix.a $(KDIR)/src/base/kaldi-base.a $(KDIR)/src/util/kaldi-util.a $(KDIR)/src/hmm/kaldi-hmm.a $(KDIR)/src/tree/kaldi-tree.a $(KDIR)/src/nnet/kaldi-nnet.a $(KDIR)/src/cudamatrix/kaldi-cudamatrix.a $(KDIR)/src/lat/kaldi-lat.a $(KDIR)/src/hmm/kaldi-hmm.a $(KDIR)/src/tree/kaldi-tree.a $(KDIR)/src/matrix/kaldi-matrix.a $(KDIR)/src/util/kaldi-util.a $(KDIR)/src/base/kaldi-base.a -lcblas -llapack_atlas -lfst -lcudart -lcublas -DHAVE_CUDA
+
+$(OBJ_DIR) $(LUA_DIR) $(OBJ_SUBDIR) $(LUA_SUBDIR):
+ -mkdir -p $@
+$(LUA_DIR)/%.lua: %.lua
+ cp $< $@
+$(LIBS): $(OBJ_DIR)/src/kaldi_mpe.o $(OBJ_DIR)/init.o $(OBJ_DIR)/src/init.o
+ gcc -shared -fPIC -o $@ $(OBJ_DIR)/src/kaldi_mpe.o $(OBJ_DIR)/init.o $(OBJ_DIR)/src/init.o -lstdc++ -Wl,-rpath=$(LIB_PATH) -L$(LIB_PATH) -lnervcore -lluaT $(KL)
+$(OBJ_DIR)/src/kaldi_mpe.o: src/kaldi_mpe.cpp
+ g++ -o $@ -c $< -DHAVE_ATLAS $(KALDIINCLUDE) -g -fPIC $(INCLUDE) -DKALDI_DOUBLEPRECISION=0 -msse2 -DHAVE_POSIX_MEMALIGN
+$(OBJ_DIR)/%.o: %.c
+ gcc -o $@ -c $< -g $(INCLUDE) -fPIC
+clean:
+ -rm $(OBJ_DIR)/src/*.o
+