Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
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

Using a Fortran Interface Module for Support Functions

To call a support function from your Fortran application, include one of the following statements in your code:

  • INCLUDE mkl_service.fi or INCLUDE mkl.fi
  • USE mkl_service

The USE statement references the mkl_service.modinterface module corresponding to your architecture and programming interface. The module provides an application programming interface to Intel® oneAPI Math Kernel Library support entities, such as subroutines and constants. Because Fortran interface modules are compiler-dependent, Intel® oneAPI Math Kernel Library offers themkl_service.f90 source file for the module, as well as architecture-specific and interface-specific mkl_servicemodules precompiled with the Intel® Fortran or Intel® Visual Fortran compiler. These modules are available in the following subdirectories of the Intel® oneAPI Math Kernel Library include directory:

Architecture, Interface

Subdirectory of the Intel® oneAPI Math Kernel Library Installation Directory

IA-32

include\ia32

Intel® 64, LP64

include\intel64\lp64

Intel® 64, ILP64

include\intel64\ilp64

To ensure that your application searches the right module, specify the appropriate subdirectory during compilation as an additional directory for the include path (through the /I option on Windows* OS or the -I option on Linux* OS or macOS*).

If you are using a non-Intel Fortran compiler, you need to build the module yourself by compiling the mkl_service.f90file, available in the Intel® oneAPI Math Kernel Library include directory.

For more information on compiler-dependent functions and modules, refer to the Intel® oneAPI Math Kernel Library Developer Guide.