From 516b0d3c56c1646bdfcacdcaace43f44e3a64238 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 20 Jun 2015 14:42:56 +0200 Subject: [PATCH] Sketcher: Workaround for Eigen bug: SparseQR crash on matrices with rows>cols ============================================================================= There is an issue with an assertion in Eigen, as reported here: https://forum.kde.org/viewtopic.php?f=74&t=117474 http://forum.freecadweb.org/viewtopic.php?f=10&t=11341&p=92153#p92146 The work-around is to disable debug assertions for Eigen until the problem gets solved. --- src/Mod/Sketcher/App/CMakeLists.txt | 2 +- src/Mod/Sketcher/App/planegcs/GCS.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/App/CMakeLists.txt b/src/Mod/Sketcher/App/CMakeLists.txt index c4458ddc4..50f02edfd 100644 --- a/src/Mod/Sketcher/App/CMakeLists.txt +++ b/src/Mod/Sketcher/App/CMakeLists.txt @@ -10,7 +10,7 @@ if (OPENMP_FOUND) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") endif() - +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_NO_DEBUG") # Necessary to avoid SparseQR crash with Eigen 3.2 due to a wrong assertion include_directories( ${CMAKE_BINARY_DIR} diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index dc4533493..0183177cb 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -27,6 +27,10 @@ #include "GCS.h" #include "qp_eq.h" +// NOTE: In CMakeList.txt -DEIGEN_NO_DEBUG is set (it does not work with a define here), to solve this: +// this is needed to fix this SparseQR crash http://forum.freecadweb.org/viewtopic.php?f=10&t=11341&p=92146#p92146, +// until Eigen library fixes its own problem with the assertion (definitely not solved in 3.2.0 branch) + #include #include #include