Developer Guide

Developer Guide for Intel® oneAPI Math Kernel Library Windows*

ID 766692
Date 10/31/2024
Public
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 share\mkl\tools\builder\MSVS_Projects subdirectory of the Intel® oneAPI Math Kernel Library (oneMKL) directory. The directory contains subdirectories with projects for the respective versions of the Visual Studio Development System, for example,VS2022. For each version of VS, a VS solution libintel64.sln is available to build a custom DLL for the Intel® 64 architecture.

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

Interface:

LP64

Error handler:

Native Intel® oneAPI Math Kernel Library (oneMKL)xerbla

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 (oneMKL) version you are going to use.

  2. Open the libintel64.sln solution.

    The solution includes the following projects:

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

  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.