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

How redistribute Intel MKL

Renee
Beginner
1,737 Views

Hi,

we are planing to release an application made in C#, But the internal algorithms is written in C++ that is using some functions of MKL.

I installed Intel MKL. Then I wrap the C++ code with MKL DLL in Visual Studio. I can run the program that the  necessary MKL DLL and my DLL are included in the executable directory in other project. 

However, the DLLs cannot run in C# or C++ project if the windows system does not install Intel MKL.

 

If I release the application, how do I handle the MKL DLL so that others can use the application process without installing Intel MKL.

 

 

 

0 Kudos
9 Replies
PraneethA_Intel
Moderator
1,686 Views

Hi Renxiu,


>>I installed Intel MKL

Could you please provide the Intel MKL version you are using?


Thanks and Regards,

Praneeth Achanta


0 Kudos
Renee
Beginner
1,680 Views

Dear Praneeth,

Thank you very much for your support. I  am using the one MKL 2023.0.0 and I write the project in Visual studio 2022.

 

I retested this DLL. there are two difference results:

system 1:  It can be run on windows system without MKL installed and the results are correct.

 

system 2:  It can run on other windows system without MKL installed, however, the results are not corret. After checking, it is because the result of the MKL function LAPACKE_sgelsd is incorrect.

 

Whether or not to run MKL function requires some special files, which happened to be installed on the system 1, so it can run correctly.

 

Best Regards,

Renxiu

 

 

 

 

 

0 Kudos
PraneethA_Intel
Moderator
1,652 Views

Hi Renxiu,

 

Thanks for providing the details.

 

Could you please cross-verify if the MKL DLLs being used by you in both of your systems were generated from the same version of oneMKL.

 

Could you please get back to us with the environmental details of both systems?

 

In addition, if you need any help you could go through the below link for any licensing-related FAQ's which might help you.

https://www.intel.com/content/www/us/en/developer/articles/tool/onemkl-license-faq.html

 

 

Thanks and Regards,

Praneeth Achanta

 

0 Kudos
Renee
Beginner
1,610 Views

Hi Praneeeth,

 

Thank you so much for providing me with the details about the license.

 

I'm pretty sure that the MKL DLLs used by both systems is the same version because I only have one version of MKL. 

 

I'm already confused. I have uninstalled MKL on my computer and the DLLs can run correctly, although I still do not know which DLLs need to be included in the program, except mkl_*.dll.

 

It will take some time to sort these out, I'll update here if there is any progress. If you have it too, please let me know, thanks.

 

Best Wishes

Renxiu

 

 

 

 

0 Kudos
PraneethA_Intel
Moderator
1,592 Views

Hi Renxiu,


As per our understanding, the DLLs run correctly even without Intel MKL installed. Could you please elaborate a bit, as it helps us analyze your issue better?


According to the requirements of your application, you could also try to generate custom DLLs by following the below guide.


https://www.intel.com/content/www/us/en/docs/onemkl/developer-guide-windows/2023-0/building-custom-dynamic-linked-shared-libraries.html


Thanks and Regards,

Praneeth Achanta


0 Kudos
Renee
Beginner
1,569 Views

Dear Praneeth,

 

Thanks for providing me with guidance on how to build a custom DLLs. 

 

I may have found the cause of this issue!

 

I did some testing with a virtual machine. There are two cases in C# project using my C++ DLLs without MKL installed:

1. VS pro 2015, No C++ environment installed, only C#: it can not run;

2. VS pro 2015, Both C++ and C# are installed: it can run correctly.

 

Maybe there need some C++ environment when C# project uses the DLL.

 

 

The details of my project is following:

 

I use MKL function LAPACKE_sgelsd in Visual Studio Professional 2022 and the below picture shows the details:

Renee_0-1681180970002.png

Then the project is wrapped in dynamic linking including

head files : mkl_lapacke.h, mkl_service.h, mkl_types.h,  

DLLs: mkl_avx.2.dll, mkl_avx2.2.dll, mkl_core.2.dll, mkl_sequential.2.dll

and libs: mkl_core.lib, mkl_intel_ilp64.lib, mkl_sequential.lib.

The threading layer is selected with Sequential in VS2022.

 

 

Best Wishes,

Renxiu

 

 

 

0 Kudos
PraneethA_Intel
Moderator
1,555 Views

Hi Renxiu,

 

>>I may have found the cause of this issue!

Thanks for sharing the root cause with us. We assume that you were able to run your application successfully with the C++ and C# environments installed in your systems mentioned earlier.

 

Kindly let us know if you need any other information or if we could close this case at our end.

 

Thanks and Regards,

Praneeth Achanta

 

0 Kudos
Renee
Beginner
1,539 Views

Hi Praneeeth,

 

Thank you for help. I don't have any more questions at the moment.

 

Best Wishes,

Renxiu

0 Kudos
PraneethA_Intel
Moderator
1,525 Views

Hi Renxiu,


>> I don't have any more questions at the moment.

Thank you for confirming. Glad your issue was resolved. This thread will no longer be monitored by Intel. If you need any further assistance, please post a new question.


Thanks and Regards,

Praneeth Achanta


0 Kudos
Reply