summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile28
-rw-r--r--nerv/Makefile9
-rw-r--r--nerv/nerv-scm-1.rockspec3
3 files changed, 25 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index d8612dd..1711b3c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
.PHONY: all clean install luajit luarocks speech
+############## EDIT THESE LINES #####################
SHELL := /bin/bash
PREFIX := $(CURDIR)/install/
#CUDA_BASE := /usr/local/cuda-7.0
@@ -7,7 +8,7 @@ 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)
@@ -21,21 +22,20 @@ export CUDA_BASE
export KALDI_BASE
export BLAS_LDFLAGS
-.PHONY: htk_io kaldi_io kaldi_decode
+.PHONY: nerv speech/speech_utils speech/htk_io speech/kaldi_io speech/kaldi_decode \
+ nerv-clean speech/speech_utils-clean speech/htk_io-clean speech/kaldi_io-clean speech/kaldi_decode-clean
-all: luajit luarocks install
+all: luajit luarocks nerv
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
+
+speech: speech/speech_utils speech/htk_io speech/kaldi_io speech/kaldi_decode
+speech-clean: speech/speech_utils-clean speech/htk_io-clean speech/kaldi_io-clean speech/kaldi_decode-clean
+clean: nerv-clean speech-clean
+
+nerv speech/speech_utils speech/htk_io speech/kaldi_io speech/kaldi_decode:
+ cd $@; $(PREFIX)/bin/luarocks make
+nerv-clean speech/speech_utils-clean speech/htk_io-clean speech/kaldi_io-clean speech/kaldi_decode-clean:
+ cd $(subst -clean,,$@); make clean LUA_BINDIR=$(PREFIX)/bin/
diff --git a/nerv/Makefile b/nerv/Makefile
index 46e79a0..e8bcad2 100644
--- a/nerv/Makefile
+++ b/nerv/Makefile
@@ -1,3 +1,11 @@
+ifndef LUA_BINDIR
+$(error Please build the package via luarocks: `luarocks make`)
+endif
+
+ifndef CUDA_BASE
+$(error CUDA_BASE is not set)
+endif
+
.PHONY: build install clean
SHELL := /bin/bash
@@ -43,6 +51,7 @@ CUDA_INCLUDE := -I $(CUDA_BASE)/include/
INCLUDE += $(CUDA_INCLUDE)
CUDA_LDFLAGS := -L$(CUDA_BASE)/lib64/ -Wl,-rpath=$(CUDA_BASE)/lib64/ -lcudart -lcuda -lcublas -lcurand
+override CFLAGS += $(NERV_FEAT)
NVCC := $(CUDA_BASE)/bin/nvcc
EMPTY :=
diff --git a/nerv/nerv-scm-1.rockspec b/nerv/nerv-scm-1.rockspec
index 0e1e47f..9dbe771 100644
--- a/nerv/nerv-scm-1.rockspec
+++ b/nerv/nerv-scm-1.rockspec
@@ -11,7 +11,8 @@ description = {
license = "BSD"
}
dependencies = {
- "lua >= 5.1"
+ "lua >= 5.1",
+ "luafilesystem >= 1.6.3"
}
build = {
type = "make",