Compiling NEON code on an Odroid XU4

Post Reply
Elijah3258
Posts: 1
Joined: Tue Jul 30, 2019 6:33 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Compiling NEON code on an Odroid XU4

Unread post by Elijah3258 » Tue Jul 30, 2019 6:37 pm

I have a ROS node that contains code generated by Matlab coder. This code has been generated to make use of the NEON instruction set on ARM Cortex A CPUs. I want to compile this code on a Hardkernel Odroid XU4 (which runs on a Samsung Exynos5422 Cortex™-A15 2Ghz and Cortex™-A7 Octa core CPU). However I am not successful in compiling/linking my code.

I have added the the following compiler flags in the packages CMakeLists.txt:

Code: Select all

 -mfloat-abi=softfp -mfpu=neon -O2.
Yet, during compilation I get the following error message:

Code: Select all

/usr/lib/gcc/arm-linux-gnueabihf/4.8/include/arm_neon.h:32:2: error:
#error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
This is followed by many more errors about unknown types:

Code: Select all

/home/odroid/catkin_ws/src/vio_ros/src/codegen/mw_neon.c:12:2: error: unknown type name ‘float32x4_t’
/home/odroid/catkin_ws/src/vio_ros/src/codegen/mw_neon.c:36:2: error: unknown type name ‘int32x4_t’
And many more. All of these types seem to be defined in

Code: Select all

arm_neon.h
What do I need to do to be able to compile my code?

Thanks for your help

User avatar
AreaScout
Posts: 1035
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: german, english
ODROIDs: X2, U3, XU3, C2, HiFi Shield, XU4, XU4Q,
N1, Go, VU5A, Show2, CloudShell2,
H2, N2, VU7A, VuShell
Has thanked: 13 times
Been thanked: 42 times
Contact:

Re: Compiling NEON code on an Odroid XU4

Unread post by AreaScout » Tue Jul 30, 2019 7:36 pm

    I think you need to add -mfloat-abi=hard

    RG

    blu
    Posts: 59
    Joined: Wed Mar 08, 2017 11:30 pm
    languages_spoken: english
    ODROIDs: XU4 eMMC, N2 eMMC
    Has thanked: 1 time
    Been thanked: 12 times
    Contact:

    Re: Compiling NEON code on an Odroid XU4

    Unread post by blu » Sat Aug 03, 2019 12:46 am

    AreaScout wrote:
    Tue Jul 30, 2019 7:36 pm
      I think you need to add -mfloat-abi=hard

      RG
      In addition to the above (which you want for performance), you also want:
      -march=armv7-a+neon

      or
      -march=armv7-a+neon-vfpv4

      if you also want to use the vfpv4 ISA (should not affect your neon code).

      Post Reply

      Return to “General Topics”

      Who is online

      Users browsing this forum: No registered users and 2 guests