lgmath icon indicating copy to clipboard operation
lgmath copied to clipboard

Eigen alignment error with -march compile flag

Open spencerteetaert opened this issue 6 months ago • 0 comments

On some systems, Eigen will throw an error when using lgmath if the -march flag is set. Specifically, when running the TransformationWithCovariance test

[  FAILED  ] LGMath.TransformationWithCovarianceConstructors (4 ms)
[ RUN      ] LGMath.TransformationWithCovarianceGetMethods
TransformWithCovarianceTest: /usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 16; int MatrixOrArrayOptions = 0]: Assertion `(internal::UIntPtr(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.
Aborted (core dumped)

The eigen help page says that switching to C++17 should solve this issue (it does not with lgmath). Not sure what a permanent fix should be. Removing the -march=native compile flag seems to solve the issue for me.

A similar issue is discussed in this thread

spencerteetaert avatar Jul 31 '24 19:07 spencerteetaert