Libmklccgdll Work
If you forget to link -lmkl_ccg but use ScaLAPACK functions, you will see linker errors like:
undefined reference to `pdgemm_`
That is your clue that the cluster module is missing.
The most common reason libmklccgdll fails to load is that the system cannot find it.
After installation, you must initialize the environment variables. On Windows, the easiest way is to search for and run:
Intel oneAPI Command Prompt for Intel 64 libmklccgdll work
This pre-configures your PATH and library variables. If you are using a standard terminal, you may need to run:
"C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
#include "mkl_spblas.h" #include "mkl_rci.h"// Assume A (CSR), b, x are defined, matrix is SPD
MKL_INT n = ...; double *b = new double[n]; double *x = new double[n]; // initial guess
// Create RCI CG handle double eps = 1e-8; int max_iter = 1000; int rci_request; double tmp = new double[4n]; If you forget to link -lmkl_ccg but use
dcg_init(&n, x, b, &rci_request, &eps, &max_iter, tmp); dcg_check(&n, x, b, &rci_request, &eps, &max_iter, tmp);
// RCI loop while (rci_request != 0) if (rci_request == 1) // Compute A * x -> tmp (provided by solver) mkl_dcsrgemv("N", &n, A_val, A_row, A_col, tmp, tmp+n); else if (rci_request == 2) // Apply preconditioner: here Jacobi diagonal for (int i = 0; i < n; i++) tmp[n+i] = tmp[n+i] / diag[i]; dcg(&rci_request, x, b, tmp);
// Solution is in x
To understand libmklccgdll, we first need to look at the Intel Math Kernel Library (Intel MKL). MKL is a library of optimized math routines for science, engineering, and financial applications. It powers the backend of software like NumPy, MATLAB, and various Fortran/C simulation tools.
The name libmklccgdll acts as a fingerprint that tells us exactly what it contains:
In short, libmklccgdll allows applications written in C (and often C++) to call highly optimized math functions (FFTs, BLAS, LAPACK, Sparse Solvers) dynamically on Windows.