Skip to content

How to cross-compile libraries for use on Android? #752

@leo4678

Description

@leo4678

when complie blis using Android NDK 23, error is ld : error: unable to find library -lrt

./configure --enable-threading=pthreads CC=$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++  AR=$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar RANLIB=$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib LIBPTHREAD=$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/lib64/libc++.so arm64

make -j32
Dynamically linking lib/arm64/libblis.so
Archiving lib/arm64/libblis.a
ld: error: unable to find library -lrt
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:790: recipe for target 'lib/arm64/libblis.so' failed
make: *** [lib/arm64/libblis.so] Error 1

libpthread and librt libraries were included in libc
https://developer.android.com/ndk/guides/stable_apis#c_library

How to quickly integrate blis on Android?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions