Yocto SDK, QtWebEngine: Unknown module(s) in QT: webengine - qt5

I'm doing my first steps with Qt and QtWebEngine on an embedded board (i.MX6), using Yocto. Using provided example recipes, like the quicknanobrowser, works nicely on the target. So I can't confirm this answer which claims that WebEngine is not available on embedded platforms.
Now I want to write my own QML application and deploy it on the board. With the recipe meta-toolchain-qt5 I created an SDK and installed it. In QtCreator I set all paths to the SDK installation and tried to build it, but got this error:
Project ERROR: Unknown module(s) in QT: webengine
11:13:13: The process "/opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake" exited with code 3.
It turned out that WebEngine was not included in the SDK. Thanks to this answer, I fixed that by putting the following to my own packagegroup-qt5-toolchain-target.bbappend file:
RDEPENDS_${PN} += " \
qtwebengine \
qtwebengine-qmlplugins \
qtquickcontrols-qmlplugins \
qtwebengine-examples \
"
Then reinstalled the SDK. Now it seems that all WebEngine files are available in the SDK installation (the zsh glob pattern below matches all directories in any subdirectory of /opt/poky/1.8/, which contain "webengine", case-insensitively):
% ls -1 -d (#i)/opt/poky/1.8/**/*webengine*(/)
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngine/
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngine/5.4.3/QtWebEngine/
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngineWidgets/
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWebEngineWidgets/5.4.3/QtWebEngineWidgets/
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/qml/QtWebEngine/
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/share/qt5/examples/webengine/
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/share/qt5/examples/webenginewidgets/
/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/share/qt5/translations/qtwebengine_locales/
Still, I get the same Unknown module error. This is independent of QtCreator, and can also be shown by directly calling qmake:
% source /opt/poky/1.8/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
% /opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake /home/me/test/test.pro -r -spec linux-oe-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
Project ERROR: Unknown module(s) in QT: webengine
The project itself should be fine, because it compiles and runs without problems on the Desktop installation.
Any ideas? Are there maybe still some files missing in the SDK? Where does qmake search for the modules? How can I tell qmake where to find the WebEngine installation?

In /opt/poky/1.8/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
add sh /opt/poky/1.8/sysroots/x86_64-pokysdk-linux/environment-setup.d/qt5.sh
This will set up the Qt5 environment.

Related

Library not loaded: #rpath/libtbb.dylib in Prophet / Python

I'm on a Mac X1, Monterey.
I've installed prophet and run into this issue when trying to fit a model.
RuntimeError: Error during optimization: console log output:
dyld[90668]: Library not loaded: #rpath/libtbb.dylib
Referenced from: /Users/{username}/opt/anaconda3/lib/python3.9/site-packages/prophet/stan_model/prophet_model.bin
Reason: tried: '/private/var/folders/cd/dfrqgp4s4ll55cwb7rtgccbw0000gq/T/pip-install-rjpuj450/prophet_d7e4cce10e414c89a572fe3605ae9269/build/lib.macosx-11.1-arm64-cpython-39/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.dylib' (no such file), '/private/var/folders/cd/dfrqgp4s4ll55cwb7rtgccbw0000gq/T/pip-install-rjpuj450/prophet_d7e4cce10e414c89a572fe3605ae9269/build/lib.macosx-11.1-arm64-cpython-39/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.dylib' (no such file), '/usr/local/lib/libtbb.dylib' (no such file), '/usr/lib/libtbb.dylib' (no such file)
I know this has to do with the wrong paths being searched. I can find the dylib in
/Users/{user}/opt/anaconda3/lib/python3.9/site-packages/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/
But, it seems prophet doesn't know to look there. I'm curious how I can update/fix either the rpath variable or find another solution?
I tried to create a symbolic link with sudo ln -s, but don't have permissions on the laptop.
TIA!
I got it to work on Apple Silicon (M1 Max in my case) by installing older versions of both pystan and prophet:
pip install pystan==2.19.1.1
pip install prophet==1.0
The other important piece of the puzzle is that you should use Python 3.8 to get it working.
Installing older versions of the libraries and using Python 3.8 are both talked about in issue #2002 on Github, but there's not really an explanation of the libtbb.dylib error message.

Yocto - Can't build library for host SDK

I've made a custom recipe for a third-party library.
It contains:
BBCLASSEXTEND =+ "native nativesdk"
The recipe builds a static library, depends on virtual/kernel and copies some headers - relatively simple.
I'm trying to install this into the host SDK for cross-compilation, but I'm having some issues.
When I try adding:
TOOLCHAIN_HOST_TASK_append = " nativesdk-<recipe>"
... to local.conf and run bitbake core-image-weston -c populate_sdk, BitBake completes, but the headers and library are absent from the host SDK (for my host's architecture).
When I try adding:
TOOLCHAIN_HOST_TASK_append = " <package>-staticdev"
... I get the following error:
package <package>-staticdev-1.11.0-r0.aarch64 does not have a compatible architecture
Any help would be appreciated.
As you don't need native part of recipe to run something on host (build machine) but target part, you should add the following line to add it to SDK:
TOOLCHAIN_TARGET_TASK_append = " <package>-staticdev <package>-dev"

Unity3D build error CommandInvokationFailure

When I try to build my project I get the following error
Error building Player: CommandInvokationFailure: Failed to recompile android resource files. See the Console for details.
C:\Program Files (x86)\Java\jdk1.7.0_55\bin\javac.exe -bootclasspath "C:/Users/Ryan/Documents/android sdk only/android-sdk-windows/platforms/android-20\android.jar" -d "C:\Users\Ryan\Documents\Game - Android\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "-S\R.java" "com\RyanVitter\Game\R.java"
stderr[
-S\R.java:8: error: <identifier> expected
package -S;
Does anybody know why this error is being thrown?
My team had an error similar to this, while trying to integrate the facebook SDK.
It worked fine on the computer which was used to import the SDK, but once things were added to git and commited, all other computers could not build to android, and the above error was shown in the console.
This was because unity seems also change some files outside of the project folder once the SDK is imported( We imported it through the asset store).
The solution then was to also import the facebook SDK to all other PCs via the asset store, and then do a "git reset --hard", which seemed to set up the unity editor correctly.
After these steps the project could build again.

Not getting TBB to compile test examples

I am not getting TBB to work. I am following the steps in the "Getting started" document.
I am doing the following steps:
downloading the linux files + the sources files.
extracting them in 1 directory
calling make
going to tbb.../bin calling source tbbvars.sh intel64
going to examples/Getting_started/sub_string_finder
calling make
I then get the error:
sub_string_finder.cpp:32:30: fatal error: tbb/parallel_for.h: No such file or directory
I really googled a lot but can't find any related stuff.
I did also try to add some -I statement but it didnt help
I assume it is kind of a including/linking problem but I dont know how to fix.
This is all done on fedora 16 64bit. (kernel 3.1.4) // TBB version 4.0
The solution was to install tbb-devel package.

dlopen() error image not found

I have software that first loads a .dylib lets call libFirst.dylib using the following command:
void* handle = dlopen(path.c_str(), RTLD_LAZY | RTLD_GLOBAL);
Later on inside a function from the loaded libFirst.dylib I attempt to load another .dylib using the same command but for libSecond.dylib, the loading of this shared library gives me the following warnings in my Xcode console:
error warning: Ignored unknown object module at 0x129310 with type 0x8a8399
dlerror: dlopen(/path/libSecond.dylib, 9): Library not loaded: libFirst.dylib
Referenced from: /path/libSecond.dylib
Reason: image not found
What I don't get is that its says libFirst.dylib is not loaded but I am currently inside a function from libFirst.dylib, so how can this be?
All my paths in DYLD_LIBRARY_PATH appear correct too.
Thanks in advance, I have been stuck on this for days.
I ended up using -install_name to change the install name of all my libraries to #rpath/dylibName.dylib and then in Xcode I set the Runpath Search paths using #loader_path to find all my .dylibs that I was using.
use:
install_name_tool -id #executable_path/../Frameworks/mylib.dylib mylib.dylib
then check it with:
otool -D mylib.dylib
I think an easier way to get around this error would be to revert to an earlier version where you were not getting this error. Right click on the project folder and navigate to local history to revert to an earlier version. I verified this to be working on the android studio installed on Mac OS Big sur.