ARM-software / ComputeLibrary

The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
MIT License
2.82k stars 774 forks source link

how to build for android #300

Closed lebronze closed 6 years ago

lebronze commented 6 years ago

My OS is linux and i want to compile Compute Library for android use, so i follow the Official Tutorials to build the library. I follow the chapter Build for Android and successfully build for arm v8a(64 system), however, when i build for arm-v7a(32 system),"error: undefined reference to 'sched_getcpu' "comes.

i don't know whether i follow the right chapter? Build for Android or Build for linux? choose "os=android arch=armv8a" or "os=linux arch=armv8a"

AnthonyBarbier commented 6 years ago

When you generate your standalone toolchain try to specify --api 21:

$NDK/build/tools/make_standalone_toolchain.py --arch arm64 --install-dir $MY_TOOLCHAINS/aarch64-linux-android-4.9 --stl gnustl --api 21
$NDK/build/tools/make_standalone_toolchain.py --arch arm --install-dir $MY_TOOLCHAINS/arm-linux-androideabi-4.9 --stl gnustl --api 21

cf this message

lebronze commented 6 years ago

@AnthonyARM cool ! I built the library successfully. And another question comes. How could i include the library in my project? I use the same method which to include opencv library to include ACL, but failed. So how could i use ACL in my project. Please help me.

AnthonyBarbier commented 6 years ago

Did you manage to use ACL in your project ? There shouldn't be anything different from other libraries (Except that you might need to link against OpenCL if you're using it, in which case it will not work on Android O and after).

myth01 commented 6 years ago

@AnthonyARM Why do you say "Except that you might need to link against OpenCL if you're using it, in which case it will not work on Android O and after"

AnthonyBarbier commented 6 years ago

It means that because of some added security now applications can only link against system libraries that have been explicitly whitelisted by the manufacturer. Therefore, even if OpenCL is available on your platform, you're unlikely to be able to use it in an App