Eigen library arm build problem

When we add the eigen library and the arm-build, then there’s some conflicting about typedef.

So I checked that

  • Eigen library(Core) include arm_neon.h when we build for arm.

  • In arm_neon.h (line:71), there’s “typedef __fp16 float16_t”

and

  • In dw/Types.h(line:84), there’s also “typedef__half float16_t”

Both libraries declare the “float16_t”. so it makes some conflict.

How to handle that problem?

My error messages are below, thank you.

/home/jw31/nvidia/nvidia_sdk/DRIVE_Software_9.0_Linux_hyperion_E3550/DriveSDK/toolchains/gcc-linaro-5.4.1/lib/gcc/aarch64-linux-gnu/5.4.1/include/arm_neon.h: At global scope:
/home/jw31/nvidia/nvidia_sdk/DRIVE_Software_9.0_Linux_hyperion_E3550/DriveSDK/toolchains/gcc-linaro-5.4.1/lib/gcc/aarch64-linux-gnu/5.4.1/include/arm_neon.h:71:16: error: conflicting declaration ‘typedef __fp16 float16_t’
typedef __fp16 float16_t;
^
In file included from /home/jw31/nvidia/nvidia_sdk/DRIVE_Software_9.0_Linux_hyperion_E3550/DriveSDK/drive-t186ref-linux/targetfs/usr/local/driveworks-2.0/targets/aarch64-Linux/include/dw/core/Context.h:49:0,
from /home/jw31/workspace/bbav/bbav-282/app/framework.hpp:4,
from /home/jw31/workspace/bbav/bbav-282/app/framework.cpp:1:
/home/jw31/nvidia/nvidia_sdk/DRIVE_Software_9.0_Linux_hyperion_E3550/DriveSDK/drive-t186ref-linux/targetfs/usr/local/driveworks-2.0/targets/aarch64-Linux/include/dw/core/Types.h:84:16: note: previous declaration as ‘typedef struct __half float16_t’
typedef __half float16_t;
^

Dear jw31,

It seems to be caused by a gcc version mismatch.
Can you try compiling your app on the DriveAGX, then try linking against these libs on your host machine when you are cross compiling DriveWorks applications? Thanks.

When I compile for opencv2, I also meet this issue.
Now I use workaround

#define float16_t opencv_broken_float16_t
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <cv_bridge/cv_bridge.h>
#undef float16_t
1 Like