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

MKL static link in Microsoft Visual C/C++ projects

RM2025
Beginner
2,045 Views

Hi Intel Community,

 

I have a C++ Console App project in MVS 2022 where I call the dgetrf_ method.

I would like to statically link the MKL libraries without using the Project>Properties>Configuration Properties>Intel Libraries for oneAPI settings.

I selected the following settings in the Project>Properties>Configuration Properties section:

  • C/C++>General>Additional Include Directories: ..\MKL\include;
  • Linker>General>Additional Library Directories: ..\MKL\StaticLib;
  • Linker>Input>Additional dependencies: mkl_core.lib;mkl_sequential.lib;mkl_intel_ilp64.lib;mkl_lapack95_ilp64.lib;mkl_blacs_intelmpi_ilp64.lib;mkl_blas95_ilp64.lib;mkl_cdft_core.lib;mkl_sycld.lib;

And the project was successfully built, but the dgetrf_ method returned -1 instead of 0 (= success).

 

If I build the project with the following settings of the Project>Properties>Configuration Properties>Intel Libraries for oneAPI>Intel oneAPI Math Kernel Library section:

  • Use oneMKL: Sequential
  • Use ILP64 interfaces: Yes
  • Use MPI Library: Intel MPI Library

The dgetrf_ method is successfully executed.

 

Could someone help me to understand what is my mistake?

 

I'm using the MKL libraries version 2024.2. I have attached my solution.

 

Thank you,

MR2025

0 Kudos
1 Reply
Fengrui
Moderator
600 Views

It looks MKL\StaticLib is empty.

0 Kudos
Reply