diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d81a57fd..7e73a6e50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,8 +224,9 @@ if(GTSAM_USE_SYSTEM_EIGEN) set(GTSAM_EIGEN_INCLUDE_PREFIX "${EIGEN3_INCLUDE_DIR}") # check if MKL is also enabled - can have one or the other, but not both! - if(EIGEN_USE_MKL_ALL) - message(FATAL_ERROR "MKL cannot be used together with system-installed Eigen, as MKL support relies on patches which are not yet in the system-installed Eigen. Disable either GTSAM_USE_SYSTEM_EIGEN or GTSAM_WITH_EIGEN_MKL") + # Note: Eigen >= v3.2.5 includes our patches + if(EIGEN_USE_MKL_ALL AND (EIGEN3_VERSION VERSION_LESS 3.2.5)) + message(FATAL_ERROR "MKL requires at least Eigen 3.2.5, and your system appears to have an older version. Disable GTSAM_USE_SYSTEM_EIGEN to use GTSAM's copy of Eigen, or disable GTSAM_WITH_EIGEN_MKL") endif() else() # Use bundled Eigen include path. diff --git a/gtsam/base/Matrix.cpp b/gtsam/base/Matrix.cpp index 740699d4b..d92be12f5 100644 --- a/gtsam/base/Matrix.cpp +++ b/gtsam/base/Matrix.cpp @@ -704,11 +704,9 @@ void inplace_QR(Matrix& A){ HCoeffsType hCoeffs(size); RowVectorType temp(cols); -#ifdef GTSAM_USE_SYSTEM_EIGEN - // System-Eigen is used, and MKL is off +#if !EIGEN_VERSION_AT_LEAST(3,2,5) Eigen::internal::householder_qr_inplace_blocked(A, hCoeffs, 48, temp.data()); #else - // Patched Eigen is used, and MKL is either on or off Eigen::internal::householder_qr_inplace_blocked::run(A, hCoeffs, 48, temp.data()); #endif