0

I'm trying to cross-compile CMake/C++ projects to be deployed onto Variscite's SoM i.MX6 DART board. They use Yocto with Freescale Linux (hence the fsl-image-gui you'll see below). I've been reading up on eSDKs and have been confused/stuck on a problem for a while. Here's the problem... How do I get a full/non-partial Yocto eSDK sysroot+toolchain so I can do CMake cross-compilation with it? Other SO posts have gotten me part of the way there, supplying several commands that you'll see below, but the sysroot is still not full. Here's what I'm trying to do...

First, I run these commands:

# Following http://variwiki.com/index.php?title=Yocto_Build_Release&release=RELEASE_THUD_V1.0_VAR-SOM-MX6
mkdir -p ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
mkdir ~/var-fslc-yocto
cd ~/var-fslc-yocto
repo init -u https://github.com/varigit/variscite-bsp-platform.git -b thud
repo sync -j4
MACHINE=var-som-mx6 DISTRO=fslc-framebuffer . setup-environment build_fb
echo 'TOOLCHAIN_HOST_TASK_append = "${SDK_EXTRA_TOOLS}"' >> conf/local.conf
echo 'SDK_EXTRA_TOOLS = " nativesdk-cmake     "' >> conf/local.conf
bitbake fsl-image-gui
bitbake -c populate_sdk_ext fsl-image-gui
cd tmp/deploy/sdk
./fslc-framebuffer-glibc-x86_64-fsl-image-gui-armv7at2hf-neon-toolchain-ext-2.6.2.sh
# Get a new shell (clears the environment variables set by the "MACHINE ..." command you ran above)
exit
ssh username@ubuntu-machine
cd ~/fslc-framebuffer_sdk
source ./environment-setup-armv7at2hf-neon-fslc-linux-gnueabi
devtool add lcm https://github.com/lcm-proj/lcm/archive/v1.4.0.tar.gz
# Edit the autogenerated recipe in an editor.
# Change the EXTRA_OECMAKE variable line to...
# EXTRA_OECMAKE = "-DLCM_ENABLE_EXAMPLES=OFF -DLCM_ENABLE_TESTS=OFF"
devtool edit-recipe lcm
devtool build lcm
devtool build-image fsl-image-gui

Due to the SDK_EXTRA_TOOLS and nativesdk-cmake lines, the eSDK does indeed have a CMake toolchain file at ~/fslc-framebuffer_sdk/sysroots/x86_64-fslcsdk-linux/usr/share/cmake/OEToolchainConfig.cmake. That's very helpful. What I want to be able to do is use that toolchain to cross-compile a CMake/C++ project that depends on LCM (it does a find_package(LCM)). Unfortunately, since Yocto's Rocko version, it looks like eSDK sysroots don't have all of the recipe installation files (see this and this). What this means is that each recipe builds with its own sysroot. This means that the devtool build lcm makes a recipe-specific sysroot instead of populating the existing var-som-mx6 sysroot that the OEToolchainConfig.cmake file points to (and that I would like to treat as a CMake cross-compilation sysroot). Therefore, the find_package(LCM) is failing to find LCM, since the var-som-mx6 sysroot doesn't have it.

The var-som-mx6 sysroot already has tons of other utilities installed there like NodeJS, udev, etc. How do I make LCM also get installed there instead of into its own recipe-specific sysroot?

  • You need to add `DEPENDS = "lcm"` on your project recipe, and probably need to add `'TOOLCHAIN_TARGET_TASK_append = " lcm-dev"` before generating sdk. – Nayfe Jul 02 '19 at 18:27
  • Thanks, I'll try that. Should I add `TOOLCHAIN_TARGET_TASK_append = " lcm-dev"` to my `build_fb/conf/local.conf` or somewhere in my LCM recipe? – Mark Betters Jul 02 '19 at 19:30
  • in `local.conf` – Nayfe Jul 03 '19 at 06:06

0 Answers0