Skip to content

Commit f5bf3cb

Browse files
author
kkm
committed
Fix bash syntax (3.2) and MKL install sugestion for MacOS
1 parent 1392eab commit f5bf3cb

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

tools/extras/check_dependencies.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,14 @@ printed=false
135135
# it if installed in an alternative location (this is unlikely).
136136
if [ ! -f /opt/intel/mkl/include/mkl.h ] &&
137137
! echo '#include <mkl.h>' | $CXX -I /opt/intel/mkl/include -E - >&/dev/null; then
138-
echo "$0: Intel MKL is not installed. Run extras/install_mkl.sh to intall it.
139-
... You can also use other matrix algebra libraries; for information, see
138+
if [[ $(uname) == Linux ]]; then
139+
echo "$0: Intel MKL is not installed. Run extras/install_mkl.sh to install it."
140+
else
141+
echo "$0: Intel MKL is not installed. Download the installer package for your
142+
... system from: https://software.intel.com/mkl/choose-download."
143+
fi
144+
echo "\
145+
... You can also use other matrix algebra libraries. For information, see:
140146
... http://kaldi-asr.org/doc/matrixwrap.html"
141147
printed=true
142148
fi
@@ -147,12 +153,13 @@ if [ -n "$debian_packages" ]; then
147153
# Guess package manager from user's distribution type. Use a subshell
148154
# because we are potentially importing a lot of dirt here.
149155
eval $(grep 2>/dev/null ^ID /etc/os-release) 2>/dev/null
150-
for rune in $ID $ID_LIKE; do
156+
for rune in ${ID-} ${ID_LIKE-}; do
157+
# The case '(pattern)' syntax is necessary in subshell for bash 3.x.
151158
case $rune in
152-
rhel|centos|redhat) echo "yum install $redhat_packages"; break;;
153-
fedora) echo "dnx install $redhat_packages"; break;;
154-
suse) echo "zypper install $opensuse_packages"; break;;
155-
debian) echo "apt-get install $debian_packages"; break;;
159+
(rhel|centos|redhat) echo "yum install $redhat_packages"; break;;
160+
(fedora) echo "dnx install $redhat_packages"; break;;
161+
(suse) echo "zypper install $opensuse_packages"; break;;
162+
(debian) echo "apt-get install $debian_packages"; break;;
156163
esac
157164
done
158165
)

0 commit comments

Comments
 (0)