Registry / data / mkl-include

mkl-include

JSON →
library2026.0.0pypypiunverified

Intel® oneAPI Math Kernel Library (oneMKL) is a highly optimized, extensively threaded math library for high-performance computing. The `mkl-include` package provides the C and Data Parallel C++ (DPC++) programming language interfaces (header files) required for building applications and other libraries that link against oneMKL. It helps optimize numerical routines for Intel® CPUs and GPUs. The current version is 2025.3.1, with frequent releases aligning with the Intel oneAPI toolkit cadence.

pip install mkl-include
INSTALL
IMPORT
SIG · MKL-INCLUDE
M
mkl-include
datapythonv2026.0.0
Install
1.6s avg
Import
Disk
16MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2026.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mkl-include
This package provides C/C++ header files and is not directly imported in Python user code. Python interaction with MKL is typically through other libraries (e.g., NumPy, SciPy, or `mkl-service`) that are built to use MKL.
The `mkl-include` package provides build-time headers for C/C++ compilation, not Python runtime imports. Python libraries like NumPy and SciPy, when built with MKL, implicitly use its optimizations. For Python-level control of MKL, consider `mkl-service`.

The `mkl-include` package itself is not directly used in Python code. Instead, it provides the necessary build-time headers for other Python libraries (like NumPy or SciPy) to be compiled and linked against the Intel oneMKL for performance acceleration. This quickstart demonstrates how to check if NumPy is utilizing MKL (e.g., via `mkl-service`) and how to use `mkl-service` for runtime control over MKL behavior within Python.

import numpy as np import os # --- Check if NumPy is linked against MKL (requires mkl-service or similar detection) --- try: import mkl print(f"MKL-service is imported. MKL version: {mkl.get_version()}") print(f"MKL number of threads: {mkl.get_max_threads()}") print("NumPy is likely using MKL through the loaded mkl-service library.") except ImportError: print("mkl-service not found. Checking numpy config.") # A more direct way to check NumPy's backend (may not explicitly show MKL vs OpenBLAS, etc.) print(f"\nNumPy config:\n{np.show_config()}") # --- Example of using mkl-service to control MKL runtime (if installed) --- if 'mkl' in locals(): # Set MKL to use a specific number of threads for a domain mkl.set_num_threads(2) print(f"\nMKL threads set to: {mkl.get_max_threads()}") # Perform a computation that would benefit from MKL a = np.random.rand(1000, 1000) b = np.random.rand(1000, 1000) c = a @ b # Matrix multiplication, often MKL-accelerated print(f"Matrix multiplication completed. Shape: {c.shape}") # To explicitly use MKL for a library like NumPy, you generally install a MKL-optimized build. # Example (concept, exact command depends on source): # pip install numpy scipy --index-url https://urob.github.io/numpy-mkl # For specific MKL wheels
Debug
Known issues
gotchaThe `MKLROOT` environment variable, crucial for C/C++ development and linking, is not automatically set by a `pip install mkl-include`. Users must manually configure this path.
fix
After installation, locate the MKL directory (e.g., in your Python environment or oneAPI installation) and set `MKLROOT` to point to it. For example, `export MKLROOT=/path/to/intel/oneapi/mkl/latest` in bash, or update system environment variables.
affects: All versions
breakingSome BLAS and LAPACK functions in oneMKL versions prior to 2025.0.1 experienced runtime errors on AMD hardware in Windows.
fix
Upgrade to oneMKL version 2025.0.1 or later. Alternatively, for non-Intel CPUs, consider setting `MKL_DEBUG_CPU_TYPE=5` as an environment variable to force a Haswell/Broadwell code path, potentially improving performance over the default SSE2 fallback.
affects: < 2025.0.1
deprecatedCertain configuration parameters for the oneMKL SYCL* DFT APIs (`INPUT_STRIDES`, `OUTPUT_STRIDES`) were deprecated in the 2024.1 release and are scheduled for removal in oneMKL 2026.0.
fix
Review Intel oneMKL documentation for updated SYCL* DFT API usage and alternative parameters if you are directly programming with these APIs.
affects: 2024.1+
gotchaWhen linking NumPy and SciPy, using both `numpy` BLAS and `scipy` BLAS simultaneously is not supported by MKL and may lead to crashes.
fix
Ensure consistent use of either NumPy's or SciPy's linear algebra functions. If using SciPy BLAS, `MKL_INTERFACE_LAYER=GNU` should be set.
affects: All versions
Upgrade
Version history
2026.0.0latest on PyPI · released Apr 24, 2026
Audit
Dependencies
mkl-serviceoptionalProvides Python-level runtime control over MKL threading, memory management, and conditional numerical reproducibility. Often used alongside MKL-linked NumPy/SciPy.
numpyoptionalOften linked against MKL for accelerated linear algebra operations. `mkl-include` provides headers for building NumPy with MKL support.
scipyoptionalOften linked against MKL for accelerated scientific computing routines. `mkl-include` provides headers for building SciPy with MKL support.
Agent activity
6 hits · last 30 days
node
6
Resources
mkl-include — pip install mkl-include · libregistry