Opened 9 years ago

Last modified 6 years ago

#50424 new enhancement

geant4: careful review of Qt5

Reported by: mojca (Mojca Miklavec) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), mkae (Marko Käning)
Port: geant4

Description

I might need some help with "cleaning up" the Qt support in Geant4.

In particular:

  • figure out which Qt5 components are needed
  • figure out which versions of geant4 support Qt5 at all (and potentially remove the variant from older versions)
  • potentially rename +qt into +qt4 and make qt an obsolete variant?
  • make sure that Geant's stdlib is the same as Qt's stdlib
  • provide a reasonable default (qt4 vs qt5) based on the
    • geant4 version
    • OS version
    • default stdlib

Attachments (2)

Portfile.diff (4.0 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 9 years ago.
patch-choose_qt.diff (982 bytes) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 in reply to:  description Changed 9 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to mojca@…:

figure out which Qt5 components are needed

Based upon cmake/Modules/Geant4InterfaceOptions.cmake, the Qt5 module are

  • Qt5Core
  • Qt5Gui
  • Qt5Widgets
  • Qt5OpenGL
  • Qt5PrintSupport

All of which are provided by port:qt5base.

$ port provides Qt5Core.pc Qt5Gui.pc Qt5Widgets.pc Qt5OpenGL.pc Qt5PrintSupport.pc
/opt/local/lib/pkgconfig/Qt5Core.pc is provided by: qt5-qtbase
/opt/local/lib/pkgconfig/Qt5Gui.pc is provided by: qt5-qtbase
/opt/local/lib/pkgconfig/Qt5Widgets.pc is provided by: qt5-qtbase
/opt/local/lib/pkgconfig/Qt5OpenGL.pc is provided by: qt5-qtbase
/opt/local/lib/pkgconfig/Qt5PrintSupport.pc is provided by: qt5-qtbase

figure out which versions of geant4 support Qt5

Prior to version 4.10.2, the comments in cmake/Modules/Geant4InterfaceOptions.cmake state
that Qt4 is required, but the code itself looks for Qt5 before Qt4.
If the code is to be trusted over the comments, all of the geant4 versions support Qt5.

I am submitting a patch for versions prior to 4.10.2 that will force Qt4 to be used if requested.
It is based on the code already in version 4.10.2.

potentially rename +qt into +qt4 and make qt an obsolete variant?
provide a reasonable default (qt4 vs qt5)

Attached is a patch that attempts to do this.

make sure that Geant's stdlib is the same as Qt's stdlib

As was discussed in #50321, I am not sure what the best solution to this is.

A few minor things I noticed:

  • geant4 seems to be depending on zlib without actually using it.
  • geant4 4.10.2 now can use FreeType
  • There was still a reference to 4.9.5 (r145044).

Changed 9 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile.diff added

Changed 9 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: patch-choose_qt.diff added

comment:2 Changed 9 years ago by mojca (Mojca Miklavec)

Thank a lot for these patches. So GEANT4_FORCE_QT4 was introduced in 4.10.2? Thanks a lot for pointing that out.

I need to fix #50426 first and I will consult the upstream about Qt5 compatibility (version 4.9.6 has problem even with Qt4 without the extra patch, so I'm a bit sceptic about its support for Qt5).

I will try to come up with something about default selection between Qt4 and Qt5 (as discussed in #50321). I'm at least a bit inclined to leave the default at Qt4 for older versions of Geant4 and only switch to Qt5 as default for 4.10.2 (and than only for platforms that support it).

Geant4.10.2 already requires C++11, so defaulting to Qt5 makes some sense even on Lion (with libstdc++ as default).

The issues with C++11 on < 10.9 are getting more and more burning & confusing.

comment:3 Changed 8 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:4 Changed 6 years ago by mojca (Mojca Miklavec)

In 18771b648ad21cec8d2de99cc969f0f123694b25/macports-ports (master):

geant4: switch to Qt5 by default

The old Geant4 versions will probably be declared obsolete.
We cut the default at geant4.10.3, but this is not a hard limit.
Older versions did not have a decent support for Qt5,
but I'm not sure since when the support became decent enough
to make it the most reasonable default.

We should also base the decision on macOS version,
but I'm not sure which should be the latest OS to have Qt4 as default.

See: #50424

Note: See TracTickets for help on using tickets.