Make Toolchains

Make Toolchains

Before reading the following content, we recommend you set up some environment variables to avoid any path error. For example:

export TOPCNN_HOME=~/workspace/TopCNN
export TOOLCHAIN_HOME=~/toolchains

Download

Download Android NDK, for example, from http://www.androiddevtools.cn/ (a link friendly to China)

This turtorial is based on android-ndk-r10e package. You can choose another newer version as you like, while the steps are almost the same. But make sure the generated folder’s name is android-ndk-r10e/ for ARMv7 and aarch64-linux-android-4.9 for ARMv8

Make toolchains for ARMv7

You will get a arm-linux-androideabi-4.9/ folder including compile environment for ARMv7 by following.

mkdir -p ${TOOLCHAIN_HOME}
cd path/to/your/android-ndk-r10e/
./build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=arm-linux-androideabi-4.9  --package-dir=${TOOLCHAIN_HOME}
cd ${TOOLCHAIN_HOME}
tar -jxvf  arm-linux-androideabi-4.9.tar.bz2 
cd arm-linux-androideabi-4.9/
cp ${TOPCNN_HOME}/cmake/cross_compile_support/armv7/* ./

Make toolchains for ARMv8

You will get a aarch64-linux-android/ folder including compile environment for ARMv8 by following.

cd ~
mkdir -p toolchains
cd android-ndk-r10e/
./build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=aarch64-linux-android-4.9  --package-dir=${TOOLCHAIN_HOME}
cd ${TOOLCHAIN_HOME}
tar -jxvf  aarch64-linux-android-4.9.tar.bz2
cd aarch64-linux-android-4.9
cp ${TOPCNN_HOME}/cmake/cross_compile_support/armv8/* ./

你可能感兴趣的:(Make Toolchains)