Registered Member
|
Hi Eigen-Folks,
I am using the Vector and Quaternion classes from Eigen and recently ran into the assert about unaligned arrays[1]. I don't really care about vectorization so I defined EIGEN_DONT_ALIGN globally. Then I stumbled upon the "_Options" template argument for the Matrix type [2]. I thought that passing Eigen::DontAlign as template argument would have the same effect as defining EIGEN_DONT_ALIGN. But when using just Eigen::DontAlign I get the assert failure whereas I don't get it if I use the macro definition. Is this a bug or am I misunderstanding the purpose of the template argument? Thanks for your time and any help you can offer. Sincerely, Lorenz [1] http://eigen.tuxfamily.org/dox/TopicUna ... ssert.html [2] https://bitbucket.org/eigen/eigen/src/d ... ault#cl-32 |
Moderator
|
Please run your program under a debugger to identify where the assertion is called, it must be on an object for which Eigen::DontAlign has not been set.
|
Registered Member
|
Hi Gael,
thanks for getting back to me. I think I tracked the problem down to Eigen/src/Geometry/Quaternion.h. There are a few places (e.g. Quaternion::Identity()) where a method returns a Quaternion<scalar> ignoring the _Options set on the class. There might be other places but this is where I hit the assert first. |
Moderator
|
Ouch, that means your stack is not aligned. If your system/compiler cannot guarantee and aligned stack, then compiling with -DEIGEN_DONT_ALIGN_STATICALLY is your only option.
I guess your are using mingw, or perhaps have a multi-threaded application? |
Registered Member
|
Are you sure? I admit that I don't fully grasp the root of the problem, but if I simply use
Specifically I think Line 105 in Quaternion.h (and other places) should be something like this (untested):
Yes, to both. Thanks again for your time! |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]