android 编译 openfst openblas arm64

android 编译 openfst openblas arm64

1  ubuntu 下载 android-ndk-r21b-linux-x86_64.zip

2 下载Openblas-develop 和 openfst-1.6.7

cd  / home/android-ndk-r21b/build/tools

python make_standalone_toolchain.py --arch arm64 --api 23 --stl=libc++ --install-dir /tmp/my-android-toolchain


export PATH=/tmp/my-android-toolchain/bin:$PATH

cd openfst-1.6.7

CXX=clang++ ./configure --prefix=`pwd` --enable-static --enable-shared  --enable-ngram-fsts --host=aarch64-linux-android LIBS="-ldl"

make -j 4

make install

cd OpenBLAS

根据官网编译 https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-Android   Build ARMV8 with clang

# Set path to ndk-bundle
export NDK_BUNDLE_DIR=/home/android-ndk-r21

# Export PATH to contain directories of clang and aarch64-linux-android-* utilities
export PATH=${NDK_BUNDLE_DIR}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/:${NDK_BUNDLE_DIR}/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH

# Setup LDFLAGS so that loader can find libgcc and pass -lm for sqrt
export LDFLAGS="-L${NDK_BUNDLE_DIR}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x -lm"

# Setup the clang cross compile options
export CLANG_FLAGS="-target aarch64-linux-android --sysroot ${NDK_BUNDLE_DIR}/platforms/android-23/arch-arm64 -gcc-toolchain ${NDK_BUNDLE_DIR}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/"

# Compile
make TARGET=ARMV8 ONLY_CBLAS=1 AR=ar CC="clang ${CLANG_FLAGS}" HOSTCC=gcc -j4

 会出现找不到 一些头文如 stdio.h , 将/ home/android-ndk-r21b/ 目录的 sysroot/usr 的include 对应拷贝到 ${NDK_BUNDLE_DIR}/platforms/android-23/arch-arm64/usr

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值