Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#58226 closed defect (fixed)

octave @5.1.0_0+accelerate+app+docs+gfortran+graphicsmagick+qt5+sound+sundials --- Compiler error issue with qt5's "posF"

Reported by: SenileFelineS Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: lion x86_64 Cc:
Port: octave

Description (last modified by SenileFelineS)

I'm trying to install octave (see title) with the qt56 dependency.

I received two errors caused by the same issue of not recognizing 'posF':

(Error 1)

  CXX      libgui/graphics/__init_qt___la-ToolBar.lo
libgui/graphics/Canvas.cc:398:57: error: no member named 'posF' in 'QMouseEvent'; did you mean 'pos'?
            bool rect_contains_pos = r.contains (event->posF ());
                                                        ^~~~
                                                        pos
/opt/local/libexec/qt5/include/QtGui/qevent.h:115:19: note: 'pos' declared here
    inline QPoint pos() const { return l.toPoint(); }
                  ^

(Error 2)

libgui/graphics/Canvas.cc:452:61: error: no member named 'posF' in 'QMouseEvent'; did you mean 'pos'?
                bool rect_contains_pos = r.contains (event->posF ());
                                                            ^~~~
                                                            pos
/opt/local/libexec/qt5/include/QtGui/qevent.h:115:19: note: 'pos' declared here
    inline QPoint pos() const { return l.toPoint(); }
                  ^

These two errors both reference the qt5 library file /opt/local/libexec/qt5/include/QtGui/qevent.h:115:19 which does in fact make reference to posF() as the following:

#if QT_DEPRECATED_SINCE(5, 0)
    QT_DEPRECATED inline QPointF posF() const { return l; }
#endif

However, I have no idea if that matters.................I'm guessing it actually doesn't.

I've attached both the build main.log and the qt5 qevent.h files.

Thank you.

Update I have reopened this as Octave gui fails to work even though the installation process seems to work with the patch. (See comment 11 below.)

Update 2 After doing some internet sleuthing, apparently when switching between different versions of octave that are built with different versions of Qt (i.e. qt4 vs. qt5), the file ~/.config/octave/qt-settings cannot exist when switching from one version of Qt to another. The solution is to take the current file ~/.config/octave/qt-settings and rename it to something like qt-settings_qt-old to force Octave to re-create the qt-settings file for the current Qt-based gui. Then, if you ever want to switch back to the previous Qt-based gui, you can rename you're old qt-settings_qt-old file back to qt-settings. Just make sure you don't delete the other qt-settings file.

Attachments (4)

qevent.h (30.5 KB) - added by SenileFelineS 19 months ago.
The qt5 file that defines pos() but apparently not posF()
main.log (3.2 MB) - added by SenileFelineS 19 months ago.
Build log
config.log (2.8 MB) - added by SenileFelineS 19 months ago.
Config.log attached. There were a number of errors generated.
Octave_qt56_Features_Test.txt (4.4 KB) - added by SenileFelineS 19 months ago.
Edited from https://gitlab.com/snippets/1834909 --- Shows what each version *should* look like. Qt5.6 *should* be similar to Qt5.5 and Qt5.7. X's indicate that test failed (result=no) in the config.log that is attached.

Change History (23)

Changed 19 months ago by SenileFelineS

Attachment: qevent.h added

The qt5 file that defines pos() but apparently not posF()

Changed 19 months ago by SenileFelineS

Attachment: main.log added

Build log

comment:1 Changed 19 months ago by SenileFelineS

Description: modified (diff)

comment:2 Changed 19 months ago by Schamschula (Marius Schamschula)

Keywords: lion, x86_64lion x86_64
Owner: set to MarcusCalhoun-Lopez
Port: octave added
Status: newassigned

comment:3 Changed 19 months ago by SenileFelineS

Attempted the same installation of octave but with qt55 instead of qt56. Same error produced. Qt versions greater than qt56 are not compatible with my OS (10.7 Lion).

Changed 19 months ago by SenileFelineS

Attachment: config.log added

Config.log attached. There were a number of errors generated.

Changed 19 months ago by SenileFelineS

Edited from https://gitlab.com/snippets/1834909 --- Shows what each version *should* look like. Qt5.6 *should* be similar to Qt5.5 and Qt5.7. X's indicate that test failed (result=no) in the config.log that is attached.

comment:5 in reply to:  4 Changed 19 months ago by SenileFelineS

Replying to kencu:

This might be useful <https://stackoverflow.com/questions/25622952/how-enable-deprecated-functions-in-qt5>.

I did this, just a minute ago, but I had to hard-code "QT_DISABLE_DEPRECATED_BEFORE=0" into the configure executable script. I couldn't find a .pro project file.

Anyway, the result was that it looks like it moved past the error of posF(), but ran into another one:

  CXXLD    libgui/graphics/__init_qt__.la
  CXXLD    src/octave-gui
ld: framework not found QtOpenGL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libgui/graphics/__init_qt__.la] Error 1

This issue, I'm guessing may have to do with Qt56 (on my 10.7 Lion system). See my attached config.log and the Octave_qt56_Features_Test.txt​. The features with "X" in front of them could not be found.

Last edited 19 months ago by SenileFelineS (previous) (diff)

comment:6 Changed 19 months ago by kencu (Ken)

OK, progress anyway. The framework is there. Just have to make the linker find it somehow:

$ port provides /opt/local/libexec/qt5/lib/QtOpenGL.framework/Versions/5/Headers/QGL
/opt/local/libexec/qt5/lib/QtOpenGL.framework/Versions/5/Headers/QGL is provided by: qt56-qtbase

comment:7 in reply to:  6 Changed 19 months ago by SenileFelineS

Replying to kencu:

OK, progress anyway. The framework is there. Just have to make the linker find it somehow:

$ port provides /opt/local/libexec/qt5/lib/QtOpenGL.framework/Versions/5/Headers/QGL
/opt/local/libexec/qt5/lib/QtOpenGL.framework/Versions/5/Headers/QGL is provided by: qt56-qtbase

I get the same result as you.

I made an interesting discovery:

Running sudo port configure octave +'my_variants...' will result in a config.log file showing configure:73917: checking for QMouseEvent::localPos to have a result of configure:73972: result: no. When I try to install with this default configuration, I get the posF() error.

However, when I cd to the Octave work directory where there is a configure executable and run the configure executable with the option --disable-readline (it halts before finishing if I don't...), suddenly configure:73917: checking for QMouseEvent::localPos has a result of configure:73972: result: yes !! Then when I try to install octave with this configuration, I don't get the posF() error that I first reported in this ticket. Instead I get the error I mentioned two comments ago, ld: framework not found QtOpenGL !!!

(Side note: this hacked configuration causes a different set of errors from the compiler).

I guess the takeaway from this is that something is altering the configuration beyond the configure executable file. And it is the source of the localPos/posF() errors.

Last edited 19 months ago by SenileFelineS (previous) (diff)

comment:8 Changed 19 months ago by kencu (Ken)

You are indeed learning all the tricks and troubles that we face trying to make these ports work on all the different configurations of systems that we try to run them on. We're close on this one -- with a little more effort, I think we can come up with the solution to this. Octave qt5 will most likely be workable on 10.7 with some further efforts...

In the meantime, Octave qt4 is working on 10.7.

comment:9 in reply to:  8 Changed 19 months ago by SenileFelineS

Replying to kencu:

You are indeed learning all the tricks and troubles that we face trying to make these ports work on all the different configurations of systems that we try to run them on. We're close on this one -- with a little more effort, I think we can come up with the solution to this. Octave qt5 will most likely be workable on 10.7 with some further efforts...

In the meantime, Octave qt4 is working on 10.7.

You're very right, Octave qt4 works, although I have some errors/issues with the gui. Perhaps I should make a ticket for that as well?

Also, is there any way to find documentation on Octave's installation process? Or is it down to combing through the configure and make files? The big question I'm trying to figure out is if this is a Macports issue or an Octave issue.

Last edited 19 months ago by SenileFelineS (previous) (diff)

comment:10 Changed 19 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: assignedclosed

In d92681c5c7c487dc858059c9d17cedc06634c718/macports-ports (master):

octave: fix CXXFLAGS when testing for Qt5 properties

No revbump since port either builds correctly or not at all.
Fixes #58226

comment:11 in reply to:  10 ; Changed 19 months ago by SenileFelineS

Replying to MarcusCalhoun-Lopez:

In d92681c5c7c487dc858059c9d17cedc06634c718/macports-ports (master):

octave: fix CXXFLAGS when testing for Qt5 properties

No revbump since port either builds correctly or not at all.
Fixes #58226

Hi Marcus,

Thank you for the update. Just out of curiosity, what did you change?

Also, I just did a clean install of octave. (there were some warnings but it didn't halt the installation). However, when I try to launch Octave with the GUI (command: octave --gui "$@"), Octave hangs/freezes and never loads. Could this have anything to do with the Carbon framework?...Just a shot in the dark - I noticed from compilation that it was mentioned in some of the verbose stdout (using: 'port install octave...').

*Update 2* (same as above)

After doing some internet sleuthing, apparently when switching between different versions of octave that are built with different versions of Qt (i.e. qt4 vs. qt5), the file ~/.config/octave/qt-settings cannot exist when switching from one version of Qt to another. The solution is to take the current file ~/.config/octave/qt-settings and rename it to something like qt-settings_qt-old to force Octave to re-create the qt-settings file for the current Qt-based gui. Then, if you ever want to switch back to the previous Qt-based gui, you can rename you're old qt-settings_qt-old file back to qt-settings. Just make sure you don't delete the other qt-settings file.

Question Does the port octave_select take care of this issue? For some reason octave_select doesn't register that I even have an installed version of octave. The only option is none (active).

Last edited 19 months ago by SenileFelineS (previous) (diff)

comment:12 Changed 19 months ago by SenileFelineS

Description: modified (diff)
Resolution: fixed
Status: closedreopened

comment:13 Changed 19 months ago by SenileFelineS

Description: modified (diff)

comment:14 Changed 19 months ago by SenileFelineS

Description: modified (diff)

comment:15 in reply to:  11 ; Changed 19 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to SenileFelineS:

Replying to MarcusCalhoun-Lopez:

In d92681c5c7c487dc858059c9d17cedc06634c718/macports-ports (master):

octave: fix CXXFLAGS when testing for Qt5 properties

No revbump since port either builds correctly or not at all.
Fixes #58226

Hi Marcus,

Thank you for the update. Just out of curiosity, what did you change?

CXXFLAGS were not being passed to the compiler when testing for Qt features.
For older systems, this meant that the C++11 flags (e.g. -stdlib=...) were not being used, and Qt features were not detected (incorrectly).
I can only imagine this is a typo upstream because CXXPICFLAG are included twice.
I need to follow-up upstream, but I have not quite found the time.

comment:16 in reply to:  11 Changed 19 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to SenileFelineS:

Question Does the port octave_select take care of this issue? For some reason octave_select doesn't register that I even have an installed version of octave. The only option is none (active).

You raise a good point.
However, it is a little off-topic for this ticket.
To answer you question, however, octave_select is a remnant from a time when there were multiple Octave ports.
It needs to be removed.
To be honest, I forgot it still existed.

comment:17 in reply to:  11 ; Changed 19 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: reopenedclosed

Replying to SenileFelineS:

Also, I just did a clean install of octave. (there were some warnings but it didn't halt the installation). However, when I try to launch Octave with the GUI (command: octave --gui "$@"), Octave hangs/freezes and never loads. Could this have anything to do with the Carbon framework?...Just a shot in the dark - I noticed from compilation that it was mentioned in some of the verbose stdout (using: 'port install octave...').

A a general rule, a ticket should deal with only one issue.
A new issue warrants a new ticket.

After doing some internet sleuthing, apparently when switching between different versions of octave that are built with different versions of Qt (i.e. qt4 vs. qt5), the file ~/.config/octave/qt-settings cannot exist when switching from one version of Qt to another.

I am glad you found a solution.
Thank you for passing it along.

comment:18 in reply to:  15 Changed 19 months ago by SenileFelineS

Replying to MarcusCalhoun-Lopez:

Replying to SenileFelineS:

Replying to MarcusCalhoun-Lopez:

In d92681c5c7c487dc858059c9d17cedc06634c718/macports-ports (master):

octave: fix CXXFLAGS when testing for Qt5 properties

No revbump since port either builds correctly or not at all.
Fixes #58226

Hi Marcus,

Thank you for the update. Just out of curiosity, what did you change?

CXXFLAGS were not being passed to the compiler when testing for Qt features.
For older systems, this meant that the C++11 flags (e.g. -stdlib=...) were not being used, and Qt features were not detected (incorrectly).
I can only imagine this is a typo upstream because CXXPICFLAG are included twice.
I need to follow-up upstream, but I have not quite found the time.

Is there any direction you could give me so that I could look for the issue within Octave's building process? Would it be a matter of combing through the configure file or another related file?

Last edited 19 months ago by SenileFelineS (previous) (diff)

comment:19 in reply to:  17 Changed 19 months ago by SenileFelineS

Replying to MarcusCalhoun-Lopez:

Replying to SenileFelineS:

Also, I just did a clean install of octave. (there were some warnings but it didn't halt the installation). However, when I try to launch Octave with the GUI (command: octave --gui "$@"), Octave hangs/freezes and never loads. Could this have anything to do with the Carbon framework?...Just a shot in the dark - I noticed from compilation that it was mentioned in some of the verbose stdout (using: 'port install octave...').

A a general rule, a ticket should deal with only one issue.
A new issue warrants a new ticket.

After doing some internet sleuthing, apparently when switching between different versions of octave that are built with different versions of Qt (i.e. qt4 vs. qt5), the file ~/.config/octave/qt-settings cannot exist when switching from one version of Qt to another.

I am glad you found a solution.
Thank you for passing it along.

Understood. I thought the issues were related, when in reality they weren't. When in doubt, I'll make a new ticket. Which brings me to (hopefully) my last question. Essestially, I'm having issues with both the qt4 and qt5 guis on my system (OS X 10.7). Should I create a new ticket to describe the issues in both qt4 and qt5 builds of Octave (the issues appear different)? Or would this be more of an issue worth reporting to https://savannah.gnu.org/bugs/?group=octave ? Is trac.macports.org more geared towards installation issues?

Last edited 19 months ago by SenileFelineS (previous) (diff)
Note: See TracTickets for help on using tickets.