Using Intel® MKL with MATLAB*

1. Overview

This guide is intended to help Intel Math Kernel Library (Intel® MKL) customers use the latest version of Intel® MKL for Windows* with The MathWorks* MATLAB
MATLAB* is an interactive software program that performs mathematical computations and visualization. For more information about MATLAB visit

Version Information
This note was created to help users of MATLAB R2015b make use of Intel MKL 2017

2. Dependencies

This note applies to MATLAB R2015b and Intel MKL 2017

The note should work for all hardware configurations that meet the system requirements for both MATLAB R2015b and Intel MKL 2017. This note has been tested on Intel® Core® i5-6300 CPU.

Operating System:
This note should work for Windows* users of MATLAB.

3. Obtaining the Latest Version of Intel MKL

The latest release of the Intel Math Kernel Library is available at  You can download the latest Intel MKL if you have a valid license.  You can also obtain the latest version by renewing your current license or registering for a free 30-day evaluation or get the community license for free.

4. Building a Custom DLL

By default, MATLAB R2015b uses the Intel MKL 11.1 Basic Linear Algebra Subroutines (BLAS) libraries to perform computations. To upgrade to the Intel MKL 2017 release, you need to create a DLL using the Intel MKL 2017 or later custom DLL builder located in ${MKL}\tools\builder:

  • Scroll to the bottom of this page and download the attached file
  • Extract and copy the files from and copy them to ${MKL}\tools\builder. It may be preferable to save the old ones by renaming them or moving them to a temporary folder.
  • Customize the makefile by editing the CB_EXPORT=functions_list. It’s on line 101 in MKL version of 2017.
  • The custom DLL is built from the command line via a makefile with command nmake. Set the command environment as appropriate for your compiler.
    To start the Intel® Compiler Command Line Windows, from the Start Menu select Programs>> Intel®  Software Development Tools >> Intel® Compiler [version] >> Build Environment for...
    To Start the Microsoft® Compiler, from the Start Menu select Programs>>Microsoft Visual Studio 20xx>> Visual Studio Tools>> Visual Studio 20xx Command Prompt.
    Build the custom DLL with the following command nmake libintel64 for a 64-static library. For additional options such as customizing the name of the DLL, please refer to the Intel MKL User Guide.
    After this you will find the resulting file at ${MKL}\tools\builder\mkl_custom.dll.
  • Finally, either add the path of mkl_custom.dll to the Matlab path[y1]  by using getenv() function and setenv() function; or copy the mkl_custom.dll to C:\Windows\System32 so that the library can be found.
  • Here is an example of adding a path to 'INCLUDE' list.


    >>setenv('INCLUDE',[getenv('INCLUDE') ';C:\Program Files (x86)\IntelSWTools\\windows\daal\include']);


5. MATLAB Configuration

Modify the system environment so that MATLAB uses the Intel MKL BLAS functions from the custom DLL. Set the BLAS_VERSION environment variable by following the steps on Windows XP:

  • Click Start, go to the Settings menu and select Control Panel.
  • Select System to open the System Properties dialog box.
  • Click the Advanced tab.
  • Click the Environment Variables button to open the Environment Variables dialog box.
  • Under the User variables section, click the New button to open the New User Variable dialog box.
  • Set the name of the variable to BLAS_VERSION and set the value of the variable to mkl_custom.dll.

6. Running MATLAB

Start MATLAB R2010a as you normally would and the Intel MKL BLAS library will be called.

7. Verifying Correctness

From MATLAB, run the command version –blas and check that the output should be “Version information not found” (Since mkl_custom.dll does not include version information).

Alternatively, run the command version -modules and check the output list to verify that the custom DLL is loaded.

8. Troubleshooting

The error "The specified module could not be found." occurs for two cases:

  1. One or more of the required interfaces is missing from the custom DLL
    Solution: Follow the steps in section 4 and rebuild the custom DLL.
  2. The custom DLL is not found.
    Solution: Verify that the path to and the name of the custom DLL is correct (see section 5).

Appendix A - References

For more complete information about compiler optimizations, see our Optimization Notice.
Package icon matlab_custom_dll.zip1.11 KB


Davide T.'s picture

 matlab_custom_dll.rar where is supposed to be? lul

Noah C.'s picture

I do not see any download link for a .dll, .rar, or a .zip at the bottom of the page, contrary to what the article suggests.

anonymous's picture

Can you, please, expand this article by adding instructions for models the canal.
Thank you.

eliosh's picture

Can you, please, expand this article by adding instructions for Linux.
Thank you.

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.