Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I'm stuck with compilation FLAGS

Featured Replies

Hi,

 

I'm trying to build a zynthian synthesizer on a nanoPi m4v2. The principle is to start from a minimal buster image and run a bunch of compilation scripts (see here on github) to create all the needed software. But all that stuff is for Raspberry Pi.

In an initialization script (see here on github) they define compilation flags like this:
 

if [ "$ZYNTHIAN_FORCE_RBPI_VERSION" ]; then
    hw_architecture="armv7l"
    rbpi_version=$ZYNTHIAN_FORCE_RBPI_VERSION
else
    hw_architecture=`uname -m 2>/dev/null`
    if [ -e "/sys/firmware/devicetree/base/model" ]; then
        rbpi_version=`tr -d '\0' < /sys/firmware/devicetree/base/model`
    else
        rbpi_version=""
    fi
fi

if [ "$hw_architecture" = "armv7l" ]; then
    # default is: RPi3
    CPU="-mcpu=cortex-a53 -mtune=cortex-a53"
    FPU="-mfpu=neon-fp-armv8 -mneon-for-64bits"
    if [[ "$rbpi_version" =~ [2] ]]; then
        CPU="-mcpu=cortex-a7 -mtune=cortex-a7"
        FPU="-mfpu=neon-vfpv4"
    fi
    #CPU="${CPU} -Ofast" #Breaks mod-ttymidi build
    FPU="${FPU} -mfloat-abi=hard -mlittle-endian -munaligned-access -mvectorize-with-neon-quad -ftree-vectorize"
    CFLAGS_UNSAFE="-funsafe-loop-optimizations -funsafe-math-optimizations -ffast-math"
fi
export MACHINE_HW_NAME=$hw_architecture
export RBPI_VERSION=$rbpi_version
export CFLAGS="${CPU} ${FPU}"
export CXXFLAGS=${CFLAGS}
export CFLAGS_UNSAFE=""
export RASPI=true

I'm totally confused with aarch64, arm64, armv7, armv8 ...

Can someone help me to set the right options here.

 

What I've done so far, was to remove all these FLAGS initialization (because of errors), but this is for sure not the best way to optimize that :wacko:

 

Thank you for your input!

Quote

I'm totally confused with aarch64, arm64, armv7, armv8 ...

TBH if you are already confused by that maybe you should start a little smaller ;)

The script you show above seems to be made for 32bit arm processors and the problem starts right there since the RK3399 is a 64bit arm processor and doing stuff like compat is not so easy task like it is on intel architecture.

Are you cross-compiling or compiling directly on the hardware ?

In the second case, just set -march=, -mcpu= and -mtune= to native.

 

Edit : Also forget about the FPU flags for ARMv8. Most ARMv8 processors are equipped with hardware FPU units.

 

  • Author

Hi Werner, hi Myy

 

I like big challenge :D

I went through all the building process (without having initialized any FLAGS as said above) on the nanoPi itself.

But I don't realize how it can impact on software performance, or compilation speed or ....

 

I will run the process again with

13 minutes ago, Myy said:

-march=, -mcpu= and -mtune= to native

 

Thank you

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.