ML-examples icon indicating copy to clipboard operation
ML-examples copied to clipboard

compile error of minst_tf for arm32 device

Open xiaobaiyang-programer opened this issue 6 years ago • 3 comments

I am trying to compile minst_tf for arm32 device, and the Makefile is: ARMNN_LIB = ${HOME}/armnn-devenv/armnn/build ARMNN_INC = ${HOME}/armnn-devenv/armnn/include

all: mnist_tf

mnist_tf: mnist_tf.cpp mnist_loader.hpp g++ -O3 -m32 -std=c++14 -I$(ARMNN_INC) mnist_tf.cpp -o mnist_tf -L$(ARMNN_LIB) -larmnn -larmnnTfParser -lpthread

clean: -rm -f mnist_tf

test: mnist_tf LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(ARMNN_LIB) ./mnist_tf

but i got the error: /usr/bin/ld: skipping incompatible /home/happyyang/armnn-devenv/armnn/build/libarmnn.so when searching for -larmnn /usr/bin/ld: cannot find -larmnn /usr/bin/ld: skipping incompatible /home/happyyang/armnn-devenv/armnn/build/libarmnnTfParser.so when searching for -larmnnTfParser /usr/bin/ld: cannot find -larmnnTfParser collect2: error: ld returned 1 exit status make: *** [mnist_tf] Error 1 I am sure libarmnn.so libarmnnTfParser.so are ok,because the UnitTests runs ok. who can help me how to compile it,thx

xiaobaiyang-programer avatar Nov 15 '18 13:11 xiaobaiyang-programer

@SaoirseARM

xiaobaiyang-programer avatar Nov 15 '18 14:11 xiaobaiyang-programer

Hi @yanghaiping1993 , thanks for getting in touch. Were those library files i.e. libarmnn.so/libarmnnTfParser.so compiled in 64 bit by any chance? That could explain the incompatibility errors you are seeing above.

I see you are attepting to compile mnist_tf.cpp ( -m32 ) in 32bit, so perhaps that is the issue.

SaoirseARM avatar Nov 15 '18 14:11 SaoirseARM

@SaoirseARM it is 32 bit lib, and the error is made by choosing wrong compiler,and I choose the arm-linux-androideabi-clang/clang++,reedit the Makefile,it works well on arm32 device (android OS) if I compile with cmake command:-DARMCOMPUTENEON=0 -DARMCOMPUTECL=0. BUT, if I compile with cmake command:-DARMCOMPUTENEON=1 -DARMCOMPUTECL=0, the log are showed as: Running 542 test cases... unknow location(0): fatal error: in "NeonTimerInstrument/NeonTimerMeasure": std::bad_alloc: std::bad_alloc /armnn-devenv/armnn/src/armnn/test/NeonTimerTest.cpp(35): last checkpoint: "NeonTimerMeasure" entry

*** 1 failuer is detected in the test module "UnitTests" My android device is an armv7a 32 bit cpu, and RAM is 2GB, what can cause that error?

xiaobaiyang-programer avatar Nov 19 '18 14:11 xiaobaiyang-programer