Re: [eigen] Building eigen in non x86/amd64/ppc archs

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On Mon, Dec 27, 2010 at 9:05 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> So, patches welcome!

OK. I can confirm you that changing just this single line:

==========================
--- eigen3/Eigen/src/Core/util/Memory.h
+++ eigen3/Eigen/src/Core/util/Memory.h
@@ -601,7 +601,7 @@
 #  if defined(__PIC__) && defined(__i386__)
 #    define EIGEN_CPUID(abcd,func,id) \
        __asm__ __volatile__ ("xchgl %%ebx, %%esi;cpuid; xchgl
%%ebx,%%esi": "=a" (abcd[0]), "=S" (abcd[1]), "=c" (abcd[2]), "=d"
(abcd[3]) : "a" (func), "c" (id));
-#  elif !defined(__arm__) && !defined(__powerpc__)
+#  elif !defined(__arm__) && !defined(__powerpc__) &&
!defined(__mips__) && !defined(__sparc__) && !defined(__sh__) &&
!defined(__s390__) && !defined(__m68k__) && !defined(__ia64__) &&
!defined(__hppa__)
 #    define EIGEN_CPUID(abcd,func,id) \
        __asm__ __volatile__ ("cpuid": "=a" (abcd[0]), "=b" (abcd[1]),
"=c" (abcd[2]), "=d" (abcd[3]) : "a" (func), "c" (id) );
 #  endif
==========================

fixes the compilation under MIPS, and hopefully in the rest of
platforms (if you're interested, I'll let you know if it's really the
case, but building one single file in a MIPS emulator took me ~30mins,
so it'll take days!!!).

Please, apply that patch upstream. You can also replace all those "&&
!defined()" by a few "|| define()" if you are sure on which platforms
cpuid works... (x86 & x86_64?).

Thanks and... have a happy new year!

JL



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/