Help wanted Armnn build failed for Android
error: variable 'numOutputElements' set but not used [-Werror,-Wunused-but-set-variable]

Hi @Saikatsaha1996, which version of armnn and android-nn-driver are you using? Regards
Hi @Saikatsaha1996, which version of armnn and android-nn-driver are you using? Regards
Hi @Saikatsaha1996, which version of armnn and android-nn-driver are you using? Regards
22.02 v i am using..
I am building in my own device.. compute library with OpenCL successfully build but i can't build ArmNN without tensorflow

Hi,
are you following this guide: https://github.com/ARM-software/armnn/blob/branches/armnn_22_02/BuildGuideAndroidNDK.md ?
Hi,
are you following this guide: https://github.com/ARM-software/armnn/blob/branches/armnn_22_02/BuildGuideAndroidNDK.md ?
Yes i am following this guide
Hi,
are you following this guide: https://github.com/ARM-software/armnn/blob/branches/armnn_22_02/BuildGuideAndroidNDK.md ?
Can you tell me exactly why i am getting this error ? Any dependency problem ?
Hi,
are you following this guide: https://github.com/ARM-software/armnn/blob/branches/armnn_22_02/BuildGuideAndroidNDK.md ?
@TeresaARM waiting for solution.. any solution please
Hi,
please try this patch: https://review.mlplatform.org/c/ml/armnn/+/7393
Regards
Hi,
please try this patch: https://review.mlplatform.org/c/ml/armnn/+/7393
Regards
Okay trying thank you for your response!
Hi,
please try this patch: https://review.mlplatform.org/c/ml/armnn/+/7393
Regards
@TeresaARM Fast error solved thank you for your help 😃
Getting new error ArmNN && ComputeLibrary v22.02
cmake .. -DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary -DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXE_LINKER_FLAGS="-pie -llog -lz"
make -j(nrproc)

Hi, that got fixed here: https://review.mlplatform.org/c/ml/armnn/+/7336 (this is already merged in the main branch, but not part of 22.02, it will be part of 22.05)
Could you please apply that patch as well?
Regards
Hi, that got fixed here: https://review.mlplatform.org/c/ml/armnn/+/7336
Could you please apply that patch as well?
Regards
Okay 👌👌 trying
Hi, that got fixed here: https://review.mlplatform.org/c/ml/armnn/+/7336 (this is already merged in master, but not part of 22.02, it will be part of 22.05)
Could you please apply that patch as well?
Regards
How to build without tensorflow ? -DTENSORFLOW=0 ?
Hi @Saikatsaha1996 ,
to build without tensorflow, you should do what you are doing, it is the default.
to build with tensorflow, you could use the script get_tensorflow.sh and set the -DTENSORFLOW_ROOT= to the path where tensorflow is.
could you send us a log/show us the error message you are seeing now?
Regards
Hi @Saikatsaha1996 ,
to build without tensorflow, you should do what you are doing, it is the default. to build with tensorflow, you could use the script get_tensorflow.sh and set the
-DTENSORFLOW_ROOT=to the path where tensorflow is.could you send us a log/show us the error message you are seeing now?
Regards
Hello @TeresaARM
getting this error

Hi @Saikatsaha1996 ,
to build without tensorflow, you should do what you are doing, it is the default. to build with tensorflow, you could use the script get_tensorflow.sh and set the
-DTENSORFLOW_ROOT=to the path where tensorflow is.could you send us a log/show us the error message you are seeing now?
Regards

Hi @Saikatsaha1996,
so, your last screenshot is setting -DTENSORFLOW_ROOT= and your second last, uses the same command but without setting -DTENSORFLOW_ROOT= ? or you changed something different?
are you unblocked now?
Regards
Hi @Saikatsaha1996,
so, your last screenshot is setting
-DTENSORFLOW_ROOT=and your second last, uses the same command but without setting-DTENSORFLOW_ROOT=? or you changed something different?are you unblocked now?
Regards
No same error getting with tensorflow root ..i already mentioned tensorflow root path...
Getting error like this

Hi,
Please have a look at BuildGuideAndroidNDK.md
and search for -fpic
The error message is asking you to recompile with -fPIC
please let us know how it goes
Thank you for your messages Kind Regards
Hi,
Please have a look at BuildGuideAndroidNDK.md and search for
-fpicThe error message is asking you to
recompile with -fPICplease let us know how it goes
Thank you for your messages Kind Regards
CFLAGS="-fPIE -fPIC" cmake .. -DCMAKE_SYSTEM_NAME=Android -DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary -DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXE_LINKER_FLAGS="-pie -llog -lz" -DTENSORFLOW_ROOT=$HOME/armnn-devenv/tensorflow
make -j8
Getting same error

@TeresaARM tried to build with , but same error..
cmake .. -DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary -DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXE_LINKER_FLAGS="-pie -llog -lz" -DTENSORFLOW_ROOT=$HOME/armnn-devenv/tensorflow-protobuf/tensorflow -DCMAKE_CXX_FLAGS="-fPIE -fPIC" -DCMAKE_POSITION_INDEPENDENT_CODE=ON
Hi @Saikatsaha1996,
which command have you used to build Compute Library?
Hi @Saikatsaha1996,
which command have you used to build Compute Library?
@TeresaARM hi!
scons Werror=0 -j8 debug=0 neon=1 opencl=1 os=android arch=arm64-v8a asserts=0 extra_link_flags=" -fPIC -fopenmp -static-openmp" benchmark_tests=0
@TeresaARM scons build complete without any error..
But you should edit "SConstruct" after that you can able to compile Computlibrary
line 325 and 326
env['CC'] = env['compiler_cache'] + c_compiler env['CXX'] = env['compiler_cache'] + cpp_compiler
Build done..
Hi @Saikatsaha1996 ,
could you please try to build with a command more similar to the one in the guide?
scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" \
benchmark_tests=0 validation_tests=0 os=android -j16
You are using, extra_link_flags, instead of extra_cxx_flags="-fPIC"
SConstruct file is correct, I checked with the Compute Library team, who are the owners of the file. But removing the part you have removed, instead of giving a prefix should be ok as well.
Regards
Hi @Saikatsaha1996 ,
could you please try to build with a command more similar to the one in the guide?
scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" \ benchmark_tests=0 validation_tests=0 os=android -j16You are using, extra_link_flags, instead of
extra_cxx_flags="-fPIC"SConstruct file is correct, I checked with the Compute Library team, who are the owners of the file. But removing the part you have removed, instead of giving a prefix should be ok as well.
Regards
Okay trying..
Hi @Saikatsaha1996 ,
could you please try to build with a command more similar to the one in the guide?
scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" \ benchmark_tests=0 validation_tests=0 os=android -j16You are using, extra_link_flags, instead of
extra_cxx_flags="-fPIC"SConstruct file is correct, I checked with the Compute Library team, who are the owners of the file. But removing the part you have removed, instead of giving a prefix should be ok as well.
Regards
@TeresaARM Hi!
😃👌🤩
Ultimately build done without warning, errors full green build with cmake and without android ndk && with your , @Computelibrary team's support..
Build complete with Android mobile, not used any pc desktop...
Thank you so much!

Solution is if you are build with mobile..
scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0 os=android extra_link_flags="-fopenmp -static-openmp" Werror=0 asserts=0 -j8
Solution is if you are build with mobile..
scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0 os=android extra_link_flags="-fopenmp -static-openmp" Werror=0 asserts=0 -j8
@TeresaARM
UnitTests faild because it is tensorflow problem.. when you clone tensorflow with get-tensoflow.sh please use chrrypik patch.. i am not use this patch that's why getting segmentation fault.. but it is ok .. i will re-compile with tensorflow patch version r2.5

Hi @Saikatsaha1996,
glad you hear it is working now. Here you can find the versions of the build dependencies for Arm NN: https://github.com/ARM-software/armnn/releases/tag/v22.02
Tensorflow needs to be 2.5.
Please let me know how it goes.
Kind Regards
Hi @Saikatsaha1996,
glad you hear it is working now. Here you can find the versions of the build dependencies for Arm NN: https://github.com/ARM-software/armnn/releases/tag/v22.02
Tensorflow needs to be 2.5.
Please let me know how it goes.
Kind Regards
Full build done .. with termux.. and now i need to test but my pc GPU gone for RMA so i can't test with adb push && pull for 2 or 3 days ..
