Jump to content

Recommended Posts

Posted

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!

Posted
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.

Posted

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.

 

Posted

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.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines