Compiling NEON code on an Odroid XU4

Post Reply
Posts: 1
Joined: Fri Sep 27, 2019 7:24 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0

Compiling NEON code on an Odroid XU4

Post by David553 »

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:

And many more. All of these types seem to be defined in arm_neon.h

What do I need to do to be able to compile my code?

Thanks for your help

Posts: 171
Joined: Thu Sep 19, 2013 3:50 am
languages_spoken: english, german
ODROIDs: xu, c1, n2
Has thanked: 2 times
Been thanked: 15 times

Re: Compiling NEON code on an Odroid XU4

Post by Nuems »

I'm not a compiler expert, but you seem to use a hardfloat version of gcc when trying to compile with the softfloat flag. Judging from the subforum we're in, you want to compile for Android, so "softfloat" seems reasonable. However, all Linux distros I'm aware of switched to "hardfloat" for Arm-v7 and higher several years ago. So you need to install a toolchain for your Android project. But if you want to compile for Linux, reconsider the softfloat flag.

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 0 guests