[Bf-committers] LIBMV: Workaround for Internal Compiler error on VS2012
Jürgen Herrmann
shadowrom at me.com
Tue May 14 20:42:23 CEST 2013
Hi again,
still trying to fix this nasty ICE on VS 2012 64bit and I think I found a way to work around this issue without losing too much speed.
Instead of turning optimizations off globally for these 2 files I found a way to reduce optimization level slightly by doing this:
------------PATCH----------------
Index: extern/libmv/libmv/tracking/esm_region_tracker.cc
===================================================================
--- extern/libmv/libmv/tracking/esm_region_tracker.cc (revision 56800)
+++ extern/libmv/libmv/tracking/esm_region_tracker.cc (working copy)
@@ -61,6 +61,13 @@
return true;
}
+/* Ugly but necessary fix for compilation on VS2012
+/* this file causes an Internal Compiler Error */
+// TODO: check regularly if ICE is fixed by MS!
+#if (_MSC_VER >= 1700 && _WIN64)
+#pragma optimize("sp", on)
+#endif
+
// This is implemented from "Lukas and Kanade 20 years on: Part 1. Page 42,
// figure 14: the Levenberg-Marquardt-Inverse Compositional Algorithm".
bool EsmRegionTracker::Track(const FloatImage &image1,
Index: extern/libmv/libmv/tracking/lmicklt_region_tracker.cc
===================================================================
--- extern/libmv/libmv/tracking/lmicklt_region_tracker.cc (revision 56800)
+++ extern/libmv/libmv/tracking/lmicklt_region_tracker.cc (working copy)
@@ -52,6 +52,13 @@
return true;
}
+/* Ugly but necessary fix for compilation on VS2012
+/* this file causes an Internal Compiler Error */
+// TODO: check regularly if ICE is fixed by MS!
+#if (_MSC_VER >= 1700 && _WIN64)
+#pragma optimize("sp", on)
+#endif
+
// Estimate "reasonable" error by computing autocorrelation for a small shift.
static double EstimateReasonableError(const FloatImage &image,
double x, double y,
------------PATCH----------------
-----Ursprüngliche Nachricht-----
Von: bf-committers-bounces at blender.org [mailto:bf-committers-bounces at blender.org] Im Auftrag von Jürgen Herrmann
Gesendet: Dienstag, 14. Mai 2013 16:05
An: bf-committers at blender.org
Betreff: [Bf-committers] [Proposal] LIBMV: Workaround for Internal Compiler error on VS2012
Hey ;)
we have a problem, when compiling extern_libmv on VS2012 x64 the compiler crashes.
It seems that this inlining problem is known to MS and they are working on a fix.
This does not happen on x86 builds though.
I could not find a real fix for this yet.
So I'd like to commit the following workaround patch, any suggestions or comments?
---------------SNIP--------------
Index: extern/libmv/libmv/tracking/esm_region_tracker.cc
===================================================================
--- extern/libmv/libmv/tracking/esm_region_tracker.cc (revision 56794)
+++ extern/libmv/libmv/tracking/esm_region_tracker.cc (working copy)
@@ -32,7 +32,12 @@
#include "libmv/tracking/track_region.h"
namespace libmv {
-
+/* Ugly but necessary fix for compilation on VS2012
+/* this file causes an Internal Compiler Error */ // TODO: check
+regularly if ICE is fixed by MS!
+#if (_MSC_VER >= 1700 && _WIN64)
+#pragma optimize("", off)
+#endif
// TODO(keir): Reduce duplication between here and the other region trackers.
static bool RegionIsInBounds(const FloatImage &image1,
double x, double y,
Index: extern/libmv/libmv/tracking/lmicklt_region_tracker.cc
===================================================================
--- extern/libmv/libmv/tracking/lmicklt_region_tracker.cc (revision 56794)
+++ extern/libmv/libmv/tracking/lmicklt_region_tracker.cc (working copy)
@@ -27,7 +27,12 @@
#include "libmv/numeric/numeric.h"
namespace libmv {
-
+/* Ugly but necessary fix for compilation on VS2012
+/* this file causes an Internal Compiler Error */ // TODO: check
+regularly if ICE is fixed by MS!
+#if (_MSC_VER >= 1700 && _WIN64)
+#pragma optimize("", off)
+#endif
// TODO(keir): Reduce duplication between here and the other region trackers.
static bool RegionIsInBounds(const FloatImage &image1,
double x, double y,
---------------SNIP--------------
Best regards
/Jürgen
_______________________________________________
Bf-committers mailing list
Bf-committers at blender.org
http://lists.blender.org/mailman/listinfo/bf-committers
More information about the Bf-committers
mailing list