From 024a9313c5c18576436704134e96cae86164066e Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Wed, 5 Apr 2017 15:25:28 +0200 Subject: [PATCH] [CMake] Set EIGEN_MAX_ALIGN_BYTES=0 on Win MSVC 32-bit. Fixes error: "formal parameter with requested alignment of 16 won't be aligned" --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b62d2629fde..29b1d57dfc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,6 +177,7 @@ if(OGS_USE_MPI) add_definitions(-DUSE_MPI) endif() +# Eigen add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_ZERO) # TODO check if needed if (EIGEN_NO_DEBUG) add_definitions(-DEIGEN_NO_DEBUG) @@ -192,6 +193,11 @@ if(OGS_USE_EIGEN) endif() endif() +if(MSVC AND OGS_32_BIT) + add_definitions(-DEIGEN_MAX_ALIGN_BYTES=0 -DEIGEN_DONT_ALIGN) +endif() +# End Eigen + if (OGS_FATAL_ABORT) add_definitions(-DOGS_FATAL_ABORT) endif() -- GitLab