From 87074d97e5a0f709f45dcb17493d2151295b6ce2 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 27 Sep 2012 23:35:54 +0200 Subject: [PATCH] old gcc versions do not have immintrin.h file... --- Eigen/Core | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Eigen/Core b/Eigen/Core index 366465888..502a4fc55 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -87,7 +87,26 @@ // so, to avoid compile errors when windows.h is included after Eigen/Core, ensure intrinsics are extern "C" here too. // notice that since these are C headers, the extern "C" is theoretically needed anyways. extern "C" { - #include + // In theory we should only include immintrin.h and not the other *mmintrin.h header files directly. + // Doing so triggers some issues with ICC. However old gcc versions seems to not have this file, thus: + #ifdef __INTEL_COMPILER + #include + #else + #include + #include + #ifdef EIGEN_VECTORIZE_SSE3 + #include + #endif + #ifdef EIGEN_VECTORIZE_SSSE3 + #include + #endif + #ifdef EIGEN_VECTORIZE_SSE4_1 + #include + #endif + #ifdef EIGEN_VECTORIZE_SSE4_2 + #include + #endif + #endif } // end extern "C" #elif defined __ALTIVEC__ #define EIGEN_VECTORIZE