🐛 Bug Report
Currently, the following extra steps have to be taken to cross-compile the roscore:
- Manually delete the
gazebo_ros source directory
- Change
#include_next to #include in ~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/cstdlib:75
- Change
#include_next to #include in ~/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_ros listed 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_ros to the rosinstall_generator command.
- 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_next to #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, including cmath and 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.
🐛 Bug Report
Currently, the following extra steps have to be taken to cross-compile the roscore:
gazebo_rossource directory#include_nextto#includein~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/cstdlib:75#include_nextto#includein~/frc2019/roborio/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/cmath:45How to fix:
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.~/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`.To elaborate on 2 and 3, here is my (limited) understanding. The following applies to both
cstdlibandcmath, 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.hAs is typical in C++, the latter is just a compatability layer, including
cmathand stripping the namespaces.Additionally, GNU ISO C defines the following file:
[...]/usr/include/math.hC++
cmathcontains the following, outside of include guards:Similarly, C++
math.hincludes the following, outside of include guards:Clearly, the intent here is to include the C
math.h. I do not know why#include_nextincmathfails but#include_nextin C++math.hseems to succeed. But my understanding is that the Cmath.hshould be included. Sounds like a configuration issue with the cmake toolchain.