aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: d8612dd81bfad98cfe88bc8e571631edfa52c608 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.PHONY: all clean install luajit luarocks speech
SHELL := /bin/bash
PREFIX := $(CURDIR)/install/
#CUDA_BASE := /usr/local/cuda-7.0
CUDA_BASE := /usr/local/cuda
BLAS_BASE := /usr/lib/
BLAS_LDFLAGS := -L$(BLAS_BASE) -Wl,-rpath=$(BLAS_BASE)
BLAS_TYPE := atlas
KALDI_BASE := /speechlab/tools/KALDI/kaldi-master/

MKL_LDFLAGS := -lmkl_rt
ATLAS_LDFLAGS := -lcblas -llapack_atlas
ifeq ($(BLAS_TYPE), mkl)
BLAS_LDFLAGS += $(MKL_LDFLAGS)
else ifeq ($(BLAS_TYPE), atlas)
BLAS_LDFLAGS += $(ATLAS_LDFLAGS)
else
$(error Invalid blas type)
endif
export CUDA_BASE
export KALDI_BASE
export BLAS_LDFLAGS

.PHONY: htk_io kaldi_io kaldi_decode

all: luajit luarocks install
luajit:
	PREFIX=$(PREFIX) ./tools/build_luajit.sh
luarocks:
	PREFIX=$(PREFIX) ./tools/build_luarocks.sh
install:
	cd nerv; $(PREFIX)/bin/luarocks make CFLAGS=$(CFLAGS)
speech: htk_io kaldi_io kaldi_decode
htk_io kaldi_io kaldi_decode:
	cd speech/$@; $(PREFIX)/bin/luarocks make
clean:
	cd nerv && make clean
	cd speech/speech_utils && make clean
	cd speech/htk_io && make clean
	cd speech/kaldi_io && make clean
	cd speech/kaldi_decode && make clean