Eigen fails to compile with VS2015 clang-3.7 toolchain
Submitted by pat..@..il.com
Assigned to Nobody
Link to original bugzilla bug (#1122)
Version: 3.3 (current stable)
Operating system: Windows
Description
Visual Studio 2015 Update 1 added an option to switch to compile with the clang frontend (the backend is still Microsoft's). They call the new toolset "Clang 3.7 with Microsoft CodeGen (v140_clang_3_7)".
Eigen fails to compile under that toolchain, with errors mostly related to inline assembly. I guess that's sort of expected, since the various #define's for different compilers/architectures break down in that configuration. I'm not sure how much of that is on Microsoft, or if it can be fixed within Eigen.
The errors are as follows:
1>C:\eigen-3.3-alpha1\Eigen/src/Core/util/Memory.h(870,5): error : GNU-style inline assembly is disabled
1> EIGEN_CPUID(abcd,0x4,cache_id);
1> ^
1> C:\eigen-3.3-alpha1\Eigen/src/Core/util/Memory.h(840,17) : note: expanded from macro 'EIGEN_CPUID'
1> asm volatile ("xchg{q}\t{%%}rbx, %q1; cpuid; xchg{q}\t{%%}rbx, %q1": "=a" (abcd[0]), "=&r" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "0" (func), "2" (id));
1> ^
The same error in various other locations.
1>C:\eigen-3.3-alpha1\Eigen/src/Core/arch/SSE/PacketMath.h(444,85): error : member reference base type 'const Packet4f' (aka 'const __m128') is not a structure or union
1> template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { return a.m128_f32[0]; }
1> ~^~~~~~~~~
1>C:\eigen-3.3-alpha1\Eigen/src/Core/arch/SSE/PacketMath.h(445,85): error : member reference base type 'const Packet2d' (aka 'const __m128d') is not a structure or union
1> template<> EIGEN_STRONG_INLINE double pfirst<Packet2d>(const Packet2d& a) { return a.m128d_f64[0]; }
1> ~^~~~~~~~~~
1>C:\eigen-3.3-alpha1\Eigen/src/Core/products/GeneralBlockPanelKernel.h(2002,3): error : GNU-style inline assembly is disabled
1> EIGEN_ASM_COMMENT("EIGEN PRODUCT PACK RHS COLMAJOR");
1> ^
1> C:\eigen-3.3-alpha1\Eigen/src/Core/util/Macros.h(533,42) : note: expanded from macro 'EIGEN_ASM_COMMENT'
1> #define EIGEN_ASM_COMMENT(X) asm("#" X)
Same or similar error in a lot of other places too.
There could be more errors, clang stops compiling after this because of too many errors.