Compiling NEON code on an Odroid XU4

Post Reply
David553
Posts: 1
Joined: Fri Sep 27, 2019 7:24 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Compiling NEON code on an Odroid XU4

Unread post by David553 » Fri Sep 27, 2019 7:40 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:

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

Nuems
Posts: 126
Joined: Thu Sep 19, 2013 3:50 am
languages_spoken: english, german
ODROIDs: xu, c1
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Compiling NEON code on an Odroid XU4

Unread post by Nuems » Fri Sep 27, 2019 11:27 pm

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