projectNe10 / Ne10

An open optimized software library project for the ARM® Architecture
Other
1.46k stars 408 forks source link

Building with Android NDK r19c #228

Open rtoy opened 5 years ago

rtoy commented 5 years ago

I'm trying to build the current version of Ne10 using Android NDK r19c. (This is in preparation for building this as part of Chromium.)

I'm unable to get cmake to do an Android build because the paths for the compiler are not in $ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/. Instead they're in $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/

In addition, gcc/g++ aren't available. Only clang/clang++ are there.

I'd like some guidance on what needs to be done to get cmake to work. I can provide the patch for this after figuring out what to do.

Phillip-Wang commented 5 years ago

Hi @rtoy , I have tried to build the project for r19c. Please check #231 . It's only tested on linux x64 host for aarch64, android level 21. I will improve it and test on a few devices this weekend. Before that, any outside contribution will be appreciated.

P.S. You need to set ANDROID_NDK, NE10_ANRDROID_TARGET_ARCH, and ANDROID_API_LEVEL correctly. Please refer to the document in android_config.cmake.

Phillip-Wang commented 5 years ago

@rtoy I have improved PR #231 last weekend. It passed the CI tests with NDK r19c. You can find the status in the PR page. There is still an issue for ARMv7 build. I can not find the correct assembler for the ARMv7 assembly, so they are disabled in the PR. The performance result might look bad because the NEON intrinsic implementation has high register pressure. If any one know which assembler we should use, please let me know. I can improve the PR.

I have checked CMake's document (https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#id19). It seems difficult to support both r19c and r16b with one toolchain file. We will need one file for each supported NDK version. How many versions do we need to support?