This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen 3.0(beta2) compile error on VC9.0 sp1 X64

Tags: None
(comma "," separated)
rudaoshi
Registered Member
Posts
8
Karma
0
OS
Hello,

I'm using Eigen 3.0 beta2 in my program. But when I compiler it using VC9.0 sp1 X64, it complain that “eigen\src/Core/util/Memory.h(622): error C3861: '__cpuidex': identifier not found”.

Please help me about that! Thank you very much!
rudaoshi
Registered Member
Posts
8
Karma
0
OS
I tested VC9.0 SP1 with Win32 platform, VC10.0 with Win32 and X64 platform. The compilers all run ok.

Is there some configuration to do for Eigen to work properly? Or there may be a prepocessor for X64 platform of VC9.0 SP1?
rudaoshi
Registered Member
Posts
8
Karma
0
OS
I wonder if I undef EIGEN_CPUID, what will happen to Eigen? Will it runs slow?

If it does not influence the effectivness on single CPU, I think I can temporarily do that.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
This issue has been fixed recently. Please use the devel branch.
rudaoshi
Registered Member
Posts
8
Karma
0
OS
Thank you very much!

I'll try the dev branch.
rudaoshi
Registered Member
Posts
8
Karma
0
OS
I met the error "error C2373: “Eigen::MatrixBase<Derived>::diagonal” redefinition" for the latest devel branch.

I notice that the EIGEN_CPUID macro definition is removed for VS9.0 via condition #if (_MSC_VER > 1500) in the devel branch. I port the condition back to the Beta 2.
Galmok
Registered Member
Posts
9
Karma
0
OS
Sorry for the "bump" but I have the same issue as the OP. I am using MSVC10 and have tried eigen 3.0.2, the web development branch and the hg branch, all of them give this error:

1>c:\tools\matrixlib\eigen-eigen-bb94b3bf3f57\eigen\src/Core/util/Memory.h(753): error C3861: '__cpuidex': identifier not found

This is the top of the file causing the issue:

#pragma once

#include <iostream>
#include <Eigen/Dense> // this causes the errors (5 in all)
using Eigen::MatrixXd; // this is ok

Any hints on how to avoid this error?
Galmok
Registered Member
Posts
9
Karma
0
OS
Really? No one has any idea? I guess I have to search the include files for clues on how to solve this issue (or work around it).
Galmok
Registered Member
Posts
9
Karma
0
OS
I couldn't find a solution and ended up editing this part in Memory.h:

# if (_MSC_VER > 1500)
# define EIGEN_CPUID(abcd,func,id) __cpuidex((int*)abcd,func,id)
# endif

to

# if (_MSC_VER > 1600)
# define EIGEN_CPUID(abcd,func,id) __cpuidex((int*)abcd,func,id)
# endif

I am using VS2010 and am compiling a Win32 target (_MSC_VER = 1600). I even tried including intrin.h manually before including Eigen include files but that changed nothing. My presented work-around makes me at least able to use Eigen.

I would still like to know if anyone has any insight why __cpuidex isn't being defined even when intrin.h is included manually?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
That's very strange because as far as I know you're the only one with that issue. It works for many MSVC users.
Galmok
Registered Member
Posts
9
Karma
0
OS
ggael wrote:That's very strange because as far as I know you're the only one with that issue. It works for many MSVC users.


My details may have been wrong. I am compiling VC++ (C++/CLI) (managed) code which Eigen3 probably doesn't handle in this particular case.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
hm sorry for my ignorance of the windows world but what's the difference? When I try MSVC I usually call it from nmake via NMake Makefiles created from cmake.
Galmok
Registered Member
Posts
9
Karma
0
OS
I don't know what MSVC uses below the GUI. :-P

But the VC++ code is compiled to the same target C# is compiled to (intermediate binary using .NET libraries). This means I do not get native binaries...

For instance, I also get errors like these:

1>c:\tools\matrixlib\eigen-eigen-3.0.2\eigen\src\core\densestorage.h(102): error C2472: 'Eigen::DenseStorage<double,4,2,2,0>::DenseStorage<double,4,2,2,0>' cannot be generated in managed code: 'Aligned data types not supported in managed code'; compile with /clr to generate a mixed image
1>c:\tools\matrixlib\eigen-eigen-3.0.2\eigen\src\core\plainobjectbase.h(382): error C2472: 'Eigen::PlainObjectBase<Eigen::Matrix<double,2,2,0,2,2> >::PlainObjectBase<Eigen::Matrix<double,2,2,0,2,2> >' cannot be generated in managed code: 'Aligned data types not supported in managed code'; compile with /clr to generate a mixed image
1>c:\tools\matrixlib\eigen-eigen-3.0.2\eigen\src\core\products\generalmatrixvector.h(554): error C2472: 'Eigen::internal::general_matrix_vector_product<int,double,1,0,double,0>::run' cannot be generated in managed code: 'Aligned data types not supported in managed code'; compile with /clr to generate a mixed image
1>c:\tools\matrixlib\eigen-eigen-3.0.2\eigen\src\core\matrix.h(221): error C2472: 'Eigen::Matrix<double,2,2,0,2,2>::Matrix<double,2,2,0,2,2>' cannot be generated in managed code: 'Aligned data types not supported in managed code'; compile with /clr to generate a mixed image
1>c:\tools\matrixlib\eigen-eigen-3.0.2\eigen\src\svd\jacobisvd.h(286): error C2472: 'Eigen::internal::real_2x2_jacobi_svd<Eigen::Matrix<double,-1,-1,0,-1,-1>,double,int>' cannot be generated in managed code: 'Aligned data types not supported in managed code'; compile with /clr to generate a mixed image

This basically means I have to disable pure managed code generation and allow native binary code (using the suggested flag /clr instead of /clr:pure). At least I can use Eigen but if it were to be /clr:pure compliant, it would be nicer. :)

Incidently, using /clr instead of /clr:pure allows the _MSC_VER to be sat to 1500 in Memory.h.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]