We will cross compile L5.4.3_1.0.0 on ubuntu18.04 LTS platform in three steps.
1. Installing Ubuntu 18.04 to vmplayer14 & Configuring Ubuntu 18.04 LTS
2. Compiling L5.4.3_1.0.0 BSP According to Steps in i.MX_Yocto_Project_User's_Guide.pdf
3. Handling tensorflow-lite compilation errors.
--BEGIN
No.1 Installing Ubuntu 18.04 to vmplayer14 & Configuring Ubuntu 18.04 LTS
1. Install 18.04 on vmplayer
After installation is done, root user should be set at first.
# sudo passwd root
Then follow these steps to configuration ubuntu 18.04 for environment of compiliation
--Changing sources of ubuntu 18.04 mirror
If you are Chinese users, you can do the step, which can improve your system performance.
# sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# sudo geit /etc/apt/source.list
Comment |
---|
I.MX customers outside China do not need to modify Ubuntu source list, or can modify it to local mirror site of Ubuntu 18.04, which can improve the speed of software upgrade. |
Delet all sources and copy following lines here, Then save it and exit
Update ubuntu source |
---|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse |
Then running these 2 commands to update sources and packages
# sudo apt-get update
# sudo apt-get upgrade
2. Installing packages for compiliation
Packages For Compiling BSP |
---|
# sudo apt-get install flex bison gperf build-essential zlib1g-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev tofrodos python-markdown libxml2-utils xsltproc # sudo apt-get install uuid-dev:i386 liblzo2-dev:i386 gcc-multilib g++-multilib subversion openssh-server openssh-client uuid uuid-dev zlib1g-dev liblz-dev lzop liblzo2-2 liblzo2-dev git-core curl # sudo apt-get install u-boot-tools mtd-utils android-tools-fsutils openjdk-8-jdk device-tree-compiler aptitude libcurl4-openssl-dev nss-updatedb # sudo apt-get install chrpath texinfo gawk cpio diffstat |
No.2 Compiling L5.4.3_1.0.0 BSP According to Steps in i.MX_Yocto_Project_User's_Guide.pdf
The detailed BSP compilation steps are given in i.MX_Yocto_Project_User's_Guide.pdf. Here are just some tips and simple steps.
For Chinese customers, the system may not respond when the repo init or repo sync command is executed after obtaining the repo script. Detailed description is below:
(1)Getting repo script
# mkdir ~/bin (this step may not be needed if the bin folder already exists)
# curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
# chmod a+x ~/bin/repo
# export PATH=~/bin:$PATH
(2)Getting Yocto source
# mkdir imx-yocto-bsp
# cd imx-yocto-bsp
# repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-zeus -m imx-5.4.3-1.0.0.xml
# repo sync
After running repo init or repo sync, you may encounter a situation where there is no progress for a long time, and repo sync stops there without any prompt. This may be caused by googlesource site being inaccessible.
At this time, you can modify the googlesource URL to the URL of Tsinghua University.
# gedit ./repo
Changing
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
To be:
REPO_URL = 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
Save and exit.
Then run “repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-zeus -m imx-5.4.3-1.0.0.xml”.
or repo sync
No.3 Handling tensorflow-lite compilation errors
If you encounter a tensorflow-lite compilation error during the compilation process, the following processing methods may be helpful to you.
Cause Analysis:
Compiling tensorflow-lite requires three steps: fetching packages, configuring environment, and compiling code.
During the configuring environment, the following 8 software packages need to be downloaded. If any of the 8 files are not successfully downloaded, an error will be reported and compilation will be terminated.
①9f48e814419e.tar.gz
②38ebac7b059e84692f53e5938f97a9943c120d98.zip
③release-1.8.0.tar.gz
④389ec3f906f018661a5308458d623d01f96d7b23.tar.gz
⑤master.zip
⑥816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz
⑦1f5eae5d6a135ff6811724f6c57f911d1f46bb15.tar.gz
⑧fft.tgz
If you encounter this problem, you can refer to the following methods to solve it.
Open the file with editor:
~/imx-yocto-bsp/build-xwayland/tmp/work/aarch64-poky-linux/tensorflow-lite/1.13.2-r0/git/tensorflow/lite/tools/make/download_dependencies.sh
URLs |
---|
EIGEN_URL="https://bitbucket.org/eigen/eigen/get/9f48e814419e.tar.gz" GEMMLOWP_URL="https://github.com/google/gemmlowp/archive/38ebac7b059e84692f53e5938f97a9943c120d98.zip" GOOGLETEST_URL="https://github.com/google/googletest/archive/release-1.8.0.tar.gz" ABSL_URL="https://github.com/abseil/abseil-cpp/archive/389ec3f906f018661a5308458d623d01f96d7b23.tar.gz" NEON_2_SSE_URL="https://github.com/intel/ARM_NEON_2_x86_SSE/archive/master.zip" FARMHASH_URL="https://github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz" FLATBUFFERS_URL="https://github.com/google/flatbuffers/archive/1f5eae5d6a135ff6811724f6c57f911d1f46bb15.tar.gz" FFT2D_URL="http://www.kurims.kyoto-u.ac.jp/~ooura/fft.tgz" |
Save and exit.
[comment]
Don’t run “bitbake tensorflow-lite -c cleanall before you modify it”, otherwise files will be deleted.
Then try to compile tensorflow-lite like below:
# bitbake tensorflow-lite -c compile
At the same time, we can open this directory and check if the following directories are created. If these 8 directories are successfully created, it means that links we modified are no problem.
After tensorflow-lite is successfully built, we can continue to compile full images.
# bitbake imx-image-full
--END
NXP TIC team
Weidong Sun
2020/3/30