diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/howto/CrossBuildForArm.md | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/docs/howto/CrossBuildForArm.md b/docs/howto/CrossBuildForArm.md index 25d0ead95..8f04530da 100644 --- a/docs/howto/CrossBuildForArm.md +++ b/docs/howto/CrossBuildForArm.md @@ -40,37 +40,64 @@ This will skip adding proxy settings to `apt` package manager. sudo ./tools/cross/build_rootfs.sh arm --skipproxy ``` -## Cross build for ARM +## Install Toolchain + +We recommend you have g++ >= 6 installed on your system because NN generated tests require it. + +On Ubuntu 18.04 LTS, you can install using `apt-get`. +Choose g++ version whatever you prefer: 6, 7 or 8. -Install cross compilers ``` -sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi -sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf +sudo apt-get install g++-{6,7,8}-arm-linux-gnueabi ``` -Build and install ARM Compute Library +On Ubuntu 16.04 or older, follow the next steps: + +``` +cd ~/your/path +wget https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabihf/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz +tar xvf gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz +echo 'PATH=~/your/path/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin:$PATH' >> ~/.bashrc +``` + +Make sure you get `libstdc++.so` updated on your target with your new toolchain's corresponding one. + +For exmaple, if you installed gcc-linaro-7.2.1-2017.11 above, do + +``` +wget https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabihf/runtime-gcc-linaro-7.2.1-2017.11-arm-linux-gnueabihf.tar.xz +tar xvf runtime-gcc-linaro-7.2.1-2017.11-arm-linux-gnueabihf.tar.xz ``` + +Then, copy `libstdc++.so.6.0.24` into `/usr/lib/arm-linux-gnueabihf`, and update symbolic links on your device. + + +## Build and install ARM Compute Library + +``` +ROOTFS_ARM=/path/to/nnfw/tools/cross/rootfs/arm \ TARGET_ARCH=armv7l make acl ``` Mostly you only need once of ACL build. This will build and install to `Product/(target_arch-os)/out/bin` folder. - this is required for ARM on Ubuntu +## Build nnfw + Give `TARGET_ARCH` variable to set the target architecture ``` -CROSS_BUILD=1 TARGET_ARCH=armv7l make -CROSS_BUILD=1 TARGET_ARCH=armv7l make install +ROOTFS_ARM=/path/to/nnfw/tools/cross/rootfs/arm \ +CROSS_BUILD=1 TARGET_ARCH=armv7l make all install ``` - supports `armv7l` and `aarch64` for now If you used `ROOTFS_DIR` to prepare in alternative folder, you should also give this to makefile. ``` -CROSS_BUILD=1 ROOTFS_DIR=/home/user/rootfs/arm-xenial TARGET_ARCH=armv7l make -CROSS_BUILD=1 ROOTFS_DIR=/home/user/rootfs/arm-xenial TARGET_ARCH=armv7l make install +CROSS_BUILD=1 ROOTFS_DIR=/home/user/rootfs/arm-xenial TARGET_ARCH=armv7l make all install ``` -## To run test -Run the following: +## Run test + ``` ./tools/test_driver/test_driver.sh --artifactpath=. -```
\ No newline at end of file +``` |