PX4-Autopilot: Nuttx cmath: FMU target compilation error
Describe the bug This commit is stopping me from building the Firmware on my computer.
I get compilation errors of the following form while building any of the fmu targets.
In file included from NuttX/nuttx/include/cxx/cmath:46:0,
from ../../src/lib/ecl/ecl.h:99,
from ../../src/lib/ecl/geo/geo.cpp:46:
/usr/include/newlib/math.h:18:3: error: '__ULong' does not name a type
__ULong i[2];
^~~~~~~
compilation terminated due to -Wfatal-errors.
Do I have to upgrade anything? Does anybody else have the same issue? @dagar FYI
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 39 (18 by maintainers)
It returns:
/home/gnclab/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gdb
Please don’t add to an issue. And for questions ask in discuss.px4.io.
We only support this version: https://github.com/PX4/Firmware/blob/342e0da7961f9a3301706ed3835cfc163b14b2ed/Tools/setup/ubuntu.sh#L141 Please use this script to update your system.
You should update to GCC 7 from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads or run this script in tree (https://github.com/PX4/Firmware/blob/master/Tools/setup/ubuntu.sh).
You can often get away with running different versions of the toolchain, but we’re not in a position to support that. Separately I think we should also remove most of the <cmath> inclusions.
We’ll hopefully be jumping to GCC 9 soon. https://github.com/PX4/Firmware/pull/13448
What’s your development environment and which version of the toolchain (arm-none-eabi-gcc) are you using? We really only support one particular version at a time (currently 7-2017-q4-major). https://github.com/PX4/Firmware/blob/bbd37ada415785507e4bfaea1cefd36190974e5f/Tools/setup/ubuntu.sh#L156
Additionally, <cmath> from NuttX is pretty incomplete. We’re probably better not using it at all until we have something better in place.