Kaldi has recently switched to Intel Math Kernel Libraries (MKL) for linear algebra operations (as of April 2019). However, installing MKL (by running tools/extras/install_mkl.sh) requires root access. This post details how kaldi (with MKL) can be installed without root access.
- Download Kaldi
- Download the MKL standalone installer from here.
- Extract the contents and launch the installer by running
install.sh. - When asked for the path to install, specify a location where you have write access (e.g.,
/home/<username>/intel) - Complete the installation of MKL libraries
- Extract the contents and launch the installer by running
- Navigate to the kaldi folder
kaldi/tools - Typically the first step is to run
extras/check_dependencies.sh. This will complain about the missing MKL libraries. This is because the script expects the MKL libraries to be located under/opt/inteldirectory. As of now (May 2019), there is no option to pass themkl-rootdirectory to this script. Therefore we will edit theextras/check_dependencies.shscript by changing/opt/intel/mkl/include/mkl.hto/home/<username>/intel/mkl/include/mkl.h. Then runningextras/check_dependencies.shshould work fine without any MKL related warnings. - Then run
make -j <numcpu>to install the tools required by kaldi - Navigate to the
kaldi/srcfolder. - Run
./configurewith the--mkl-rootoption../configure --shared --mkl-root=/home/<username>/intel/mkl - Then install kaldi using the usual steps
make depend -j <numcpu> make -j <numcpu>
This will install Kaldi with MKL support without requiring any root privileges.
Discussion