Community
cancel
Showing results for 
Search instead for 
Did you mean: 
vik__r
Beginner
781 Views

Using Armadillo with MKL - Beginner

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
781 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. 

vik__r
Beginner
781 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.

mecej4
Black Belt
781 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.

Ying_H_Intel
Employee
781 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-tog...

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

Reply