@@ -55,17 +55,22 @@ kaldi=$(realpath $kaldi/src)
5555# From $kaldi/tools/extras/check_dependencies.sh. Debian systems
5656# generally link /bin/sh to dash, which doesn't work with some scripts
5757# as it doesn't expand x.{1,2}.y to x.1.y x.2.y
58- [ $( realpath /bin/sh) == " /bin/ dash" ] && \
58+ [[ $( realpath /bin/sh) == * " dash" * ] ] && \
5959 failure " failed because /bin/sh is linked to dash, and currently \
6060 some of the scripts will not run properly. We recommend to run: \
6161 sudo ln -s -f bash /bin/sh"
6262
63+ # make sure gfortran and clang++-3.9 are installed
64+ [ -z $( which gfortran) ] && failure " error: gfortran not installed, please install it"
65+ [ -z $( which clang++-3.9) ] && failure " error: clang++-3.9 not installed, please install it"
66+ [ -z $( which gawk) ] && failure " error: gawk not installed, please install it"
67+
6368# compile kaldi tools
6469cd $kaldi /tools
6570./extras/check_dependencies.sh || failure " failed to check kaldi dependencies"
6671# use clang instead of gcc, and openfst-1.4.1 instead of 1.3.4
6772sed -i " s/CXX = g++/# CXX = g++/" Makefile
68- sed -i " s/# CXX = clang++/CXX = clang++/" Makefile
73+ sed -i " s/# CXX = clang++/CXX = clang++-3.9 /" Makefile
6974sed -i " s/OPENFST_VERSION = 1.3.4/# OPENFST_VERSION = 1.3.4/" Makefile
7075sed -i " s/# OPENFST_VERSION = 1.4.1/OPENFST_VERSION = 1.4.1/" Makefile
7176make -j $ncores || failure " failed to build kaldi tools"
@@ -79,7 +84,7 @@ cd $kaldi/src
7984sed -i " s/\-g # -O0 -DKALDI_PARANOID.*$/-O3 -DNDEBUG/" kaldi.mk
8085# use clang instead of gcc
8186sed -i " s/ -rdynamic//g" kaldi.mk
82- sed -i " s/g++/clang++/" kaldi.mk
87+ sed -i " s/g++/clang++-3.9 /" kaldi.mk
8388make depend -j $ncores || failure " failed to setup kaldi dependencies"
8489make -j $ncores || failure " failed to build kaldi"
8590
0 commit comments