1

I have a templated library in which some functions are specialized for float and double types. This specialization uses sse/avx, hence, this library has the -march=native -mavx2 compiler flags. When I try to use some function (that is not specialized) of this library I get the following runtime error from Ceres:

test_ceres: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<double, 4, 0, 32>::plain_array() [T = double, Size = 4, MatrixOrArrayOptions = 0, Alignment = 32]: Assertion `(internal::UIntPtr(array) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.

I have been able to reproduce the error with a much simpler code: here. Essentially, this example works when the -mavx2 -march=native flags are removed and does not work (produces the previous error) when they are present (comment and uncomment from CmakeLists.txt). In this example no functions using avx/sse are present but remember that my library has them, so removing the flags -mavx2 -march=native is not an option. Any idea on what to do to solve this? When I compiled Ceres I added the flag -DCMAKE_CXX_FLAGS="-march=native" as pointed out in the documentation.

Reading the webpage provided in the error message did not provide any solution.

Some useful information about my system:

  • compiler: clang++
    • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
    • Target: x86_64-pc-linux-gnu
    • Thread model: posix
  • Ceres version: 2.0 (i actually have the git repo and I have updated it few minutes ago: )
  • CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
apalomer
  • 1,895
  • 14
  • 36
  • 1
    Unrelated: Your `Point2` class does not implement the copy-assignment operator. This breaks [the rule of 3](https://en.cppreference.com/w/cpp/language/rule_of_three). – chtz Feb 12 '19 at 14:45
  • Thanks a lot for the comment. I'll look into it! – apalomer Feb 12 '19 at 15:50

1 Answers1

1

Consider asking this on the eigen mailinglist. This is not a Ceres solver problem.

Sameer Agarwal
  • 592
  • 2
  • 4
  • The code the OP links to does not directly contain a single line of Eigen code. So it seems to me this is rather a problem in Ceres. – chtz Feb 12 '19 at 14:43