From c2da96082b7ea4d6cdcb1ca83a3e84264156ea48 Mon Sep 17 00:00:00 2001 From: Janick Martinez Esturo Date: Fri, 12 Jan 2018 17:17:14 +0100 Subject: [PATCH] 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 v; because CERES_JET_ALIGN_BYTES = EIGEN_MAX_ALIGN_BYTES = 0 in that case. Change-Id: I247653d3b7555e80891d3fb78676acfa302a9e1d --- include/ceres/jet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ceres/jet.h b/include/ceres/jet.h index ff03f68b8..b711ea27f 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h @@ -258,7 +258,7 @@ struct Jet { // 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 v;