-
Notifications
You must be signed in to change notification settings - Fork 0
Description
🐛 Bug Report
Currently, the following extra steps have to be taken to cross-compile the roscore:
- Manually delete the
gazebo_rossource directory - Change
#include_nextto#includein~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/cstdlib:75 - Change
#include_nextto#includein~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/cmath:45
How to fix:
- ackerman_steering_controller (Part of ros_controllers) has
gazebo_roslisted as a dependency since it is used for tests. We do not want anything to do with Gazebo when we cross compile. Can be fixed by adding--exclude gazebo_rosto therosinstall_generatorcommand. - Fix cmake toolchain. Need to look into this further. I believe the correct behaviour would be to include
~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/math.h. I'm not sure what file is being included right now when I switch from#include_nextto #include`. - As above.
To elaborate on 2 and 3, here is my (limited) understanding. The following applies to both cstdlib and cmath, it's just quicker to type math than stdlib :)
GNU ISO C++ defines the following two files:
[...]/usr/include/c++/6.3.0/cmath[...]/usr/include/c++/6.3.0/math.h
As is typical in C++, the latter is just a compatability layer, includingcmathand stripping the namespaces.
Additionally, GNU ISO C defines the following file:
[...]/usr/include/math.h
C++ cmath contains the following, outside of include guards:
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include_next <math.h>
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
Similarly, C++ math.h includes the following, outside of include guards:
#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS
# include_next <math.h>
#else
Clearly, the intent here is to include the C math.h. I do not know why #include_next in cmath fails but #include_next in C++ math.h seems to succeed. But my understanding is that the C math.h should be included. Sounds like a configuration issue with the cmake toolchain.