Developer Guide

Developer Guide for Intel® oneAPI Math Kernel Library Windows*

ID 766692
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Building a Custom Dynamic-link Library in the Visual Studio* Development System

You can build a custom dynamic-link library (DLL) in the Microsoft Visual Studio* Development System (VS*). To do this, use projects available in the tools\builder\MSVS_Projectssubdirectory of the Intel® oneAPI Math Kernel Library directory. The directory contains subdirectories with projects for the respective versions of the Visual Studio Development System, for example,VS2012. For each version of VS two solutions are available:

  • libia32.sln builds a custom DLL for the IA-32 architecture.
  • libintel64.sln builds a custom DLL for the Intel® 64 architecture.

The builder uses the following default settings for the custom DLL:

Interface:

cdecl for the IA-32 architecture and LP64 for the Intel 64 architecture

Error handler:

Native Intel® oneAPI Math Kernel Libraryxerbla

Create Microsoft manifest:

yes

List of functions:

in the project's source file examples.def

To build a custom DLL:

  1. Set the MKLROOTenvironment variable with the installation directory of the Intel® oneAPI Math Kernel Library version you are going to use.

  2. Open the libia32.sln or libintel64.sln solution depending on the architecture of your system.

    The solution includes the following projects:

    • i_malloc_dll
    • vml_dll_core
    • cdecl_parallel (in libia32.sln) or lp64_parallel (in libintel64.sln)
    • cdecl_sequential (in libia32.sln) or lp64_sequential (in libintel64.sln)
  3. [Optional] To change any of the default settings, select the project depending on whether the DLL will use Intel® oneAPI Math Kernel Library functions in the sequential or multi-threaded mode:

    • In the libia32 solution, select the cdecl_sequential or cdecl_parallel project.
    • In the libintel64 solution, select the lp64_sequential or lp64_parallel project.
  4. [Optional] To include your own error handler in the DLL:

    1. Select Project>Properties>Configuration Properties>Linker>Input.
    2. Add <user_xerbla>.obj
  5. [Optional] To turn off creation of the manifest:

    1. Select Project>Properties>Configuration Properties>Linker>Manifest File>Generate Manifest.
    2. Select: no.
  6. [Optional] To change the list of functions to be included in the DLL:

    1. Select Source Files.
    2. Edit the examples.def file. Refer to Specifying Function Names for how to specify entry points.
  7. To build the library, select Build>Build Solution.