This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 1131

Summary: generalmatrixmatrix.h MSVC 2015 + openmp fails
Product: Eigen Reporter: Martijn Berger <martijn.berger>
Component: GeneralAssignee: Nobody <eigen.nobody>
Status: RESOLVED DUPLICATE    
Severity: Compilation Problem CC: chtz, gael.guennebaud, jacob.benoit.1
Priority: Normal    
Version: 3.2   
Hardware: x86 - 64-bit   
OS: Windows   
Whiteboard:

Description Martijn Berger 2015-12-10 13:36:25 UTC
Eigen 3.2.7

Error	C1001	An internal error has occurred in the compiler.	c:\dev\blender\extern\eigen3\eigen\src\core\products\generalmatrixmatrix.h	62	

fatal error C1001: An internal error has occurred in the compiler.
1>  (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 246)
1>   To work around this problem, try simplifying or changing the program near the locations listed above.
1>  Please choose the Technical Support command on the Visual C++
1>   Help menu, or open the Technical Support help file for more information

This happens only in MSVC 2015 SP1 and not in 2013 SP4 or SP5.

I hacked around it by doing: 

--- a/extern/Eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h
+++ b/extern/Eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h
@@ -140,8 +140,14 @@ static void run(Index rows, Index cols, Index depth,
       // Release all the sub blocks B'_j of B' for the current thread,
       // i.e., we simply decrement the number of users by 1
       for(Index j=0; j<threads; ++j)
+      {
         #pragma omp atomic
+#if !defined(_MSC_VER)
         --(info[j].users);
+#else
+        (info[j].users) -= 1;
+#endif
+      }
     }
   }
   else
Comment 1 Gael Guennebaud 2015-12-10 15:12:33 UTC

*** This bug has been marked as a duplicate of bug 1096 ***
Comment 2 Nobody 2019-12-04 15:15:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1131.