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

link with mkl ilp 64 intel c++ compiler

marcsolal
Beginner
883 Views

I am trying to compile my code with mkl. I was using intel c++ on linux compiler using -mkl=parallel option.

From the documentation, I understand this does not link with the ilp64 libraries but only with the lp64 library. I have to specify manually the libraries. Am I correct? I was thinking that using the parameter ilp64 when setting up the environnments variables using intel mkl batch file would tell the compiler to use the ilp64 version of the library. It looks it is not the case. In this case, I do not understand why there is a ilp64 parameter for the batch file. Am I missing something? This is very confusing and I lost several days to figure it out.

Thanks,

Marc

0 Kudos
3 Replies
Arthur_A_Intel
Employee
883 Views

Have you tried using the Intel® Math Kernel Library Link Line Advisor? You can input your desired parameters and it will return the recommended link line for the specified compiler.

0 Kudos
Zhen_Z_Intel
Employee
883 Views

Dear customer,

You could use 64bit integer for interface layer while you are using parallel threading. If you are using -mkl=parallel, you have at least select one method, openMP/ TBB. Compile with option -DMKL_ILP64, and link with library for libmkl_intel_ilp64 whatever you are using icc/gcc. Arthura provide a good solution using MKL advisor to help you generate compiling & linking line quickly. Hope it would be useful to you.

Best regards,
Fiona

0 Kudos
marcsolal
Beginner
883 Views

Fiona,

Actually, in my experience, using -mkl=parallel, selecting OPENMP, using DMKL_ILP64 results automatically in linking with the 32 bits integer library even if the library libmk_intel_ilp64 is specified. I finally used the link advisor and it works perfectly now. But, it took me one week to understand what was my problem. Maybe somebody else will get into the same issue. It is why I wrote this post. Also, one question. When running the script mklvars.sh to define the environment variables, one option is ilp64. The documentation is station this is the "Programming interface (LP64 or ILP64)". I was confused and assumed falsly that this was enough to specify to link with the ilp64 library since I used the ilp64 parameter. Why is this parameter  present if it is not used to chose the library to link with.

Thanks. 

 

 

0 Kudos
Reply