Maratyszcza / NNPACK

Acceleration package for neural networks on multi-core CPUs
BSD 2-Clause "Simplified" License
1.67k stars 316 forks source link

Cmake step failing for android build #173

Closed RuABraun closed 4 years ago

RuABraun commented 4 years ago

When using cmake 3.6.3 with or without Ninja

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage

When using 3.14.2 there additionally is with Ninja

CMake Error: CMake was unable to find a build program corresponding to "Ninja".

Without Ninja and android

CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".

I'm on NDK 20, SDK API level 24. This is how I'm calling it:

cmake .. -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.cmake.toolchain -DANDROID_ABI=arm64-v8a -DANDROID_TOOLCHAIN=clang -DANDROID_ARM_NEON=1

I can compile QNNPACK for android without any problems by the way.

RuABraun commented 4 years ago

It should be:

-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake

not as in the README

-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.cmake.toolchain

Maratyszcza commented 4 years ago

Thank you for reporting this. Fixed in a344d23816542a1c91bc99c238fa520ac4936f9a