Turn off Eigen Alignment in the PCL build

点点圈 提交于 2019-12-11 10:50:53

问题


So I have an issue where Eigen Alignment causes serious issues with the operating system I use, QNX. Basically the OS cannot deal with the memory that way and causes very interesting seg faults. See my other question here.

Any way, for this reason I wish to disable the Eigen Alignment used in PCL before I build it. I have a couple of ideas about how i might do this.

EIGEN INCLUDE FILES IN PCL

So PCL has the structure for most of its modules like this (this is an example of the features module):

pcl/include/pcl/features/

and in this folder there exists a eigen.h file. This seems to be where the eigen libraries are included from. I could put the macro #define EIGEN_DONT_ALIGN in each of these. Of course this is many many files in PCL, as there are a lot of modules. One potential problem with this is that the modules then have things like EIGEN_MAKE_ALIGNED_OPERATOR_NEW in a bunch of their include files. Is this going to combat my efforts to turn it off? Also there are these standrard eigen includes but other files also include Eigen directly, what should i do about those?

TURN OFF EIGEN ALIGNMENT IN EIGEN

Is there a way to do this? I have had a quick search and it doesn't seem like there is a way to install the header only library with this turned off?

OTHER IDEAS

I would be happy to hear any other suggestions with how to deal with this?


回答1:


The answer by @Anycorn is outdated: starting from 3.3 (or 3.2 ?), this macro is deprecated, see this bug report, and the current state of the page describing the various macros.

You should now use EIGEN_MAX_ALIGN_BYTES=0.




回答2:


PCL uses CMake as a build system.

You can add add_definitions(-DEIGEN_DONT_ALIGN) line in CMakeLists.txt to achieve what you want



来源:https://stackoverflow.com/questions/23878590/turn-off-eigen-alignment-in-the-pcl-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!