Problem 1250

Summary: wrong build of OpenInventor driver in 9.5 beta
Product: Geant4 Reporter: Alexey <alexey.radkov>
Component: configAssignee: John.Allison
Status: RESOLVED FIXED    
Severity: trivial CC: Gabriele.Cosmo, Koichi.Murakami
Priority: P5    
Version: other   
Hardware: All   
OS: All   

Description Alexey 2011-09-18 21:16:28 CEST
The problem occurs in new 9.5 beta version.

source/interfaces/common/GNUmakefile no more contains line
include $(G4INSTALL)/config/G4VIS_BUILD.gmk

now for specific config i get libG4interfaces.so unusable by libG4OpenInventor.so.
This triggers when G4UI_BUILD_XM_SESSION and G4UI_BUILD_XAW_SESSION are not set but G4VIS_BUILD_OIX_DRIVER is set. All these settings define G4INTY_BUILD_XT = 1. Now that line "include $(G4INSTALL)/config/G4VIS_BUILD.gmk" is missing, value of G4INTY_BUILD_XT is 0 but it must be 1 when built with OIX driver!

Build of Geant4 completes fine but when i compile an app that uses libG4OpenInvetor.so i get linkage error complaining about undefined reference to G4Xt::getInstance(), which is not surpising because source/interfaces/common/src/G4Xt.cc was compiled with G4INTY_BUILD_XT = 0 and therefore contains no symbols.

Quick fix: add line "include $(G4INSTALL)/config/G4VIS_BUILD.gmk" to source/interfaces/common/GNUmakefile (but i do not know if it can lead to other errors) or (what i did when compiled) comment line

#if defined(G4INTY_BUILD_XT) || defined(G4INTY_USE_XT)

and corresponding

#endif

in files source/interfaces/common/src/G4Xt.cc and source/interfaces/common/include/G4Xt.hh
Comment 1 John.Allison 2011-09-24 15:49:55 CEST
This is understood.  A fix will be included in release 9.5.

Both OIX and Xm in visualisation need Xt in interfaces.  Often, this is not a problem since the user builds Xt anyway.  But if not, it must be forced.  The following lines in G4UI_BUILD.gmk do it:

# Special case: if OPENGLXM vis driver requested, G4Xt must be built.
ifdef G4VIS_BUILD_OPENGLXM_DRIVER
  G4INTY_BUILD_XT = 1
endif

# Special case: if OIX vis driver requested, G4Xt must be built.
ifdef G4VIS_BUILD_OIX_DRIVER
  G4INTY_BUILD_XT  = 1
endif

This introduces a sort of dependence between vis and interfaces, but it cannot be helped.