Skip to content

Commit 2ce83ba

Browse files
author
Mathieu Bernard
committed
do not use a recent version of clang (clang-3.9 is fine)
1 parent 8d567e7 commit 2ce83ba

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

docs/source/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ following dependencies: Kaldi, sox, shorten and festival.
4646
C++ compilers
4747
-------------
4848

49-
You need to have both ``gcc`` and ``clang`` installed. On
49+
You need to have both ``gcc`` and ``clang-3.9`` installed. On
5050
Debian/Ubuntu just have a::
5151

52-
sudo apt-get install gcc clang
52+
sudo apt-get install gcc gfortran clang-3.9
5353

5454

5555
Flac, sox and festival

install_kaldi.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
6469
cd $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
6772
sed -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
6974
sed -i "s/OPENFST_VERSION = 1.3.4/# OPENFST_VERSION = 1.3.4/" Makefile
7075
sed -i "s/# OPENFST_VERSION = 1.4.1/OPENFST_VERSION = 1.4.1/" Makefile
7176
make -j $ncores || failure "failed to build kaldi tools"
@@ -79,7 +84,7 @@ cd $kaldi/src
7984
sed -i "s/\-g # -O0 -DKALDI_PARANOID.*$/-O3 -DNDEBUG/" kaldi.mk
8085
# use clang instead of gcc
8186
sed -i "s/ -rdynamic//g" kaldi.mk
82-
sed -i "s/g++/clang++/" kaldi.mk
87+
sed -i "s/g++/clang++-3.9/" kaldi.mk
8388
make depend -j $ncores || failure "failed to setup kaldi dependencies"
8489
make -j $ncores || failure "failed to build kaldi"
8590

0 commit comments

Comments
 (0)