BALL-Project / ball

The Biochemical Algorithms Library
GNU Lesser General Public License v2.1
72 stars 31 forks source link

Build fails with >=boost-1.66: error: 'a' is a private member of 'boost::math::quaternion<float>' #645

Closed yurivict closed 6 years ago

yurivict commented 6 years ago
In file included from /usr/ports/science/ball/work/ball-1_4_3-BETA1-749-g9a6dc8f82/source/STRUCTURE/structureMapper.C:10:
/usr/ports/science/ball/work/ball-1_4_3-BETA1-749-g9a6dc8f82/include/BALL/MATHS/quaternion.h:375:9: error: 'a' is a private member of 'boost::math::quaternion<float>'
                this->a = (T)1;
                      ^
/usr/ports/science/ball/work/ball-1_4_3-BETA1-749-g9a6dc8f82/include/BALL/MATHS/quaternion.h:294:9: note: in instantiation of member function 'BALL::TQuaternion<float>::setIdentity' requested here
                this->setIdentity();
                      ^
/usr/ports/science/ball/work/ball-1_4_3-BETA1-749-g9a6dc8f82/source/STRUCTURE/structureMapper.C:303:14: note: in instantiation of member function 'BALL::TQuaternion<float>::TQuaternion' requested here
                Quaternion rotation_quat;
                           ^

boost-libs-1.66.0

philthiel commented 6 years ago

We probably should switch to eigen3 or Qt quaternions in the very near future?

tkemmer commented 6 years ago

Yeah, I guess both Eigen::Quaternion and QQuaternion would be reasonable replacements for BALL::TQuaternion (or at least a more suitable base class than boost::math::quaternion - in case we want to keep TQuaternion).

On first glance, it seems that QQuaternion does provide the same functionality as TQuaternion, while eigen3 lacks at least replacements for the {to,from}{Euler,Axis}Angle() functions. However, this would make BALL (core) additionally depend on QtGui (which doesn't have a nice ring to it tbh).

In the very short run, we might want to consider sticking with boost::math::quaternion, though, and replace direct access to base class members by the respective getters and copy/move assignments as changing the base class will break some code. Even when opting for a full replacement, we should consider fixing the issue (or requiring a boost version strictly below 1.66) and deprecating TQuaternion first.

philthiel commented 6 years ago

Totally agree!

Eigen3 provides access to/from AxisAngle via Eigen::AngleAxis, which can be constructed from a quaternion. It also provides an eulerAngles() function somewhere.

yurivict commented 6 years ago

This holds creation of the FreeBSD port, because the build is broken.

tkemmer commented 6 years ago

Patch merged as 22b58c4a70da8fab2d1dce87371efcdfa29b0387...ec2c02301b42c5f72c7608ed858c3b6f0c3739a1