Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Possible to get minimal MKL via Apt?

Matt_Thompson
Novice
1,233 Views

All,

Just a question. I manage some docker images for a climate model that (currently) has a requirement on MKL. I don't really mind this except the fact that adding MKL adds 1.8GB to the image. I install in this Ubuntu 20 image with apt (following https://software.intel.com/content/www/us/en/develop/articles/installing-intel-free-libs-and-python-...

# MKL version 2020.0-088
RUN wget -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB 2> /dev/null | apt-key add - && \
    sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' && \
    apt-get update && \
    apt-get install -y intel-mkl-64bit-2020.0-088 && \
    rm -rf /var/lib/apt/lists/*

and when I do I see:

The following NEW packages will be installed:
  intel-comp-l-all-vars-19.1.0-166 intel-comp-nomcu-vars-19.1.0-166
  intel-conda-index-tool-19.1.0-166
  intel-conda-intel-openmp-linux-64-shadow-package-19.1.0-166
  intel-conda-mkl-devel-linux-64-shadow-package-2020.0-166
  intel-conda-mkl-include-linux-64-shadow-package-2020.0-166
  intel-conda-mkl-linux-64-shadow-package-2020.0-166
  intel-conda-mkl-static-linux-64-shadow-package-2020.0-166
  intel-conda-tbb-linux-64-shadow-package-2020.0-166
  intel-mkl-64bit-2020.0-088 intel-mkl-cluster-2020.0-166
  intel-mkl-cluster-c-2020.0-166 intel-mkl-cluster-f-2020.0-166
  intel-mkl-cluster-rt-2020.0-166 intel-mkl-common-2020.0-166
  intel-mkl-common-c-2020.0-166 intel-mkl-common-c-ps-2020.0-166
  intel-mkl-common-f-2020.0-166 intel-mkl-common-ps-2020.0-166
  intel-mkl-core-2020.0-166 intel-mkl-core-c-2020.0-166
  intel-mkl-core-f-2020.0-166 intel-mkl-core-ps-2020.0-166
  intel-mkl-core-rt-2020.0-166 intel-mkl-doc-2020 intel-mkl-doc-ps-2020
  intel-mkl-f95-2020.0-166 intel-mkl-f95-common-2020.0-166
  intel-mkl-gnu-2020.0-166 intel-mkl-gnu-c-2020.0-166
  intel-mkl-gnu-f-2020.0-166 intel-mkl-gnu-f-rt-2020.0-166
  intel-mkl-gnu-rt-2020.0-166 intel-mkl-pgi-2020.0-166
  intel-mkl-pgi-c-2020.0-166 intel-mkl-pgi-rt-2020.0-166
  intel-mkl-psxe-2020.0-088 intel-mkl-tbb-2020.0-166
  intel-mkl-tbb-rt-2020.0-166 intel-openmp-19.1.0-166
  intel-psxe-common-2020.0-088 intel-psxe-common-doc-2020
  intel-tbb-libs-2020.0-166

I guess my question is: is there a way I can slim this down? I tried interactively doing something like "Remove the PGI bits as I'm only GNU" but:

apt-get remove intel-mkl-pgi-c-2020.0-166

 leads to no more MKL:

The following packages will be REMOVED:
  intel-mkl-64bit-2020.0-088 intel-mkl-pgi-c-2020.0-166

I'm exploring using something like this gist: https://gist.github.com/mgoldey/f3886b7accc0cd730e37528e09f7bc81, but I wondered if anyone had a different/better way to slim down MKL in the image?

Thanks,

Matt

0 Kudos
4 Replies
Gennady_F_Intel
Moderator
1,214 Views

Matt, actually MKL doesn’t provide the tested way to removing some of the already installed components like PGI or Cluster components… This some kind of comment of course.

Gennady



Matt_Thompson
Novice
1,211 Views

I figured. I'm currently using the method the Gist implied and just nuking bits of the install my image doesn't need. Docs? Benchmarks? Static libraries? Away!

Gennady_F_Intel
Moderator
1,204 Views

You only need headers ( Include), libs, and dll ( see the redist folder). By default, 64 and 32-bit Libraries and DLLs are installed. You may significantly reduce the size by removing for example 32 bits if you are using 64 bits only.

Doc, Benchmarks, Tools, and Examples are not needed to link and execute your application with MKL.

-Gennady


Gennady_F_Intel
Moderator
1,186 Views

The issue is closing and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Reply