Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-97050

configure errors, failing to enable OpenGL, Direct 2D and DirectWrite

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.2.0
    • Build System: CMake
    • None
    • Debian 11 (Bullseye), x86_64-w64-mingw32
    • Linux/X11, Windows

    Description

      I'm updating from Qt 5.12.11 to Qt 6.2.0 and noticing some sort of a regression. When cross-compiling Qt 6.2.0 with x86_64-w64-mingw32 on Debian 11 (Bullseye), I encountered an issue that Qt 6.2.0's configure (CMake) invocation fails with:

      ERROR: Feature "opengl": Forcing to "ON" breaks its condition:
          QT_FEATURE_opengl_desktop OR QT_FEATURE_opengl_dynamic OR QT_FEATURE_opengles2
      Condition values dump:
          QT_FEATURE_opengl_desktop = "OFF"
          QT_FEATURE_opengl_dynamic = "OFF"
          QT_FEATURE_opengles2 = "OFF"
      
      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 step fails even if you don't specify -opengl desktop for Qt6 and let it default to "dynamic", though in that case it fails with just a single error:

      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.
      

      Here is what Qt6 says about OpenGL support:

        OpenGL:
          Desktop OpenGL ....................... no
          OpenGL ES 2.0 ........................ no
          OpenGL ES 3.0 ........................ no
          OpenGL ES 3.1 ........................ no
          OpenGL ES 3.2 ........................ no
      

      while Qt5 on the same machine says:

        OpenGL:
          ANGLE ................................ no
          Desktop OpenGL ....................... yes
          Dynamic OpenGL ....................... no
          OpenGL ES 2.0 ........................ no
          OpenGL ES 3.0 ........................ no
          OpenGL ES 3.1 ........................ no
          OpenGL ES 3.2 ........................ no
      

      This error obviously fails the configure step.

      As a side note, I have also noticed that Qt6 doesn't enable Direct 2D and DirectWrite when Qt5 did, and for some reason Qt6 does enable VNC and LinuxFB. Enabling LinuxFB for a Windows build sounds a bit weird.

      Qt6:

      QPA backends:
        DirectFB ............................... no
        EGLFS .................................. no
        EGLFS details:
          EGLFS OpenWFD ........................ no
          EGLFS i.Mx6 .......................... no
          EGLFS i.Mx6 Wayland .................. no
          EGLFS RCAR ........................... no
          EGLFS EGLDevice ...................... no
          EGLFS GBM ............................ no
          EGLFS VSP2 ........................... no
          EGLFS Mali ........................... no
          EGLFS Raspberry Pi ................... no
          EGLFS X11 ............................ no
        LinuxFB ................................ yes
        VNC .................................... yes
        VK_KHR_display ......................... no
        QNX:
          lgmon ................................ no
          IMF .................................. no
        XCB:
          Using system-provided xcb-xinput ..... no
          GL integrations:
            GLX Plugin ......................... no
              XCB GLX .......................... no
            EGL-X11 Plugin ..................... no
        Windows:
          Direct 2D ............................ no
          Direct 2D 1.1 ........................ no
          DirectWrite .......................... no
          DirectWrite 3 ........................ no
      

      Qt5:

      QPA backends:
        DirectFB ............................... no
        EGLFS .................................. no
        LinuxFB ................................ no
        VNC .................................... no
        Mir client ............................. no
        Windows:
          Direct 2D ............................ yes
          DirectWrite .......................... yes
          DirectWrite 2 ........................ yes
      

      The Direct 2D and DirectWrite feature tests look about the same in Qt5 and Qt6, so it's odd that they pass in Qt5 but not in Qt6 on the same system. The headers and library files for those are present:

      # find / -name '*dwrite*' | grep -v '/tmp/qtbase'
      /usr/share/mingw-w64/include/dwrite_1.h
      /usr/share/mingw-w64/include/dwrite_2.h
      /usr/share/mingw-w64/include/dwrite.h
      /usr/share/mingw-w64/include/dwrite_3.h
      /usr/share/mingw-w64/include/mfreadwrite.h
      /usr/x86_64-w64-mingw32/include/dwrite_1.h
      /usr/x86_64-w64-mingw32/include/dwrite_2.h
      /usr/x86_64-w64-mingw32/include/dwrite.h
      /usr/x86_64-w64-mingw32/include/dwrite_3.h
      /usr/x86_64-w64-mingw32/include/mfreadwrite.h
      /usr/x86_64-w64-mingw32/lib/libmfreadwrite.a
      /usr/x86_64-w64-mingw32/lib/libdwrite.a
      
      # find / -name '*d2d1*' | grep -v '/tmp/qtbase'
      /usr/share/mingw-w64/include/d2d1helper.h
      /usr/share/mingw-w64/include/d2d1effectauthor.h
      /usr/share/mingw-w64/include/d2d1.h
      /usr/share/mingw-w64/include/d2d1effecthelpers.h
      /usr/share/mingw-w64/include/d2d1_1.h
      /usr/share/mingw-w64/include/d2d1effects.h
      /usr/share/mingw-w64/include/d2d1_1helper.h
      /usr/x86_64-w64-mingw32/include/d2d1helper.h
      /usr/x86_64-w64-mingw32/include/d2d1effectauthor.h
      /usr/x86_64-w64-mingw32/include/d2d1.h
      /usr/x86_64-w64-mingw32/include/d2d1effecthelpers.h
      /usr/x86_64-w64-mingw32/include/d2d1_1.h
      /usr/x86_64-w64-mingw32/include/d2d1effects.h
      /usr/x86_64-w64-mingw32/include/d2d1_1helper.h
      /usr/x86_64-w64-mingw32/lib/libd2d1.a
      

      To reproduce the regression, you can run:

      sudo docker run --rm -it debian:bullseye-slim /bin/bash
      apt-get update
      apt-get upgrade -y
      apt-get install -y gcc g++ libc-dev cmake make xz-utils libtool pkg-config wget gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
      cd /tmp
      wget https://download.qt.io/archive/qt/5.12/5.12.11/submodules/qtbase-everywhere-src-5.12.11.tar.xz
      tar xf qtbase-everywhere-src-5.12.11.tar.xz
      cd qtbase-everywhere-src-5.12.11
      ./configure -prefix /tmp/qt5-build \
        -release \
        -shared \
        -device-option CROSS_COMPILE=x86_64-w64-mingw32- \
        -xplatform win32-g++ \
        -opensource -confirm-license \
        -pch \
        -nomake examples \
        -nomake tools \
        -nomake tests \
        -no-dbus \
        -no-icu \
        -qt-libjpeg \
        -qt-libpng \
        -qt-zlib \
        -qt-pcre \
        -opengl desktop
      cd /tmp
      wget https://download.qt.io/archive/qt/6.2/6.2.0/submodules/qtbase-everywhere-src-6.2.0.tar.xz
      tar xf qtbase-everywhere-src-6.2.0.tar.xz
      cd qtbase-everywhere-src-6.2.0
      ./configure -prefix /tmp/qt6-build \
        -release \
        -shared \
        -device-option CROSS_COMPILE=x86_64-w64-mingw32- \
        -xplatform win32-g++ \
        -opensource -confirm-license \
        -pch \
        -nomake examples \
        -nomake tools \
        -nomake tests \
        -no-dbus \
        -no-icu \
        -qt-libjpeg \
        -qt-libpng \
        -qt-zlib \
        -qt-pcre \
        -opengl desktop
      find / -name '*dwrite*' | grep -v '/tmp/qtbase'
      find / -name '*d2d1*' | grep -v '/tmp/qtbase'
      

      Observe how Qt5 configures without issues but Qt6 errors and doesn't enable Direct 2D and DirectWrite.

      The full outputs of Qt5 and Qt6 configure from the steps above are attached.

      Attachments

        1. qt5-configure-output.txt
          9 kB
          nurupo
        2. qt6-configure-output.txt
          51 kB
          nurupo
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            nurupo nurupo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes