bugGNU Octave - Bugs: bug #53278, Cannot build Octave when...

 
 

bug #53278: Cannot build Octave when QOFFSCREENSURFACE is present, but not functional

Submitter:  Avinoam Kalma <avinoam>
Submitted:  Sat 03 Mar 2018 07:31:18 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Avinoam Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 05 Mar 2018 09:57:31 PM UTC, comment #16: 

I pushed the patch here:

http://hg.savannah.gnu.org/hgweb/octave/rev/ae6679369a80

Closing report as fixed.

Pantxo Diribarne <pantxo>
Group Member
Mon 05 Mar 2018 09:51:48 PM UTC, comment #15: 

@Pantxo: I just reviewed the patch and it looks good.  Go ahead and push it and close this report.

Rik <rik5>
Group administrator
Mon 05 Mar 2018 09:41:31 PM UTC, comment #14: 

@Pantxo: Thanks, this patch works for me

Avinoam Kalma <avinoam>
Group Member
Mon 05 Mar 2018 08:33:40 PM UTC, comment #13: 

@Avinoam: Sorry, I had forgotten a few instances of the former variable. I attached an updated patch.


(file #43466)

Pantxo Diribarne <pantxo>
Group Member
Mon 05 Mar 2018 08:01:27 PM UTC, comment #12: 

Now...

Avinoam Kalma <avinoam>
Group Member
Mon 05 Mar 2018 07:46:49 PM UTC, comment #11: 

Not quite...

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 05 Mar 2018 07:40:00 PM UTC, comment #10: 

Now attached

Avinoam Kalma <avinoam>
Group Member
Mon 05 Mar 2018 07:35:06 PM UTC, comment #9: 

Attached my config.log

The patch from comment #8 did not solve my problem


In file included from ../octave/libgui/graphics/Canvas.cc:39:0:
../octave/libgui/graphics/GLCanvas.h:84:20: error: field ‘m_os_context’ has incomplete type ‘QOpenGLContext’
     QOpenGLContext m_os_context;
                    ^
../octave/libgui/graphics/GLCanvas.h:85:5: error: ‘QOffscreenSurface’ does not name a type
     QOffscreenSurface m_os_surface;
     ^
make[1]: *** [libgui/graphics/libgui_graphics_libgui_graphics_la-Canvas.lo] Error 1


Avinoam Kalma <avinoam>
Group Member
Sun 04 Mar 2018 09:03:01 PM UTC, comment #8: 

@Rik: I attached a tentative implementation of what you proposed.

@Avinoam: What is your version of Qt? Could you attach your config.log? I wonder why QOffscreenSurface is not usable.
Could you try the attached patch to see if it correctly disables offscreen rendering when the usability check fails?


(file #43462)

Pantxo Diribarne <pantxo>
Group Member
Sun 04 Mar 2018 06:10:21 PM UTC, comment #7: 

Looking more closely at the macro OCTAVE_CHECK_QT_OPENGL_OFFSCREEN_OK I can see the problem.  The m4 code is


AC_DEFUN([OCTAVE_CHECK_QT_OPENGL_OFFSCREEN_OK], [
  dnl Normally the language and compiler flags would be set and restored
  dnl inside of the AC_CACHE_CHECK body.  Because we also need to check for
  dnl Qt header files associated with the compilation test, set and restore
  dnl these values outside of the AC_CACHE_CHECK for this macro only.
  AC_LANG_PUSH(C++)
  ac_octave_save_CPPFLAGS="$CPPFLAGS"
  ac_octave_save_CXXFLAGS="$CXXFLAGS"
  CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
  CXXFLAGS="$CXXPICFLAG $CXXFLAGS"
  AC_CHECK_HEADERS([QOffscreenSurface])
  AC_CACHE_CHECK([whether Qt supports full offscreen OpenGL rendering],
  ...
  ...


The call to AC_CHECK_HEADERS will define HAVE_QOFFSCREENSURFACE if it is present, but configure still hasn't determined that it is actually usable.  That is the next bit of code.  Therefore, the C++ code can't be checking only for HAVE_QOFFSCREENSURFACE before going ahead with compilation.

Rik <rik5>
Group administrator
Sun 04 Mar 2018 05:57:58 PM UTC, comment #6: 

Adding Pantxo to the CC list.  The trouble seems to be this section of m4/acinclude.m4:


    if test -n "$OPENGL_LIBS"; then
      OCTAVE_CHECK_QT_OPENGL_OK([build_qt_graphics=yes],
        [warn_qt_opengl="Qt does not work with the OpenGL libs (GL and GLU); disabling OpenGL graphics with Qt GUI"])

      if test $build_qt_graphics = yes; then
        OCTAVE_CHECK_QT_OPENGL_OFFSCREEN_OK([have_qt_opengl_offscreen=yes])
        AC_DEFINE(HAVE_QT_GRAPHICS, 1, [Define to 1 if Qt works with OpenGL libs (GL and GLU)])
      fi
    fi


From your configure log, it is possible to have QOFFSCREENSURFACE, but for it not to work in combination with OpenGL.  The m4 macro OCTAVE_CHECK_QT_OPENGL_OFFSCREEN is set up quite traditionally to execute the first code section if the result of tests is true, and the second code section of tests if the result is false.  But the way the macro is invoked, there is only an action for a positive result of the test.

There are multiple ways to resolve this.  One would be to AC_DEFINE some other constant, rather than HAVE_QOFFSCREENSURFACE, when configure passes all tests necessary to use offscreen rendering.  Then the actual C++ code should be modified to test for this constant, rather than HAVE_QOFFSCREENSURFACE which can be present even though not usable.

Also, I would re-order the AC_DEFINE(HAVE_QT_GRAPHICS) to occur before OCTAVE_CHECK_QT_OPENGL_OFFSCREEN_OK.  Having it follow the test makes it look like it is dependent on the results, which it isn't.


Rik <rik5>
Group administrator
Sun 04 Mar 2018 05:54:50 PM UTC, comment #5: 

I am trying to build with Qt5, but maybe there is a mismatch in my Qt5 tree...

Avinoam Kalma <avinoam>
Group Member
Sun 04 Mar 2018 05:35:30 PM UTC, comment #4: 

Are you building with Qt4 or Qt5?

Rik <rik5>
Group administrator
Sun 04 Mar 2018 10:56:51 AM UTC, comment #3: 

Manually adding


#undef HAVE_QOFFSCREENSURFACE


to libgui/graphics/GLCanvas.h fixes the compilation problem,
but according to comment #2 QOffscreenSurface was found.


Avinoam Kalma <avinoam>
Group Member
Sun 04 Mar 2018 10:15:21 AM UTC, comment #2: 

hg id is 7c88cf242111

It is a fresh build using the script:


/bin/rm -r octave octave-build
hg clone http://hg.savannah.gnu.org/hgweb/octave
cd octave
./bootstrap
cd ..
mkdir octave-build
cd octave-build
../octave/configure  --without-osmesa
make


The problem is related to recent changes in off screen rendering. In the configure stage I saw:


checking QOffscreenSurface usability... yes
checking QOffscreenSurface presence... yes
checking for QOffscreenSurface... yes
checking whether Qt supports full offscreen OpenGL rendering... no
checking for the QScintilla library for Qt 5...  no



Avinoam Kalma <avinoam>
Group Member
Sun 04 Mar 2018 12:44:34 AM UTC, comment #1: 

What hg id?  What configure options?  Have you tried 'make distclean' and then re-configuring and re-building?  There have been some major changes to configure.ac recently.

Rik <rik5>
Group administrator
Sat 03 Mar 2018 07:31:18 PM UTC, original submission:  



  CXX      libgui/graphics/libgui_graphics_libgui_graphics_la-Canvas.lo
In file included from ../octave/libgui/graphics/Canvas.cc:39:0:
../octave/libgui/graphics/GLCanvas.h:84:20: error: field ‘m_os_context’ has incomplete type ‘QOpenGLContext’
     QOpenGLContext m_os_context;
                    ^
../octave/libgui/graphics/GLCanvas.h:85:5: error: ‘QOffscreenSurface’ does not name a type
     QOffscreenSurface m_os_surface;
     ^
make[2]: *** [libgui/graphics/libgui_graphics_libgui_graphics_la-Canvas.lo] Error 1


Avinoam Kalma <avinoam>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #43466:  offscreen_check3.patch added by pantxo (4KiB - text/x-patch)
file #43465:  config.7z added by avinoam (76KiB - application/octet-stream)
file #43462:  offscreen_check.patch added by pantxo (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by avinoam (Submitted the item)
  • -email is unavailable- added by avinoam
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-05 pantxo StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2018-03-05 pantxo Attached File- Added offscreen_check3.patch, #43466
    2018-03-05 avinoam Attached File- Added config.7z, #43465
    2018-03-04 pantxo Attached File- Added offscreen_check.patch, #43462
    2018-03-04 rik5 SummaryCannot build Octave Cannot build Octave when QOFFSCREENSURFACE is present, but not functional
    2018-03-04 rik5 StatusWorks For Me In Progress
        Carbon-Copy- Added pantxo
    2018-03-04 rik5 StatusNone Works For Me
    2018-03-03 avinoam Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code