Registered Member
|
Hi all,
Having updated the compiler in Visual Studio 2017 to use the latest version ( 15.8 ), I ran into an interesting issue compiling code using Eigen and how it may affect other projects. This is the error
It has to do with us allocating a class that contains an Eigen object with fixed-size dimensions with make_shared You can demonstrate the problem by compiling the following code. The error will be produced, but only by the line using the make_shared allocation, the other allocations do not produce the error.
Eigen performs optimal vectorization on these fixed-sized objects and that seems to include some alignment specification You can turn off the vectorization of Eigen objects (and alignment) to not get this error But I think the best solution is to accept Microsoft's update to 15.8 by adding a processor definition to your application and keep Eigen vectorization. I don't feel that this is an Eigen issue to solve (set this flag for anyone using Eigen and MSVC) But you may want to add a warning or note in your documentation about this. For CMake users you will need to add a preprocessor definition with something like:
Hope this might save some time for others who may run into this problem with the latest update from MSVC Thanks |
Registered Member
|
There's a way to annotate your structure that should resolve the warnings:
https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell