Compiling KALDI with OpenMPI and MKL

KALDI (Kaldi Speech Recognition Toolkit)

Step 1: Git Clone kaldi packages

% git clone

Step 2: Check Dependencies.

Do run the following steps in the blog entry Fixing zlib Dependencies Issues for kaldi

Step 3: Load OpenMPI-3.1.4 with GNU-6.5

You may wish to compile OpenMPI with GNU-6.5 according to Compiling OpenMPI-3.1.6 with GCC-6.5

Step 4: Compile kaldi tools

% cd /usr/local/kaldi/tools
% make
All done OK.

(This make take a long well)

Step 5: Compile src of the main kaldi

% source /usr/local/intel/2018u3/mkl/bin/ intel64
% export CXXFLAGS="-I/usr/local/zlib-1.2.11/include"
% ./configure --use-cuda=no
% make -j clean depend
% make -j 4

Fixing zlib Dependencies Issues for kaldi

What is Kaldi?

Kaldi is a toolkit for speech recognition, intended for use by speech recognition researchers and professionals. Find the code repository at

Downloading Kaldi

% git clone

Checking Dependencies

Before you can compile, you may want to check the required dependencies

% cd kaldi/tools

Running the Dependencies Test

% cd kaldi/tools/extras

Load Intel Compilers and MLK

export MKLROOT=/usr/local/intel_2018/mkl/lib

Run the Check_Dependencies Test

% ./
./ zlib is not installed.
./ Some prerequisites are missing; install them using the command:
sudo yum install zlib-devel

(This error is strange because becuase zlib and zlib-devel has already been installed)

I used instead a compiled zlib. For more information how to compile zlib, see Compile zlib-1.2.8 with Intel-15.0.6

Next CXXFLAGS on your .bashrc.


Source ~/.bashrc once again.

% source ~/.bashrc
[user1@node1 extras]$ ./
./ all OK.