1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Raw FFI bindings to the C interface of Intel oneAPI Math Kernel Library
//! (oneMKL).
//!
//! These bindings are auto-generated by `bindgen` from the official `mkl.h`
//! umbrella header, plus any opt-in MPI-dependent headers (`mkl_blacs.h`,
//! `mkl_pblas.h`, `mkl_scalapack.h`, `mkl_cluster_sparse_solver.h`,
//! `mkl_cdft.h`) selected via Cargo features.
//!
//! # Safety
//!
//! Every item exported from this crate is a raw C function or type. Callers
//! must uphold the invariants documented by Intel's MKL reference. For a safe,
//! idiomatic Rust API, use the `onemkl` crate instead.
//!
//! # Feature flags
//!
//! Exactly one feature must be selected from each of the following groups:
//!
//! - **Interface layer:** `lp64` (default) or `ilp64`
//! - **Threading layer:** `threading-sequential` (default), `threading-intel-openmp`, or `threading-tbb`
//! - **Linkage:** `link-dynamic` (default) or `link-static`
//!
//! Opt-in MPI-dependent domains: `cluster-sparse-solver`, `cdft`, `scalapack`,
//! `blacs`, `pblas` (which implies `blacs`).
//!
//! # Locating the MKL install
//!
//! The build script searches in this order:
//!
//! 1. `MKLROOT` environment variable
//! 2. `ONEMKL_SYS_INCLUDE_DIR` / `ONEMKL_SYS_LIB_DIR` (explicit override)
//! 3. `ONEAPI_ROOT/mkl/latest`
//! 4. Platform-standard install paths (`C:\Program Files (x86)\Intel\oneAPI`
//! on Windows, `/opt/intel/oneapi` elsewhere)
// Standard bindgen-output allows: the bindings are generated C names.
include!;
// Linux dynamic builds: the layered MKL shared libraries do not record
// each other in DT_NEEDED, and rustc links with `--as-needed`, so a
// final artifact that references only `mkl_intel_*` symbols loses
// `mkl_core` and the threading layer, then dies at load with
// `undefined symbol: mkl_blas_dgemm` (issue #3). `cargo:rustc-link-arg`
// cannot fix this for downstream crates (it only reaches the emitting
// crate's own artifacts) and the `as-needed` link modifier is
// nightly-only. So reference one symbol from each library here: a
// real symbol reference survives `--as-needed` and travels with the
// rlib to every dependent.
// `MKL_INT`, `MKL_UINT`, and `MKL_LONG` are preprocessor `#define`s in
// `mkl_types.h`, so bindgen inlines their expansions rather than emitting
// Rust type aliases. We expose them here so downstream crates can refer to
// the chosen interface width by name.
/// Signed integer type used for sizes and increments throughout the MKL C
/// interface. 32-bit under `lp64` (default), 64-bit under `ilp64`.
pub type MKL_INT = c_longlong;
/// Signed integer type used for sizes and increments throughout the MKL C
/// interface. 32-bit under `lp64` (default), 64-bit under `ilp64`.
pub type MKL_INT = c_int;
/// Unsigned counterpart of [`MKL_INT`].
pub type MKL_UINT = c_ulonglong;
/// Unsigned counterpart of [`MKL_INT`].
pub type MKL_UINT = c_uint;
/// 64-bit signed integer type used in select MKL routines (CDFT, sparse
/// solver `_64` variants, etc.). Always 64 bits regardless of interface
/// layer.
pub type MKL_INT64 = c_longlong;
/// 64-bit unsigned integer type used in select MKL routines.
pub type MKL_UINT64 = c_ulonglong;
/// Long-width integer type. Differs by platform: `c_long` on Linux/macOS
/// (8 bytes), `c_longlong` on Windows under ILP64, `c_long` (4 bytes) on
/// Windows under LP64.
pub type MKL_LONG = c_long;
pub type MKL_LONG = c_longlong;
pub type MKL_LONG = c_long;
/// Width of [`MKL_INT`] in bytes for the selected interface layer.
///
/// 4 with the default `lp64` feature, 8 with `ilp64`.
pub const MKL_INT_SIZE: usize = ;