ck-caffe icon indicating copy to clipboard operation
ck-caffe copied to clipboard

"ck compile program:caffe-time --target_os=android21-arm" fails with Android NDK GCC compiler

Open psyhtest opened this issue 8 years ago • 4 comments

$ ck compile program:caffe-time --target_os=android21-arm

<...>

In file included from /home/anton/CK_TOOLS/lib-opencv-development-android-ndk-4.9.x-android21-arm-32/src/3rdparty/libwebp/cpu-features/cpu-features.c:61:0:android-ndk-r13b/platforms/android-21/arch-arm/usr/include/machine/cpu-features.h:52:6: error: #error Unknown or unsupported ARM architecture
 #    error Unknown or unsupported ARM architecture
      ^
make[2]: *** [3rdparty/libwebp/CMakeFiles/libwebp.dir/cpu-features/cpu-features.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Full log: caffe-time.android21-arm.gcc.txt

psyhtest avatar Feb 01 '17 17:02 psyhtest

A trivial workaround seems to use:

ck compile program:caffe-time --target_os=android21-arm-v7a

but one would naturally expect:

ck compile program:caffe-time --target_os=android21-arm

to succeed if it's allowed.

psyhtest avatar Feb 01 '17 18:02 psyhtest

Well, this is a real program (and not program:caffe which is a front-end to already compiled caffe), so you need to compile it first ;). Therefore it's not a workaround, but correct usage ;) ... I also wrote it in the docs ...

As for OS - originally I had only -arm, but then it caused lots of confusion, because different packages means different things under default -arm (I noticed it when I was unified all Caffe deps), that's why eventually I tried to unify it similar to what other meant by this:

  • androidXX-arm has "abi": "armeabi",

  • android19-arm-v7a "abi": "armeabi-v7a",

  • android19-arm-v7a-neon "abi": "armeabi-v7a", "cpu_features": { "arm_fp_neon": "yes" },

  • android19-arm-v7a-hard-neon "abi": "armeabi-v7a", "cpu_features": { "arm_fp_hard": "yes", "arm_fp_neon": "yes" },

Also, notice, that if we use device module for ARM's workload automation, it will try to detect device features and will try to automatically pre-set correct OS ...

So, it's more about conventions. Otherwise, how will we specify default ABI of "armeabi"? Which CK OS extension should we use?

gfursin avatar Feb 01 '17 20:02 gfursin

I see what you mean. But I used the compile action in both cases: just with --target_os=android21-arm-v7a it succeeded and with --target_os=android21-arm failed halfway...

I guess I am complaining that CK should have given a warning and presented a list of options for the ambiguous target arm. In fact, it would be nice to use something like:

$ ck compile program:caffe-time --target_tags=android,arm

and then be asked to resolve the target with supported versions of Android and architecture...

psyhtest avatar Feb 02 '17 09:02 psyhtest

My idea was to keep basic blocks such as "program" quite simple and gradually add more functionality in a higher-level modules. As I mentioned, there is already additional functionality which we do not use much yet, where you connect your "machine", describe it, detect parameters, and then use it as a target, i.e. $ ck add machine:my-target-machine above command should normally be able to detect the most appropriate Android OS version and ABI, and then you can use it as following: $ ck compile program:caffe-time --speed --target=my-target-machine

This is the preffered method, but I just didn't have time to thoroughly test it though. It was prepared as a part of CK-WA: https://github.com/ctuning/ck-wa

However, eventually, we can also enhance compilation with tags, as you suggest. I am neutral to that, particularly if it is useful for users and simple to implement ;) ...

gfursin avatar Feb 02 '17 09:02 gfursin