ONE - On-device Neural Engine
|
In ONE, we use AARCH64
on build files such as Makefile, CMakeLists.txt and so on.
Install required packages
Use install_rootfs.sh
script to prepare Root File System. You should have sudo
arm
(default) and aarch64
architecutre for nowfocal
, jammy
, and noble
releaseTo see the options,
RootFS will be prepared at tools/cross/rootfs/aarch64
folder.
* CAUTION: The OS version of rootfs must match the OS version of execution target device. On the other hand, you need to match the Ubuntu version of the development PC with the Ubuntu version of rootfs to be used for cross-build. Otherwise, unexpected build errors may occur.
If you are using Ubuntu 20.04 LTS, select focal
, if you are using Ubuntu 22.04 LTS, select jammy
. You can check your Ubuntu code name in the following way.
install_rootfs.sh
will select development system code name as default.
If a build error occurs because the version of the development system and the target system do not match, and if you can't replace your development system for any reason, you can consider cross-build using the docker image.
Use ROOTFS_DIR
to a full path to prepare at alternative path.
If you need to use proxy server while building the rootfs, use --setproxy
option.
This will put apt
proxy settings in rootfs/etc/apt/apt.conf.d/90proxy
file for http
, https
and ftp
protocol.
Install cross compilers
Give TARGET_ARCH
variable to set the target architecture
armv7l
and aarch64
for nowIf you used ROOTFS_DIR
to prepare in alternative folder, you should also give this to makefile.
You can also omit the CROSS_BUILD=1
option if you explicitly pass ROOTFS_DIR
. In that case, if the TARGET_ARCH
are differs from the hostarchitecture, the make script automatically applies CROSS_BUILD=1
. So, if you set ROOTFS_DIR
as an environment variable, you can simply perform normal build and cross build as follows.
To run and test the cross-compiled runtime, you need to copy the compiled output to the target device of the architecture in which it is executable. Please refer to the following document for details on the test procedure. In the guide, armv7l-linux.debug
in path should be replaced by referring to your build result.