Compile Error on the PYNQ-Z2 board

I am trying to compile a Mxnet model to my PYNQ-Z2 board.
My images version is 2.3.
LLVM version is 4.0.1.
However, it occurs this error.

Here is the code of compilation.

@thierry can you help me?

I think I’ll need a little more context about your example; it’s odd that you’re using GCC toolchain for android; can you use vanilla GCC instead? perhaps you’re adding binaries to your PATH that shouldn’t be there?

I used to do some tests on Android.
So, I set export TVM_NDK_CC=/opt/androidndk16b-toolchain-armv7/bin/arm-linux-androideabi-g++.
How can I change that?

Yes, I think that’s the issue. I would use whichever GCC ships with your linux distro. What does which gcc give you when you run it in a clean environment?

Here is the information of GCC in my host device.

How can I modify the PATH?
which gcc give:

When I set export TVM_NDK_CC=/bin/gcc, it occurs this error.

My target is target =‘llvm -device=arm_cpu -target=arm-linux-gnueabihf’).

try the following, llvm -target=armv7-none-linux-gnueabihf

This is where the host target is set:

Ok, I will try.
Is it any problem when I set export TVM_NDK_CC=/bin/gcc?
And I want to know why I have to do it?
And what is vanilla GCC?

I don’t think that’s the issue; we shouldn’t be using NDK for the Zynq target. I believe it’s cross compiling for ARM but ARM has different ISA variants; Zynq uses armv7 which is worth specifying.

However, I’m thinking there could be a different setup issue in your build. Can you try just running the simple example on the pynq z1 unmodified? does that work?

Hi, I got an error while running the test program on pynq-z2, can you give me some suggestions? Any help is appreciated. Thanks! which gcc