I've finally got my development environment setup and running on the mx8mqevk platform. The Hantro, FFMPEG and OpenMax IL libraries are compiled and I can link a binary. I haven't done much testing, but will open another discussion for that if needed.
Here's some notes for anyone else coming along that may be in a similar situation needing to build an image or create a cross-compiling environment on Docker for Mac:
After a few retries of increasing the docker container size to ultimately 200GB, that gave me sufficient space to build the image from the BSP I needed with all the packages.
I used this Docker image to start with: satoshikumano/ubuntu-18.04-cpp:0.0.1
and this command to start a container with the image.
Note: -v <host dir>:<container dir> is an option to share a directory between the host and the docker container. This is one way to copy files to/from the host/container which I find more convenient & easier than the docker cp command.
./docker run -it -d -p 80:80 -v <host dir>:<container dir> --name ubuntu satoshikumano/ubuntu-18.04-cpp:0.0.1 bash
The i.MX_Yocto_Project_User's_Guide.pdf file was quite helpful, but there were still issues I had to work through.
One example is on pgs 5 & 6 on the Yocto Project Setup chapter, I had to use
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-sumo -m imx-4.14.78-1.0.0_ga.xml
instead of
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-rocko -m imx-4.9.88-2.0.0_ga.xml
Probably due to the pdf being a little behind.
In build/conf/local.conf, I had this line set to the following to include all the recipes I needed:
EXTRA_IMAGE_FEATURES ?= "dbg-pkgs dev-pkgs tools-sdk tools-debug tools-profile debug-tweaks"
There were several linux package dependencies to install besides the ones shown in section 3.1 Host Packages
a few were:
apt-get install python3 python3-pip cpio vim locales dpkg libncurses5-dev libncursesw5-dev xcb-proto
Also, while building, there were various compile and install stage failures, and I found for a reason yet unknown, that if I went in and ran the appropriate run_docompile or run_doinstall script from a different shell window, it would go through, at which point, the yocto build could be restarted and continue on.
Some places I had to actually tweak build scripts as one instance, it was trying to execute python 2.x script with a python 3.x interpreter.
Other cases, there were gcc compiler errors which I had to trek through to get working.
There were some cases where the compiler was building for the local environment rather than the target environment which ended up being the $PATH pointing to the incorrect compiler. Adjusting the $PATH variable resolved it.
Also, one part of the build was complaining about the locale not being correct, so some parts of these steps fixed it:
dpkg-reconfigure locales
apt-get install locales
# local-gen en_US.UTF-8
update-locale LC ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
There were link errors on some modules complaining about missing xcb, Xau and Xdmcp libraries. I ended up tweaking either the offending Makefile or Makefile.ac. Others were resolved by setting this env variable:
export X_EXTRA_LIBS="-lxcb -lXau -lXdmcp"
Here's another build variable that fixed another build failure on one of the recipes:
# error: Undefined reference to _IO_fwide:
# add -D_IO_fwide=fwide to CFLAGS
And lastly, strange compiler errors indicating bugs in gcc which turned out to be OOM errors. I increased the ram footprint of the docker image to 6GB.
This is what the final .sdcard image looked like:
-rw-r--r-- 1 pi pi 8682209280 Feb 23 09:49 fsl-image-validation-imx-imx8mqevk-20190222165938.rootfs.sdcard
Take care,
- Doug
"Nothing is impossible if ImPossible"