[SOLVED]eigen and compile error on Windows

I’m trying to compile git source on Windows XP sp3 + Windows SDK 7.1 + VCCompiler update.
Now i’ve got this error:

c:\Program Files\Microsoft Visual Studio 10.0\VC\include\vector(870) : error C2719: '_Val': forma
l parameter with __declspec(align('16')) won't be aligned
        c:\panda3d\src\built_seifi\include\pvector.h(39) : see reference to class template instan
tiation 'std::vector<_Ty,_Ax>' being compiled
        c:\panda3d\src\pandatool\src\daeegg\daeCharacter.h(75) : see reference to class template
instantiation 'pvector<Type>' being compiled
c:\panda3d\src\pandatool\src\daeegg\daeCharacter.cxx(191) : warning C4018: '<' : signed/unsigned
The following command returned a non-zero value: cl /wd4996 /wd4275 /wd4267 /wd4101 /wd4273 /DWIN
VER=0x501 /Fobuilt_seifi/tmp/p3daeegg_composite1.obj /nologo /c /arch:SSE2 /Ipandatool/src/daeegg
 /Ibuilt_seifi/tmp /Ibuilt_seifi/include /Ithirdparty/win-python/include /Ithirdparty/win-libs-vc
10/eigen\include /Ithirdparty/win-libs-vc10/fcollada/include /Ithirdparty/win-libs-vc10/extras/in
clude /MD /Zi /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL /Oy /Zp16 /Fdbuilt_seifi/tm
p/p3daeegg_composite1.pdb /Zm300 /DWIN32_VC /DWIN32 -D_HAS_EXCEPTIONS=0 /GR- /W3 pandatool/src/da

I’ve seen this: panda3d.org/forums/viewtopi … =3&t=17574
But it seems the fix doesn’t work.
Should i go with --no-eigen ?


In daeCharacter.h, find this line:

  typedef pvector<Joint> Joints;

Try changing it to “epvector” instead.

If that fails, you could try changing the LMatrix4d type to UnalignedLMatrix4d.

In C:\Program Files\Microsoft Visual Studio 10.0\VC\include\vector line 869 i have:

void resize(size_type _Newsize, _Ty _Val)

Should i change it to:

void resize(size_type _Newsize, _Ty &_Val)


By the way compiling on windows is so slower than linux! :frowning:

Um, I guess, but did you try my suggestion above?

Yes, it is much slower. If you want to dramatically speed up the Windows build use --no-eigen. For some reason the MSVC compiler takes much longer when Eigen is involved (probably because Eigen is a heavily templated library).

I did what you said.
I hope it goes well because i’ve started compiling with three threads about 9 hours ago and it still goes on!
There is a “link.exe” in process started few hours ago and uses most cpu since then:

[T1] Linking dynamic library built_seifi/bin/libpanda.dll
   Creating library built_seifi/lib/libpanda.lib and object built_seifi/lib/libpanda.exp

Yes, the link time of libpanda is ridiculous with Eigen enabled, especially with the 32-bit build. :-/ Not really sure what we can do about that, except perhaps integrating a different math library.

So far changing pvector to epvector seemed to make it get past the point where it failed.

It’s about 30 hours now since i’ve started compiling!! and still there is “link.exe” with over 95 percent cpu usage.
Should i cancel it?
I’m using Windows XP in vbox with 900mb ram and one core cpu with 1.3ghz speed.

Yes. 900 MB is not enough to compile Panda on Windows, especially not with Eigen.

Note that you don’t have to compile Panda in Windows XP in order to get a build that will run on Windows XP. You do have to pass --no-touchinput (and also --no-sse2 if you want to target older CPUs) in order to disable Windows 7 specific features.
You can use --arch i386 to make a 32-bit build on a 64-bit host system.

Now i’m in Win7 x64 with two cpu core and 1600mb ram and it’s about 8 hours since i’ve started compiling.
In Task Manager i can see almost half of my ram is empty and “link.exe” is using about 305mb ram which is increasing gradually.
What config do you recommend for compiling on Windows?

I don’t know. I’ll think about possible ways we might solve the compile time issues, perhaps through the use of precompiled headers. In the meantime, I would suggest that you disable eigen.

Note that if you compile with rtdist, it does an optimize level 4 build by default, which means that it does link time code generation, which means that all the compilation time is deferred to the link step. So it makes sense that the link step takes so long for an rtdist build. But not 8 hours.

If i disable eigen how much performance will i lose?
I noticed unlike other pre-compiled thirdparties that you uploaded, eigen is just source code:

So can we change it to pre-compiled one?

I’m still looking for proper Windows machine configuration for compiling. i have access to several Windows machines on my work place.

You won’t lose too much performance unless your application is very heavy on matrix transformations.

It’s not possible to precompile Eigen because it consists purely of C++ templates, unfortunately.

I’m always compiling Panda without Eigen on Windows.

I’ve decided that the 32-bit release of Panda 1.9.0 for Windows will be compiled without Eigen too, because the build was still not done. Ugh. We compile with --no-sse2 on 32-bit systems, so it’s of questionable benefit anyway.

I don’t want to start a new post, but I feel like the compile time heavily increased in the last months, arround 5 Months ago I could do a fullbuild with eigen in about 1 hour, now I had to abort the build because it was building for ages. Might it be that there is a bug, increasing compile time by a lot?

Yes, I also noticed increased compile times. I don’t know. Maybe including an Eigen header in some central header file was to blame, or something like that. Hmm.

I have half a heart to just kick out Eigen and hand-roll my own SSE2 implementation.