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

Using Armadillo with MKL - Beginner

vik__r
Beginner
2,497 Views

Hi all.

I had a few questions regarding the usage of the Armadillo library with MKL. Apologies in advance if this is not the right place for them. I'm currently on Ubuntu 16.04, using gcc 5.4.0. 

  1. When there are other installations of BLAS/OpenBLAS and Lapack, how does one direct Armadillo to use MKL?
  2. In the ${MKLROOT}/mkl/lib/intel64_lin folder, there are plenty of different libraries (static and dynamic). Since I am only using the functions that Armadillo provides and not building any of my own (at least not any that use MKL), which libraries am I supposed to link gcc with when compiling? 

Thank you so much!

0 Kudos
4 Replies
Gennady_F_Intel
Moderator
2,497 Views

here is from Armadillo FAQ:

  • Can I use high-speed LAPACK and BLAS replacements (eg. OpenBLASACMLMKL) ? 
    Yes. The CMake installer should figure out they are available on your system. Otherwise, you can directly link with such libraries -- see answers to previous questions

You may take a look at the MKL Linker Adviser ( https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor) which shows how to link all mkl's stuff. 

0 Kudos
vik__r
Beginner
2,497 Views

Hi,

Thank you for responding. I have read through Armadillo's FAQ, and the particularly pertinent point is

you can directly link with such libraries -- see answers to previous questions

When using OpenBLAS, for example, it's a simple matter of adding -lopenblas to gcc. However, there are many more options with MKL. I did look through the Linker Adviser and selected the options that I *thought* were right, but I'm not entirely sure if these are Armadillo's most optimal. Thus, I was wondering if anybody else who uses Armadillo with MKL could possibly respond.

0 Kudos
mecej4
Honored Contributor III
2,497 Views

Waiting for someone else to do exactly what you want done is not likely to be fruitful.

The decision as to which libraries to use should be informed by compatibility and suitability. These considerations are no different for MKL than any other library.

Sorry, I know nothing about Armadillo.

0 Kudos
Ying_H_Intel
Employee
2,497 Views

Hi Vik,

if only consider the replace the -lopenblas,  you can use -lmkl_rt .  (which is dynamic library  and you can source /opt/intel/mkl/bin/mklvars.sh intel64 to setting the mkl environment).

Or link mkl static library as   https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor

If you still run the problem, could you please submit the issue to  https://supporttickets.intel.com/?lang=en-US , where our support team will work with you on the exact problem.

Best Regards,

Ying

Ps.

Here is some mkl and other third-party library

https://software.intel.com/en-us/articles/intel-mkl-and-third-party-applications-how-to-use-them-together

https://software.intel.com/en-us/articles/intelr-mkl-and-c-template-libraries

0 Kudos
Reply