diff options
Diffstat (limited to 'docs/nnfw/howto/CrossBuildForAarch64.md')
-rw-r--r-- | docs/nnfw/howto/CrossBuildForAarch64.md | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/docs/nnfw/howto/CrossBuildForAarch64.md b/docs/nnfw/howto/CrossBuildForAarch64.md new file mode 100644 index 000000000..9f0af85b8 --- /dev/null +++ b/docs/nnfw/howto/CrossBuildForAarch64.md @@ -0,0 +1,77 @@ +# Cross building for AARCH64 (ARM64) + +In nnfw, we use `AARCH64` on build files such as Makefile, CMakeLists.txt and so on. + +## Prepare Ubuntu RootFS + +Install required packages + +``` +sudo apt-get install qemu qemu-user-static binfmt-support debootstrap +``` + +Use `build_rootfs.sh` script to prepare Root File System. You should have `sudo` + +``` +sudo ./tools/cross/build_rootfs.sh aarch64 +``` +- supports `arm`(default) and `aarch64` architecutre for now +- supports `xenial`(default) and `trusty` release + +To see the options, +``` +./tools/cross/build_rootfs.sh -h +``` + +RootFS will be prepared at `tools/cross/rootfs/aarch64` folder. + +### Prepare RootFS at alternative folder + +Use `ROOTFS_DIR` to a full path to prepare at alternative path. + +``` +ROOTFS_DIR=/home/user/rootfs/aarch64-xenial sudo ./tools/cross/build_rootfs.sh aarch64 +``` + +### Using proxy + +If you need to use proxy server while building the rootfs, use `--setproxy` option. + +``` +# for example, +sudo ./tools/cross/build_rootfs.sh aarch64 --setproxy="1.2.3.4:8080" +# or +sudo ./tools/cross/build_rootfs.sh aarch64 --setproxy="proxy.server.com:8888" +``` + +This will put `apt` proxy settings in `rootfs/etc/apt/apt.conf.d/90proxy` file +for `http`, `https` and `ftp` protocol. + +## Cross build for AARCH64 + +Install cross compilers +``` +sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu +``` + +Build and install ARM Compute Library +``` +CROSS_BUILD=1 TARGET_ARCH=aarch64 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 `AARCH64` on Ubuntu + +Give `TARGET_ARCH` variable to set the target architecture +``` +CROSS_BUILD=1 TARGET_ARCH=aarch64 make +CROSS_BUILD=1 TARGET_ARCH=aarch64 make 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/aarch64-xenial TARGET_ARCH=aarch64 make +CROSS_BUILD=1 ROOTFS_DIR=/home/user/rootfs/aarch64-xenial TARGET_ARCH=aarch64 make install +``` |