Qt6.2 for Jetson TX2NX - EGLFS configuration problems
-
Hello!
I'm trying to compile Qt6.2 for Nvidia Jetson TX2NX. I have successfully compiled Qt5.15 but I'm having problems with Qt6 cmake script finding my OpenGL libs.
First of all, weird problem is this - how did it find EGL version 1.5 but is missing HAVE_EGL flag:
-- Could NOT find EGL (missing: HAVE_EGL) (found version "1.5") -- Could NOT find GLESv2 (missing: HAVE_GLESv2 HAVE_GLESv2)
ERROR: The OpenGL functionality tests failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2], QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.
The configure script I'm using is:
../qtbase-everywhere-src-6.2.0/configure -release -device linux-jetson-tx2-g++ -device-option CROSS_COMPILE=/home/matiss/qt6nx/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- -device-option DISTRO_OPTS="hard-float" -opengl es2 -nomake examples -nomake tests -qt-host-path /home/matiss/Qt/6.2.0/gcc_64/ -extprefix /home/matiss/qt6nx/build/ -prefix /usr/local/qt6nx -- -DCMAKE_TOOLCHAIN_FILE=/home/matiss/qt6nx/toolchain.cmake -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=OFF
My qmake.conf for TX2NX is the same I used for Qt5.15 and the sysroot is also the same as when I compiled 5.15.
# # qmake configuration for Jetson TX2 NX boards running 64-bit Linux For Tegra # include(../common/linux_device_pre.conf) QMAKE_INCDIR_POST += \ $$[QT_SYSROOT]/usr/include \ $$[QT_SYSROOT]/usr/include/aarch64-linux-gnu QMAKE_LIBDIR_POST += \ $$[QT_SYSROOT]/usr/lib \ $$[QT_SYSROOT]/lib/aarch64-linux-gnu \ $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu QMAKE_RPATHLINKDIR_POST += \ $$[QT_SYSROOT]/usr/lib \ $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu \ $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu/tegra \ $$[QT_SYSROOT]/lib/aarch64-linux-gnu QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu/tegra-egl DISTRO_OPTS += aarch64 COMPILER_FLAGS += -march=armv8-a+crypto+crc EGLFS_DEVICE_INTEGRATION = eglfs_kms_egldevice include(../common/linux_arm_device_post.conf) load(qt_config)
If it's the problem that I haven't defined
QMAKE_INCDIR_OPENGL[_ES2], QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2]
then I have question - what are the library names I need to find for these defined paths?Any ideas, what could be the issue here? I would understand this problem if it didn't work in 5.15 but it does on that version and doesn't work on the new 6.2. And yes, I did use EGLFS, when compiled 5.15.
Thanks in advance! :)
-
I managed to solve this issue. QMake errors are something old that hasn't been deleted and these variables are not used anymore. I managed to solve this by:
-
Adding this to
toolchain.cmake
file:
set(GLESv2_LIBRARY ${TARGET_SYSROOT}/usr/lib/aarch64-linux-gnu/tegra-egl/libGLESv2_nvidia.so.2)
set(EGL_LIBRARY ${TARGET_SYSROOT}/usr/lib/aarch64-linux-gnu/tegra-egl/libEGL_nvidia.so.0)
set(OPENGL_egl_LIBRARY ${TARGET_SYSROOT}/usr/lib/aarch64-linux-gnu/tegra-egl/libEGL_nvidia.so.0)
I found the library variables by openingCMakeCache.txt
in my build folder. -
Editing FindGLESv2.cmake (commenting out C code and setting
HAVE_GLESv2
to true). Of course then you have to be sure that you are using the correctlibGLESv2
.
# check_cxx_source_compiles(" #ifdef __APPLE__ # include <OpenGLES/ES2/gl.h> #else # define GL_GLEXT_PROTOTYPES # include <GLES2/gl2.h> #endif #int main(int argc, char *argv[]) { # glUniform1f(1, GLfloat(1.0)); # glClear(GL_COLOR_BUFFER_BIT); #}" HAVE_GLESv2) set(HAVE_GLESv2 True)
- Editing FindEGL.cmake just like FindGLESv2.cmake
#check_cxx_source_compiles(" ##include <EGL/egl.h> # #int main(int argc, char *argv[]) { # EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0; # eglDestroyContext(dpy, ctx); #}" HAVE_EGL) set(HAVE_EGL True) cmake_pop_check_state()
-
-
-
Hello, I'm trying to compile Qt6 for cross compile for my jetson orin nano and i'm having some trouble doing it even if Qt5.15 worked perfectly fine.
I xould like to know which toolchain did you used ? What have you put in your toolchain.cmake ? Atucally I follow the wiki qt for cross compiling for raspPI but my compilation was donc on a wrong architecture (x86). Thank you for your help