Compilation errors with MKL 2025
With MKL 2025 one sees errors of the kind:
In file included from conftest.cpp:81:
In file included from /usr/include/eigen3/Eigen/Dense:1:
In file included from /usr/include/eigen3/Eigen/Core:372:
/usr/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h:151:1: error: no matching function for call to 'daxpy_direct'
151 | EIGEN_BLAS_TRMV_CM(double, double, d, d,)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h:127:4: note: expanded from macro 'EIGEN_BLAS_TRMV_CM'
127 | BLASPREFIX##axpy##BLASPOSTFIX(&n, (const BLASTYPE*)&numext::real_ref(alpha),(const BLASTYPE*)x, &incx, (BLASTYPE*)_res, &incy); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<scratch space>:130:1: note: expanded from here
130 | daxpy
| ^
/opt/intel/oneapi/mkl/latest/include/mkl_direct_call.h:834:125: note: expanded from macro 'daxpy'
834 | #define daxpy(n,alpha,x,incx,y,incy) MKL_DC_AXPY_CONVERT(n, alpha, x, incx, y, incy, MKL_DC_DAXPY_CHECKSIZE, mkl_dc_daxpy, daxpy_direct)
| ^~~~~~~~~~~~
/opt/intel/oneapi/mkl/latest/include/mkl_direct_call.h:830:9: note: expanded from macro 'MKL_DC_AXPY_CONVERT'
830 | fname_direct((n), (const void *)(alpha), (const void *)(x), (incx), (void *)(y), (incy), &mkl_direct_call_flag); \
| ^~~~~~~~~~~~
/opt/intel/oneapi/mkl/latest/include/mkl_direct_call.h:96:6: note: candidate function not viable: cannot convert argument of incomplete type 'const void *' to 'const double *' for 2nd argument
96 | void daxpy_direct(const MKL_INT *n, const double *alpha, const double *x, const MKL_INT *incx, double *y, const MKL_INT *incy, const MKL_INT* flag);
One can avoid the problem by disabling MKL direct call with -DEIGEN_MKL_NO_DIRECT_CALL. Others have reported problems with the latest MKL headers and C++ code. The responses in one older forum thread seem to suggest that MKL direct call is not supported for C++ code, only C and Fortran. The Limitations of the Direct Call also do not mention C++ either.