Build MKL FFT and other pip wheel libraries

As pip only releases wheels of MKL for python 3.7+, we need to build these wheel files for ourselves, here is a simple step to build from source. You can insert those command line steps into your Dockerfile.

Install MKL 2021.2.0 on ubuntu 18.04

wget https://registrationcenter-download.intel.com/akdlm/irc_nas/17769/l_BaseKit_p_2021.2.0.2883_offline.sh
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-basekit-2021.2.0

Clone the MKL libraries from IntelPython:

git@github.com:IntelPython/mkl_fft.git
cd mkl_fft
export MKLROOT="/opt/intel/oneapi/mkl/2021.2.0/"
python setup.py bdist_wheel

Then you can find those distributable pip wheel files from ./dist/xxx.whl

Written on February 14, 2021