I add -D_XOPEN_SOURCE=700 to platforms.txt and that seemed to resolve the issue.
Just for documentation I edited the platforms.txt .ccp flags line to read:
compiler.cpp.flags=-g -Os -std=gnu++17 -c -D_XOPEN_SOURCE=700 {compiler.warning_flags} {compiler.zephyr.macros} "@{compiler.zephyr.cxxflags_file}" {compiler.zephyr.common_ldflags} {compiler.zephyr.extra_ldflags} {compiler.zephyr.common_cxxflags} {compiler.zephyr.extra_cxxflags} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu}
Then opened applab and recompiled and now seeing
Acceleration in g's X: 0.007 Y: -0.012 Z: 0.992 Rotation in deg/sec X: 0.122 Y: 0.000 Z: 0.122
mag x = -3 uT
mag y = 6 uT
mag z = 0 uT
the angle between the pointing direction and north (counterclockwise) is:333.43
Acceleration in g's X: 0.006 Y: -0.012 Z: 0.993 Rotation in deg/sec X: 0.183 Y: 0.244 Z: 0.122
mag x = -4 uT
mag y = 6 uT
mag z = 0 uT
the angle between the pointing direction and north (counterclockwise) is:326.31
Acceleration in g's X: 0.006 Y: -0.011 Z: 0.994 Rotation in deg/sec X: 0.000 Y: -0.061 Z: 0.122
mag x = -3 uT
mag y = 6 uT
mag z = 0 uT
the angle between the pointing direction and north (counterclockwise) is:333.43
But not in serial monitor in applab but on Serial through a FTDI connector so still missing something I guess
Thanks for all your help.