{"id":8370,"library":"onemkl-license","title":"Intel oneAPI Math Kernel Library License","description":"Intel oneAPI Math Kernel Library (oneMKL) is a collection of optimized math routines for scientific, engineering, and financial applications, including BLAS, LAPACK, sparse solvers, FFTs, and vector math. The `onemkl-license` PyPI package provides the licensing information for Intel oneMKL. It is not a direct Python-callable library for mathematical computations but rather a component that signifies the presence and licensing of the underlying oneMKL binaries, which are typically utilized by other Python packages (e.g., NumPy, SciPy) or through specific Python bindings like `mkl-service`, `mkl-fft`, and `mkl-random`. The current version is 2025.3.1, with releases tied to the oneAPI toolkit cadence.","status":"active","version":"2025.3.1","language":"en","source_language":"en","source_url":"https://pypi.org/project/onemkl-license/","tags":["intel","oneapi","mkl","math","numerical-computing","performance"],"install":[{"cmd":"pip install onemkl-license","lang":"bash","label":"Install the license package"},{"cmd":"conda install -c intel intel-oneapi-mkl","lang":"bash","label":"Install Intel oneMKL with Conda (recommended for full functionality and integration)"}],"dependencies":[{"reason":"Provides the actual mathematical routines. The `onemkl-license` package indicates its presence. Often implicitly used by NumPy/SciPy.","package":"intel-oneapi-mkl","optional":false},{"reason":"Python interface for runtime control settings of oneMKL.","package":"mkl-service","optional":true},{"reason":"Python interface to oneMKL Fourier Transform Functions.","package":"mkl-fft","optional":true},{"reason":"NumPy-based Python interface to oneMKL Random Number Generation functionality.","package":"mkl-random","optional":true}],"imports":[{"note":"The `onemkl-license` package itself is for licensing and does not expose direct computational functions. For interaction with oneMKL, use packages like `mkl-service`, `mkl-fft`, or `mkl-random`, or rely on other libraries (e.g., NumPy) compiled with MKL support.","symbol":"onemkl_license","correct":"import onemkl_license\n# onemkl_license does not expose callable functions for math operations.\n# It's primarily a marker for the MKL installation and license."},{"note":"The 'mkl' module for runtime control is part of the `mkl-service` package, not `onemkl-license`.","wrong":"from onemkl_license import mkl","symbol":"mkl","correct":"import mkl\n# This import is typically for the 'mkl-service' package."}],"quickstart":{"code":"import os\nimport platform\n\ntry:\n    # mkl-service is a common way to interact with MKL runtime settings\n    import mkl\n    print(f\"MKL version: {mkl.get_version()}\")\n    print(f\"MKL threading layer: {mkl.get_threading_layer()}\")\n\n    # Example: Setting the number of MKL threads\n    # mkl.set_num_threads(4)\n    # print(f\"MKL threads set to: {mkl.get_max_threads()}\")\n\nexcept ImportError:\n    print(\"mkl-service not installed or MKL not detected.\")\n    print(\"To use MKL functionalities in Python, consider installing 'mkl-service' \")\n    print(\"or a Python distribution that ships with MKL-optimized libraries (e.g., Anaconda).\")\n    print(\"The 'onemkl-license' package itself does not expose Python functions for computation.\")\n\n# Check for MKLROOT environment variable, often used in direct MKL installations\nmkl_root = os.environ.get('MKLROOT', 'Not set')\nprint(f\"MKLROOT environment variable: {mkl_root}\")\n\n# On Linux, check for MKL libraries in LD_LIBRARY_PATH\nif platform.system() == 'Linux':\n    ld_path = os.environ.get('LD_LIBRARY_PATH', 'Not set')\n    print(f\"LD_LIBRARY_PATH: {ld_path}\")\n    if mkl_root != 'Not set' and mkl_root not in ld_path:\n        print(\"Warning: MKLROOT is set but not in LD_LIBRARY_PATH. This might cause linking issues.\")\n","lang":"python","description":"This quickstart demonstrates how to check for the presence and configure the underlying Intel oneMKL through the `mkl-service` Python package, which is a common way to interact with oneMKL runtime settings. It also checks for relevant environment variables. The `onemkl-license` package itself does not provide functions for direct mathematical computation."},"warnings":[{"fix":"Do not expect to import mathematical functions directly from `onemkl_license`. Instead, install and use specific MKL Python bindings (e.g., `mkl-service`) or ensure your scientific Python libraries are linked against oneMKL.","message":"The `onemkl-license` package is primarily a placeholder for licensing and dependency resolution, not a library to be directly imported for mathematical operations. Actual oneMKL functionality in Python is typically exposed through other packages like `mkl-service`, `mkl-fft`, `mkl-random`, or implicitly through MKL-optimized builds of NumPy and SciPy.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update linking configurations to use oneMKL dynamic SYCL domain-specific libraries. Refer to the oneMKL Link Line Advisor for guidance.","message":"The oneMKL static SYCL library is deprecated and will be removed in the oneMKL 2026.0 release. Users should transition to dynamic SYCL domain-specific libraries.","severity":"breaking","affected_versions":"2025.3.1 and earlier, will break in 2026.0"},{"fix":"For GPU offloading, consider migrating to Level Zero SYCL backend. For sparse matrix operations, update `sparse::set_csr_data` calls to explicitly include the `nnz` parameter.","message":"Support for the OpenCL* backend on Intel GPUs is deprecated and will be removed in the oneMKL 2026.0 release. The existing overload of `sparse::set_csr_data` without the `nnz` parameter has also been deprecated in 2025.3 and will be removed in the 2027.0 release.","severity":"deprecated","affected_versions":"2025.3.1"},{"fix":"Manually set the `MKLROOT` environment variable to point to the oneMKL installation directory. Refer to the Intel oneMKL developer documentation for correct setup. For Python distributions, using `conda install intel-oneapi-mkl` often handles this configuration automatically.","message":"When installing via `pip`, the `MKLROOT` environment variable is not automatically set up. This variable is crucial for linking and locating oneMKL libraries, especially when building applications that directly link against oneMKL.","severity":"gotcha","affected_versions":"All PyPI installations"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install the `mkl-service` package: `pip install mkl-service` or `conda install mkl-service`.","cause":"Attempting to import `mkl` (for runtime control) without installing the `mkl-service` package.","error":"ModuleNotFoundError: No module named 'mkl'"},{"fix":"Ensure Intel oneMKL is correctly installed (e.g., via `conda install intel-oneapi-mkl`) and that environment variables like `LD_LIBRARY_PATH` (Linux) or `PATH` (Windows) include the paths to the MKL shared libraries. Setting `MKLROOT` might also be necessary.","cause":"The Python environment (e.g., NumPy, SciPy) expects oneMKL libraries but cannot find them, often due to incorrect `LD_LIBRARY_PATH` (Linux) or `PATH` (Windows) or an incomplete oneMKL installation.","error":"numpy.linalg.LinAlgError: Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.so or libmkl_intel_lp64.so."},{"fix":"Ensure the compiler and linker flags correctly point to the oneMKL include and library directories. Use the oneMKL Link Line Advisor tool (available on Intel's developer website) to generate the correct compilation and linking commands for your specific environment and desired features.","cause":"When compiling C/C++/Fortran code that uses oneMKL functions, the linker cannot find the MKL routines. This often happens when MKL is installed but not correctly linked during the compilation process.","error":"Undefined symbols for architecture x86_64: \"_cblas_dgemm\" (macOS link error)"}]}