Skip to content

Unable to build using Android NDK + CLANG #207

@sandwichmaker

Description

@sandwichmaker

I am interested in building BLIS on android and comparing its performance with OpenBLAS and Eigen.

Even though current versions of the android-ndk ship with the GCC compiler as an option, the use of GCC in the NDK is deprecated:

https://android.googlesource.com/platform/ndk.git/+/master/CHANGELOG.md

Currently the BUILD build system when building for ARM explicitly checks for GCC and fails without it.

But it is straightforward to modify

config/arm64/make_defs.mk
config/cortexa57/make_defs.mk

to disable the check and modify the compiler flags to work with CLANG.

At this point we hit a more interesting hurdle

kernels/armv8a/3/bli_gemm_armv8a_opt_4x4.c

which fails with the CLANG complaining

kernels/armv8a/3/bli_gemm_armv8a_opt_4x4.c:73:1: fatal error: inline assembly requires more registers than available

Poking at the clobber list, it seems the function is using 9 general purpose registers too many. Commenting out any nine general purpose registers makes the function compile (incorrectly of course) and then fail on the next function in the file.

This is true for NDK version r15c, r16b and r17.

Is this something that can be easily fixed? Also I am curious as to why BLIS is using these rather large functions as inline assembly and not just assembler files?

I am happy to provide more detailed reproduction instructions if that will help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions