2012-09-18 22:42:00 +04:00
|
|
|
# SHELL += -x
|
|
|
|
|
2014-03-06 16:10:18 +04:00
|
|
|
CXX = g++
|
2013-12-10 08:10:02 +04:00
|
|
|
|
2014-03-06 05:51:37 +04:00
|
|
|
# On Mac OS 10.9, g++ is actually clang in disguise which by default uses the
|
|
|
|
# new c++ standard library libc++. Since openfst uses stuff from the tr1
|
|
|
|
# namespace, we need to tell clang to use libstdc++ instead.
|
|
|
|
COMPILER = $(shell $(CXX) -v 2>&1 )
|
|
|
|
ifeq ($(findstring clang,$(COMPILER)),clang)
|
|
|
|
CXXFLAGS += -stdlib=libstdc++
|
|
|
|
LDFLAGS += -stdlib=libstdc++
|
|
|
|
endif
|
2014-03-06 16:10:18 +04:00
|
|
|
|
2014-03-24 21:31:34 +04:00
|
|
|
all: check_required_programs sph2pipe atlas irstlm_tgt sclite openfst
|
2013-05-14 21:10:22 +04:00
|
|
|
|
|
|
|
|
|
|
|
check_required_programs:
|
2014-08-22 01:30:09 +04:00
|
|
|
extras/check_dependencies.sh
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
clean: openfst_cleaned sclite_cleaned irstlm_cleaned
|
|
|
|
|
|
|
|
openfst_cleaned:
|
2014-03-24 21:31:34 +04:00
|
|
|
$(MAKE) -C openfst-1.3.4 clean
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
irstlm_cleaned:
|
2014-03-24 21:31:34 +04:00
|
|
|
$(MAKE) -C irstlm clean
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
sclite_cleaned:
|
2014-08-30 04:16:01 +04:00
|
|
|
$(MAKE) -C sctk clean
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
distclean:
|
2014-03-24 21:31:34 +04:00
|
|
|
rm -rf openfst-1.3.4/
|
2014-08-30 04:16:01 +04:00
|
|
|
rm -rf sctk-2.4.8/
|
|
|
|
rm -rf sctk
|
2014-03-24 21:31:34 +04:00
|
|
|
rm -rf ATLAS/
|
|
|
|
rm -rf irstlm/
|
|
|
|
rm -rf sph2pipe_v2.5/
|
|
|
|
rm -rf sph2pipe_v2.5.tar.gz
|
|
|
|
rm -rf atlas3.8.3.tar.gz
|
2014-08-30 04:16:01 +04:00
|
|
|
rm -rf sctk-2.4.8-20130429-2145.tar.bz2
|
2014-03-24 21:31:34 +04:00
|
|
|
rm -rf openfst-1.3.4.tar.gz
|
|
|
|
rm -f openfst
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: openfst # so target will be made even though "openfst" exists.
|
|
|
|
|
|
|
|
openfst: openfst_compiled openfst-1.3.4/lib
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
.PHONY: openfst_compiled
|
2014-03-24 04:36:44 +04:00
|
|
|
openfst_compiled: openfst-1.3.4/Makefile
|
|
|
|
cd openfst-1.3.4/ && \
|
2013-05-08 20:53:14 +04:00
|
|
|
$(MAKE) install
|
|
|
|
|
2014-03-24 21:31:34 +04:00
|
|
|
openfst-1.3.4/lib: | openfst-1.3.4/Makefile
|
|
|
|
-cd openfst-1.3.4 && [ -d lib64 ] && [ ! -d lib ] && ln -s lib64 lib
|
2012-09-18 22:42:00 +04:00
|
|
|
|
2014-05-24 22:28:30 +04:00
|
|
|
# Disable shared-library creation on cygwin as it leads to compilation error "file too big"
|
|
|
|
# with openfst-1.3.4.
|
2014-03-24 04:36:44 +04:00
|
|
|
openfst-1.3.4/Makefile: openfst-1.3.4/.patched
|
2014-05-24 22:28:30 +04:00
|
|
|
ifeq ($(OSTYPE),cygwin)
|
|
|
|
cd openfst-1.3.4/; ./configure --prefix=`pwd` --enable-static --disable-shared --enable-far --enable-ngram-fsts CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="-ldl"
|
|
|
|
else
|
|
|
|
cd openfst-1.3.4/; ./configure --prefix=`pwd` --enable-static --enable-shared --enable-far --enable-ngram-fsts CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="-ldl"
|
|
|
|
endif
|
2013-01-19 02:02:24 +04:00
|
|
|
|
2013-12-09 21:17:57 +04:00
|
|
|
# patches for openfst. openfst_gcc41up.patch is a patch for openfst to \
|
|
|
|
# support multi-threads when compile with g++ (gcc) version above 4.1
|
2014-03-24 21:31:34 +04:00
|
|
|
openfst-1.3.4/.patched: | openfst-1.3.4
|
|
|
|
-cd openfst-1.3.4/src/include/fst; \
|
|
|
|
patch -p0 -N < ../../../../openfst.patch;
|
|
|
|
$(CXX) -dumpversion | awk '{if(NR==1 && $$1>"4.1") print "cd openfst-1.3.4/src/include/fst; patch -p0 -N < ../../../../extras/openfst_gcc41up.patch"}' | sh -
|
|
|
|
touch $@
|
2012-09-18 22:42:00 +04:00
|
|
|
|
2014-03-24 21:31:34 +04:00
|
|
|
openfst-1.3.4: openfst-1.3.4.tar.gz
|
|
|
|
tar xozf openfst-1.3.4.tar.gz
|
|
|
|
-rm openfst
|
|
|
|
-ln -s openfst-1.3.4 openfst
|
2012-09-18 22:42:00 +04:00
|
|
|
|
2014-03-24 04:36:44 +04:00
|
|
|
openfst-1.3.4.tar.gz:
|
2014-03-24 21:31:34 +04:00
|
|
|
wget http://openfst.cs.nyu.edu/twiki/pub/FST/FstDownload/openfst-1.3.4.tar.gz || \
|
|
|
|
wget -T 10 -t 3 http://www.openslr.org/resources/2/openfst-1.3.4.tar.gz
|
2012-09-18 22:42:00 +04:00
|
|
|
|
2014-03-24 21:31:34 +04:00
|
|
|
sclite: sclite_compiled
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
.PHONY: sclite_compiled
|
2014-08-30 04:16:01 +04:00
|
|
|
sclite_compiled: sctk_configured
|
|
|
|
cd sctk; \
|
|
|
|
$(MAKE) all && $(MAKE) install && $(MAKE) doc
|
|
|
|
|
|
|
|
sctk_configured:sctk/.configured
|
|
|
|
|
|
|
|
sctk/.configured:sctk
|
|
|
|
cd sctk; $(MAKE) config
|
|
|
|
touch sctk/.configured
|
|
|
|
|
|
|
|
.PHONY: sctk
|
|
|
|
sctk: sctk-2.4.8-20130429-2145.tar.bz2
|
|
|
|
tar xojf sctk-2.4.8-20130429-2145.tar.bz2
|
|
|
|
rm -rf sctk && ln -s sctk-2.4.8 sctk
|
|
|
|
|
|
|
|
sctk-2.4.8-20130429-2145.tar.bz2:
|
|
|
|
wget -T 10 -t 3 ftp://jaguar.ncsl.nist.gov/pub/sctk-2.4.8-20130429-2145.tar.bz2
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
sctk-2.4.0-20091110-0958.tar.bz2:
|
2014-03-24 21:31:34 +04:00
|
|
|
wget -T 10 -t 3 ftp://jaguar.ncsl.nist.gov/pub/sctk-2.4.0-20091110-0958.tar.bz2 || \
|
|
|
|
wget --no-check-certificate -T 10 http://www.openslr.org/resources/4/sctk-2.4.0-20091110-0958.tar.bz2
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
irstlm_tgt: irstlm_compiled
|
|
|
|
|
|
|
|
.PHONY: irstlm_compiled
|
|
|
|
irstlm_compiled: irstlm/Makefile
|
2014-03-24 21:31:34 +04:00
|
|
|
cd irstlm/; \
|
|
|
|
make; $(MAKE) install
|
2012-09-18 22:42:00 +04:00
|
|
|
|
2014-05-30 00:14:21 +04:00
|
|
|
irstlm/Makefile: irstlm
|
2014-03-24 21:31:34 +04:00
|
|
|
cd irstlm; \
|
2014-03-06 07:42:00 +04:00
|
|
|
automake --version | grep 1.13.1 >/dev/null && \
|
|
|
|
sed s:AM_CONFIG_HEADER:AC_CONFIG_HEADERS: <configure.in >configure.ac; \
|
2014-03-24 21:31:34 +04:00
|
|
|
(./regenerate-makefiles.sh || ./regenerate-makefiles.sh) && \
|
|
|
|
./configure --prefix `pwd`
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
irstlm:
|
2014-05-30 00:14:21 +04:00
|
|
|
svn -r 618 co --non-interactive --trust-server-cert https://svn.code.sf.net/p/irstlm/code/trunk irstlm
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
atlas: ATLAS/include/cblas.h
|
|
|
|
|
|
|
|
ATLAS/include/cblas.h: | atlas3.8.3.tar.gz
|
2014-03-24 21:31:34 +04:00
|
|
|
tar xozf atlas3.8.3.tar.gz ATLAS/include
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
atlas3.8.3.tar.gz:
|
2014-03-24 21:31:34 +04:00
|
|
|
wget -T 10 http://sourceforge.net/projects/math-atlas/files/Stable/3.8.3/atlas3.8.3.tar.gz || \
|
|
|
|
wget --no-check-certificate -T 10 -t 3 http://www.danielpovey.com/files/kaldi/atlas3.8.3.tar.gz
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
sph2pipe: sph2pipe_compiled
|
|
|
|
|
|
|
|
sph2pipe_compiled: sph2pipe_v2.5/sph2pipe
|
|
|
|
|
|
|
|
sph2pipe_v2.5/sph2pipe: | sph2pipe_v2.5
|
2014-03-24 21:31:34 +04:00
|
|
|
cd sph2pipe_v2.5/; \
|
|
|
|
$(CC) -o sph2pipe *.c -lm
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
sph2pipe_v2.5: sph2pipe_v2.5.tar.gz
|
2014-03-24 21:31:34 +04:00
|
|
|
tar xzf sph2pipe_v2.5.tar.gz
|
2012-09-18 22:42:00 +04:00
|
|
|
|
|
|
|
sph2pipe_v2.5.tar.gz:
|
2014-03-24 21:31:34 +04:00
|
|
|
wget --no-check-certificate -T 10 https://sourceforge.net/projects/kaldi/files/sph2pipe_v2.5.tar.gz || \
|
|
|
|
wget -T 10 -t 3 http://www.openslr.org/resources/3/sph2pipe_v2.5.tar.gz
|
2012-09-18 22:42:00 +04:00
|
|
|
|
2013-01-16 05:09:56 +04:00
|
|
|
openblas: openblas_compiled
|
|
|
|
|
|
|
|
.PHONY: openblas_compiled
|
|
|
|
|
2013-01-19 02:02:24 +04:00
|
|
|
fortran_opt = $(shell gcc -v 2>&1 | perl -e '$$x = join(" ", <STDIN>); if($$x =~ m/target=\S+64\S+/) { print "BINARY=64"; }')
|
2013-01-16 05:09:56 +04:00
|
|
|
|
|
|
|
openblas_compiled:
|
|
|
|
-git clone git://github.com/xianyi/OpenBLAS
|
2013-01-21 02:19:47 +04:00
|
|
|
$(MAKE) PREFIX=`pwd`/OpenBLAS/install FC=gfortran $(fortran_opt) DEBUG=1 USE_THREAD=0 -C OpenBLAS all install
|
2014-06-23 12:19:53 +04:00
|
|
|
|
2014-06-27 11:34:10 +04:00
|
|
|
beamformit: beamformit-3.51
|
2014-06-23 12:19:53 +04:00
|
|
|
|
2014-06-27 11:34:10 +04:00
|
|
|
.PHONY: beamformit-3.51
|
2014-06-23 12:19:53 +04:00
|
|
|
|
2014-06-27 11:34:10 +04:00
|
|
|
beamformit-3.51: beamformit-3.51.tgz
|
2014-08-08 10:52:54 +04:00
|
|
|
tar -xozf BeamformIt-3.51.tgz; \
|
|
|
|
cd BeamformIt-3.51; cmake . ; make
|
2014-06-23 12:19:53 +04:00
|
|
|
|
2014-06-27 11:34:10 +04:00
|
|
|
beamformit-3.51.tgz:
|
|
|
|
wget -c -T 10 http://www.xavieranguera.com/beamformit/releases/BeamformIt-3.51.tgz
|
2014-06-23 12:19:53 +04:00
|
|
|
|