Search code examples
c++eigenintel-mkl

Eigen 3.2.1 + MKL = C4244 Compiler warning


Anyone experiencing these warnings when compiling projects with Eigen and EIGEN_USE_MKL_ALL flag defined? I'm following the instructions here: http://eigen.tuxfamily.org/dox/TopicUsingIntelMKL.html. This only happens when I #include <Eigen/Eigenvalues>

Example of compile log:

eigen3.2.1\eigen\src/Eigenvalues/RealSchur_MKL.h(76): warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data eigen3.2.1\eigen\src/Eigenvalues/ComplexSchur_MKL.h(87): warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data eigen3.2.1\eigen\src/Eigenvalues/SelfAdjointEigenSolver_MKL.h(80): warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data

I know what these warnings mean, but to resolve them I would need to change the library code. Short of suppressing these warnings, do you have any suggestions (just in case somehow I have missed something)?


Solution

  • On 64 bit platforms Eigen uses 64 bit integers to encode the dimensions of its matrices. The MKL wrapper uses 32 integers, which might overflow if your matrix size exceeds 2 billion rows or columns.