Opened 12 years ago

Closed 12 years ago

#32472 closed defect (wontfix)

Root compiles with qt4-mac but does not work

Reported by: martin.zeman@… Owned by: cjones051073 (Chris Jones)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: mattiafrancescomoro@…
Port: root

Description (last modified by mf2k (Frank Schima))

Dear all,

I was able to compile the root package with qt_mac variant on my qt4-mac port. However after turning on the QtRoot layer I get the following errors:

Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetLineCap: invalid context 0x0 
Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetLineWidth: invalid context 0x0 
Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetLineJoin: invalid context 0x0 
Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetLineDash: invalid context 0x0 
Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetStrokeColorWithColor: invalid context 0x0 
Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetFillColorWithColor: invalid context 0x0 
Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetLineCap: invalid context 0x0 
Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetLineWidth: invalid context 0x0 
Dec 9 13:23:01 valhalla root.exe[29444] <Error>: CGContextSetLineJoin: invalid context 0x0 ...

My system is Lion 10.7.2, which I assume is the problem. I tried to completely remove my MacPorts installation and do this from scratch, did not help, the problem stays the same, ROOT version is 5.32/00 (newest). Do this to completely reproduce my setup:

sudo port install python27
sudo port select --set python python27
sudo port install qt4-mac
sudo port install py27-pyqt4
sudo port install pythia
sudo port install root +python27 +qt_mac +ssl +xml +gsl +minuit2 +tmva +roofit +pythia

Modify .rootrc to call the QtRoot layer:

# GUI specific settings
Gui.Backend: qt
Gui.Factory:qt
# Qt GUI style setting
Gui.Style: macintosh

Call Root enviroment setup

. /Ports/bin/thisroot.sh

Start ROOT:

root

Call any Root GUI class:

TCanvas t

You should get the some invalid context errors. If you need me to provide anything else, please let me know.

Thanks for any help,

Martin

Attachments (1)

QtRoot.txt (3.1 MB) - added by martin.zeman@… 12 years ago.
Result of sudo port -v install root +qt_mac

Change History (16)

comment:1 Changed 12 years ago by martin.zeman@…

Apologies, there is a formatting error in the .rootrc posted here. Just put in: Gui.Backend: qt Gui.Factory:qt Gui.Style: macintosh

comment:2 Changed 12 years ago by mf2k (Frank Schima)

Cc: mattiafrancescomoro@… added
Description: modified (diff)
Keywords: root qtroot qt_mac removed
Owner: changed from macports-tickets@… to jonesc@…

comment:3 Changed 12 years ago by cjones051073 (Chris Jones)

To be honest, I've never had much luck with the QT support in root at all, on any platform, not just OSX.

Thanks for the report though, if I ever have time I'll take a look, but don't hold your breath for a fix any time soon. I suggest you just don't use qt for the moment.

Chris

comment:4 Changed 12 years ago by martin.zeman@…

Yes, I heard it is problematic, but I would welcome improved ROOT GUI really. Should I write to the QtROOT BNL group?

comment:5 Changed 12 years ago by cjones051073 (Chris Jones)

you could try. another option would be the cern root mailing list.

comment:6 in reply to:  description Changed 12 years ago by macports@…

Replying to martin.zeman@…:

I've answered this via https://lists.bnl.gov/pipermail/qt-root-l/2011-December/000542.html Please, try to follow http://root.bnl.gov/QtRoot/How2Install4Unix.html The right place to get the QtRoot support is https://lists.bnl.gov/pipermail/qt-root-l/ or The project repository is http://sourceforge.net/projects/qtroot/ Thank you.

Valeri

comment:7 in reply to:  3 Changed 12 years ago by macports@…

Replying to jonesc@…: Hi Chris

To be honest, I've never had much luck with the QT support in root at all, on any platform, not just OSX.

I would appreciate if you could elaborate (via https://lists.bnl.gov/mailman/listinfo/qt-root-l list ;-) what your problems were and whether they persist

comment:8 Changed 12 years ago by martin.zeman@…

Dear Valeri,

thank you for answering. I will attempt manual installation using the guide you linked so we can be sure whether the problem is caused by MacPorts package installation or not. I will also have a look at what I might have missed using the MacPorts package installation and report on both threads. It will take a few days ...

For the record I have attempted the same using Root 5.30 and I had the same problem. It is very strange since Root runs, it even loads and opens the window (TCanvas, TBrowser), it is however missing any controls and does not respond to commands. I am using the qt_mac (not the qt x11). Also PyQt and PyRoot seem to be working for me without any issues, however it is still the X11 ROOT GUI being called, once I turn on the qt backend in .rootrc errors appear. We will see what John replies ...

Cheers,

Martin

comment:9 Changed 12 years ago by cjones051073 (Chris Jones)

The instructions you link to look rather long winded. Also it seems QtRoot is a separate project to root ? Is QT support not baked into the root code itself ?

The script http://root.bnl.gov/QtRoot/INSTALL_QTROOT.sh also doesn't really look appropriate as is for MacPorts, as it downloads and builds projects itself. It would need translating into MacPorts port files system, so it depends on the MacPorts provides Qt, coin etc.

I'll happy help where I can getting this working, but I don't really have time to push this forward myself.

Chris

comment:10 Changed 12 years ago by martin.zeman@…

Hi Chris,

I think Valeri does not officially support MacPorts for this issue? Still I am also confused, I thought that QtRoot was incorporated into normal root distribution to be turned on by a flag during configuration. Just out of curiosity I just tried running INSTALL_QTROOT.sh and I get the following errors:

cint/reflex/src/Class.cxx: In member function ‘virtual Reflex::Object Reflex::Class::CastObject(const Reflex::Type&, const Reflex::Object&) const’:
cint/reflex/src/Class.cxx:98: error: ‘__dynamic_cast’ is not a member of ‘abi’
make: *** [cint/reflex/src/Class.o] Error 1
make: *** Waiting for unfinished jobs....
rm core/utils/src/RStl_tmp.cxx core/utils/src/rootcint_tmp.cxx

I can try enforcing gcc46 instead of Apple compiler?

Cheers,

Martin

comment:12 Changed 12 years ago by cjones051073 (Chris Jones)

Valeri doesn't need to support MacPorts (nor would I expect him to).

In its simplest form, MacPorts is just an automated systems for build code. In the case of root it just runs

./configure --various-options
make
make install

Of course, the devil is in the details of what options are enabled. To see this, just install the port with the -v option

sudo port -v install root +qt_mac

Maybe something wrong can be spotted there.

This just builds root against the Mac (Aqua) QT4 installation. The same one is used by a lot of ports, including an entire KDE4 ecosystem, that work fine, so I think there is most probably nothing wrong with the QT4 MacPorts provides.

Personally, I'm only interested in getting QT working in the above way, with whatever comes with the root tar ball itself. If QtRoot is a separate project, someone else will have to step up and provide the Portfile for that...

Chris

comment:13 Changed 12 years ago by martin.zeman@…

sudo port -v install root +qt_mac compiled and installed:

root @5.32.00_1+graphviz+gsl+minuit2+opengl+qt_mac+roofit+soversion+ssl+tmva+xml (active)

Running it with qt backend shows the same problem:

Dec 12 17:52:45 Valhalla.local root.exe[65634] <Error>: CGContextSetTextPosition: invalid context 0x0
Dec 12 17:52:45 Valhalla.local root.exe[65634] <Error>: CGContextShowGlyphsWithAdvances: invalid context 0x0
Dec 12 17:52:45 Valhalla.local root.exe[65634] <Error>: CGContextSetTextMatrix: invalid context 0x0
Dec 12 17:52:45 Valhalla.local root.exe[65634] <Error>: CGContextSetShouldAntialias: invalid context 0x0
Dec 12 17:52:45 Valhalla.local root.exe[65634] <Error>: CGContextSetLineCap: invalid context 0x0
Dec 12 17:52:45 Valhalla.local root.exe[65634] <Error>: CGContextSetLineWidth: invalid context 0x0

Attaching the logfile to this ticket.

Martin

Changed 12 years ago by martin.zeman@…

Attachment: QtRoot.txt added

Result of sudo port -v install root +qt_mac

comment:14 in reply to:  9 ; Changed 12 years ago by fine@…

Replying to jonesc@…:

The instructions you link to look rather long winded. Also it seems QtRoot is a separate project to root ? Is QT support not baked into the root code itself ?

The QtRoot support is baked into the root code for the X11 platform only.

For the other platforms (Windows / Mac "native") one should use the http://root.bnl.gov/QtRoot/How2Install4Unix.html . The problem for the Mac is that I have no Mac machine myself. I can not respond quickly to the reports coming from Mac users . I have to forward it to some QtRoot Mac users and rely on their feedback and support.

Another thing to consider. Due lack of demand the scope of QtRoot project was limited by the ROOT-based Qt application. I.e. the applications creating the QApplication Qt instance rather TApplication instance of ROOT. The bunch of such applications are included into the QtRoot distribution and available from http://qtroot.svn.sourceforge.net/viewvc/qtroot/trunk/qtExamples/

That means you can create the Qt application and populate your Qt GUI with ROOT TCanvas/TPad -like graphics and some other ROOT-aware GUI components from QtRootGui package (that is not a part of the root distribution) . This is what 100% of the QtRoot users want. The inverse approach is possible but it is not tested thoroughly. Roughly say, you may not add the Qt widget-based object to your ROOT GUI-based (TG-ROOT classes based ) application and I do not see anybody who wants / needs it.

In the other words it is not recommended to mix Qt and ROOT GUI within one application. The code may work bit it will be not "stable " for sure. TCanvas is not regarded as ROOT GUI. Speaking ROOT GUI one means the "usual" GUI components like slider, menu, button, combo boxes etc.

From this stand point it useless to test QtRoot installation using root.exe application. One should use http://root.bnl.gov/QtRoot/How2Install4Unix.html#testqtroot instead.

Hope it helps.

Thank you.

comment:15 in reply to:  14 Changed 12 years ago by fine@…

Replying to fine@…:

One should see the https://savannah.cern.ch/bugs/?94032 also

Replying to jonesc@…:

The instructions you link to look rather long winded. Also it seems QtRoot is a separate project to root ? Is QT support not baked into the root code itself ?

The QtRoot support is baked into the root code for the X11 platform only.

For the other platforms (Windows / Mac "native") one should use the http://root.bnl.gov/QtRoot/How2Install4Unix.html . The problem for the Mac is that I have no Mac machine myself. I can not respond quickly to the reports coming from Mac users . I have to forward it to some QtRoot Mac users and rely on their feedback and support.

Another thing to consider. Due lack of demand the scope of QtRoot project was limited by the ROOT-based Qt application. I.e. the applications creating the QApplication Qt instance rather TApplication instance of ROOT. The bunch of such applications are included into the QtRoot distribution and available from http://qtroot.svn.sourceforge.net/viewvc/qtroot/trunk/qtExamples/

That means you can create the Qt application and populate your Qt GUI with ROOT TCanvas/TPad -like graphics and some other ROOT-aware GUI components from QtRootGui package (that is not a part of the root distribution) . This is what 100% of the QtRoot users want. The inverse approach is possible but it is not tested thoroughly. Roughly say, you may not add the Qt widget-based object to your ROOT GUI-based (TG-ROOT classes based ) application and I do not see anybody who wants / needs it.

In the other words it is not recommended to mix Qt and ROOT GUI within one application. The code may work bit it will be not "stable " for sure. TCanvas is not regarded as ROOT GUI. Speaking ROOT GUI one means the "usual" GUI components like slider, menu, button, combo boxes etc.

From this stand point it useless to test QtRoot installation using root.exe application. One should use http://root.bnl.gov/QtRoot/How2Install4Unix.html#testqtroot instead.

Hope it helps.

Thank you.

comment:16 Changed 12 years ago by jmroot (Joshua Root)

Resolution: wontfix
Status: newclosed

The Qt variants have been disabled in r94791.

Note: See TracTickets for help on using tickets.