ONE
ONE copied to clipboard
[onert] Enable build for ubuntu 22.04
What ?
- Make onert build works on ubuntu 22.04
Why ?
- For short term, like to enable nnfw PPA for ubuntu 22.04(ref: https://github.com/Samsung/ONE/issues/9502)
- Anyway, we eventually need this in the end
~Building onert on x86_64 now works.~ Most of the errors have already been resolved by #9265.
$ cd {one dir}
$ docker run -it --rm -v `pwd`:`pwd` -w `pwd` ubuntu:22.04 /bin/bash
apt-get update
apt-get install cmake libboost-all-dev libglib2.0-dev g++ python3-pip
python3 -m pip config set global.trusted-host "pypi.org files.pythonhosted.org pypi.python.org" --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org
python3 -m pip install numpy
BUILD_TYPE=debug make -f Makefile.template install
BUILD_TYPE=release make -f Makefile.template install
But external sources throw an error below.
ONE/externals/RUY/ruy/block_map.cc:375:25: error: 'numeric_limits' is not a member of 'std'
375 | int best_score = std::numeric_limits<int>::min();
| ^~~~~~~~~~~~~~
/home/jang/git/ragmani/onert/ONE/externals/RUY/ruy/block_map.cc:375:40: error: expected primary-expression before 'int'
375 | int best_score = std::numeric_limits<int>::min();
| ^~~
Same situation with arm and aarch64. Only ruy
throws the error. I hope this error is solved by #9500.
- arm
$ sudo apt-get install qemu qemu-user-static binfmt-support debootstrap
$ cd {one dir}
$ ROOTFS_DIR=`pwd`/tools/cross/rootfs/arm-jammy sudo -E ./tools/cross/install_rootfs.sh arm jammy --skipunmount
$ cd {one dir}
$ docker run -it --rm -v `pwd`:`pwd` -w `pwd` ubuntu:22.04 /bin/bash
apt-get update
apt-get install cmake libboost-all-dev libglib2.0-dev g++-arm-linux-gnueabihf python3-pip scons
python3 -m pip config set global.trusted-host "pypi.org files.pythonhosted.org pypi.python.org" --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org
python3 -m pip install numpy
ROOTFS_DIR=`pwd`/tools/cross/rootfs/arm-jammy TARGET_ARCH=arm BUILD_TYPE=debug make -f Makefile.template install
ROOTFS_DIR=`pwd`/tools/cross/rootfs/arm-jammy TARGET_ARCH=arm BUILD_TYPE=release make -f Makefile.template install
- aarch64
$ sudo apt-get install qemu qemu-user-static binfmt-support debootstrap
$ cd {one dir}
$ cat tools/cross/aarch64/sources.list.jammy
deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
$ ROOTFS_DIR=`pwd`/tools/cross/rootfs/aarch64-jammy sudo -E ./tools/cross/install_rootfs.sh aarch64 jammy --skipunmount
$ cd {one dir}
$ docker run -it --rm -v `pwd`:`pwd` -w `pwd` ubuntu:22.04 /bin/bash
apt-get update
apt-get install cmake libboost-all-dev libglib2.0-dev g++-aarch64-linux-gnu python3-pip scons
python3 -m pip config set global.trusted-host "pypi.org files.pythonhosted.org pypi.python.org" --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org
python3 -m pip install numpy
ROOTFS_DIR=`pwd`/tools/cross/rootfs/aarch64-jammy TARGET_ARCH=aarch64 BUILD_TYPE=debug make -f Makefile.template install
ROOTFS_DIR=`pwd`/tools/cross/rootfs/aarch64-jammy TARGET_ARCH=aarch64 BUILD_TYPE=release make -f Makefile.template install