You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since C++17 Eigen does not require custom alignment handling anymore.
Since ROS 2 Humble, C++17 has been the default, and at this time, support can be expected for new software.
Expected behavior
To be able to use Eigen without using the macros to create custom alignment for structs such as EIGEN_MAKE_ALIGNED_OPERATOR_NEW.
Current Behavior
This will crash because #5793 disabled the automatic Eigen check to disable the need for custom-aligned allocation.
This results in the destructors of classes/structs containing Eigen members but not the EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro (which is not needed for >=C++17) crashing when trying to free the memory.
E.g. with a
free(): invalid next size (normal)
Aborted (core dumped)
This is especially annoying since fixing this on the user side would require adding the macro in every class that directly or by inheritance contains eigen members and using the custom stl container allocators for any such class.
A practice that is cumbersome and error-prone.
Your Environment (please complete the following information):
OS: Ubuntu 24
Compiler: [:eg GCC 8.1]
PCL Version libpcl-dev (1.14)
Possible Solution
Setting the CXX standard to 17 (in general or for releases >=Ubuntu 22)
The text was updated successfully, but these errors were encountered:
Its because you want to use apt installed PCL, which I assume is build with c++14, in a c++17 project, that you encounter the error?
As an alternative you can just compile PCL from source with c++17 enabled? Then its not added according to #5793?
Yes, I use an apt-installed PCL.
The problem with compiling from source is that apt updates would probably overwrite a global installation, and I can't uninstall the apt package because other packages depend on it.
And especially when using it in a plugin, this would just be asking for trouble.
This is especially annoying since fixing this on the user side would require adding the macro in every class that directly or by inheritance contains eigen members and using the custom stl container allocators for any such class.
A practice that is cumbersome and error-prone.
Out of interest, how many classes would this be? Are these classes that use Eigen, but are unrelated to PCL?
The problem with compiling from source is that apt updates would probably overwrite a global installation
The PCL apt packages for a specific Ubuntu release will very likely not receive any update, at least this was, to my knowledge, never the case in the past. So on Ubuntu 24.04, you will e.g. not get PCL 1.15 (which is not yet released anyway), as a Ubuntu release keeps the software versions fixed, and only applies important security fixes for some packages (as far as I know).
If you build PCL from source, it will by the way be installed in a different location (/usr/local) than the apt version, at least by default.
And especially when using it in a plugin, this would just be asking for trouble.
Not sure what you mean? What kind of plugin?
Setting the CXX standard to 17 (in general
I am willing to discuss such a change, but since you will not get a different PCL version via apt on Ubuntu 24.04, this would be irrelevant for you.
By the way, we, the PCL maintainers, are not directly responsible for the apt packages and which setting are used while building PCL for the packages.
Context
Since C++17 Eigen does not require custom alignment handling anymore.
Since ROS 2 Humble, C++17 has been the default, and at this time, support can be expected for new software.
Expected behavior
To be able to use Eigen without using the macros to create custom alignment for structs such as
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
.Current Behavior
This will crash because #5793 disabled the automatic Eigen check to disable the need for custom-aligned allocation.
This results in the destructors of classes/structs containing Eigen members but not the
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
macro (which is not needed for >=C++17) crashing when trying to free the memory.E.g. with a
This is especially annoying since fixing this on the user side would require adding the macro in every class that directly or by inheritance contains eigen members and using the custom stl container allocators for any such class.
A practice that is cumbersome and error-prone.
Your Environment (please complete the following information):
Possible Solution
Setting the CXX standard to 17 (in general or for releases >=Ubuntu 22)
The text was updated successfully, but these errors were encountered: