Fix Eigen >= 3.3 compilation if EIGEN_DONT_VECTORIZE set Would result in compilation error include/ceres/jet.h:296:59: error: requested alignment is not a positive power of 2 alignas(kAlignment) Eigen::Matrix<T, N, 1, kAlignOrNot> v; because CERES_JET_ALIGN_BYTES = EIGEN_MAX_ALIGN_BYTES = 0 in that case. Change-Id: I247653d3b7555e80891d3fb78676acfa302a9e1d
diff --git a/include/ceres/jet.h b/include/ceres/jet.h index ff03f68..b711ea2 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h
@@ -258,7 +258,7 @@ // supported is < 16, in which case we do not specify an alignment, as this // implies the host is not a modern x86 machine. If using < C++11, we cannot // specify alignment. -#ifndef CERES_USE_CXX11 +#if !defined(CERES_USE_CXX11) || defined(EIGEN_DONT_VECTORIZE) // Without >= C++11, we cannot specify the alignment so fall back to safe, // unvectorised version. Eigen::Matrix<T, N, 1, Eigen::DontAlign> v;