Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Detecting if Intel MKL is enabled in Visual Studio project's properties

Demiray__Baris
1,024 Views

Hello all,

I am working on a project where Intel MKL is nice to have, but not available on all the targeted platforms, so I have to check for its presence to behave accordingly.

I have enabled the Intel Performance Libraries in my Visual Studio project's properties, as explained in Compiling and Linking Intel® Math Kernel Library with Microsoft* Visual C++* and in Intel® Math Kernel Library (Intel® MKL) 2018 Getting Started but I'm not getting any of the preprocessor definitions described in Using Predefined Preprocessor Symbols for Intel® MKL Version-Dependent Compilation, e.g. __INTEL_MKL__ is not defined.

Any ideas how I can have these defined? Or any other means to detect Intel MKL?

Please note that I don't use any intermediary build tool like Cmake.

Thanks in advance.
0 Kudos
2 Replies
Demiray__Baris
1,024 Views

I found a way that is a good compromise yet not very elegant.

Apparently we can check values of Property Pages settings in Build Events. After discovering a macro named UseIntelMKL I decided to tie a config.h to the value of it accordingly, and use the preprocessor directives defined in this config.h instead.

Here is roughly the script that acts as Pre-build Event. I am basically defining __INTEL_MKL__myself in config-mkl.h.

if "$(UseIntelMKL)"=="Parallel" (
  xcopy /Y /I $(ProjectDir)config-mkl.h $(ProjectDir)config.h
) else (
  xcopy /Y /I $(ProjectDir)config-nomkl.h $(ProjectDir)config.h
)

I'd still appreciate if someone knows a more elegant way.

0 Kudos
Jing_Xu
Employee
1,024 Views

Hi,

Thank you for this concern.

You will get those predefined environment variables if you have included "mkl.h" in the souce code.

Your config.h is a good try.

I'll escalate this request to our engineer team.

Thank you.

0 Kudos
Reply