ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.17k stars 310 forks source link

Error compile for ArmNN #592

Closed xiaotongnii closed 2 years ago

xiaotongnii commented 2 years ago

aim at: build armNN Delegate ref from:https://github.com/ARM-software/armnn/blob/branches%2Farmnn_21_02/delegate/BuildGuideNative.md env: 1) ubuntu18.04 2) tensorflow-2.3.1 -build success 3) flatbuffers-1.12.0-build success 4) compute library_21.02 -build success delegate/ComputeLibrary$ scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0 -j8 internal_only=0

scons: Reading SConscript files ... Mkdir("build") scons: done reading SConscript files. ... larm_compute_graph scons: done building targets.

5) armnn_21.02 /delegate/armnn/build$ cmake .. -DARMCOMPUTE_ROOT=$BASEDIR/ComputeLibrary -DARMCOMPUTENEON=1 -DBUILD_UNIT_TESTS=0

The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Detecting C compiler ABI info ....

build armNN when make , appear erro about"ComputeLibrary/build/libarm_compute_core-static.a(Error.o): Relocations in generic ELF (EM: 183)" ,please give me some advice to slove problem, thanks. ---xiaotong

janeil01 commented 2 years ago

Hey @Niuxiaotong

did you have trouble building the arm compute library? You seem to have a build directory which should not be the case if you use the commands from the guide. Maybe you have cross compiled the ComputeLibrary before compiling it natively and you didn't do a clean build..

Hard to say. I suggest you try building again but before you do so clean your build: cd /home//delegate/ComputeLibrary/ scons -c # clean root directory rm -r build # remove build directory if there is one scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=arm64-v8a build=native

Hope that helps. Keep me posted! Jan

xiaotongnii commented 2 years ago

net is so terrible. update as follow: @janeil01 no, i build compute successfully according to the guides.

it is OK now. see guides,it use aarch64 machine natively .i am in x86 machine .before i do not add cross compile common to build armnn,when add CXX=Aarch64…… CC=aarch64… It is OK,Last ,i guess Most of our not has aarch64 machine so that meet some question according to guide. on guides base ,build just like this: CXX=arrch64-linux-gnu-g++ CC=aarch64-linux-gnu-gcc cmake .. -D...

janeil01 commented 2 years ago

Sorry, you were saying you are following the BuildGuideNative and I assumed you are building natively yourself.

Yeah, I'm afraid there currently isn't a cross-compile guide for the delegate available. But there is a general cross-compile guide for ArmNN at armnn/BuildGuideCrossCompilation.md which can be used as a reference.

xiaotongnii commented 2 years ago

Sorry, you were saying you are following the BuildGuideNative and I assumed you are building natively yourself.

Yeah, I'm afraid there currently isn't a cross-compile guide for the delegate available. But there is a general cross-compile guide for ArmNN at armnn/BuildGuideCrossCompilation.md which can be used as a reference.

It is OK, I also refer to BuildGuideCrossCompilation.md . at all ,it is just different compile between aarch64 and x86. by the way, accroding to guides, build tflite , is there different between aarch and x86 envinment??

janeil01 commented 2 years ago

Yes there is. The CrossCompile guide doesn't actually build tflite. It only extracts the schema file that we armnn is using to translate tflite models.

To build the armnn delegate we need to link to the cpp tflite library. You don't have to build it yourself, as the guide shows it, you can also use a prebuilt tflite binary of it too.

xiaotongnii commented 2 years ago

ok,I will open another issue , close this ,thanks .