Problem 1877

Summary: Missing XercesC in geant4.sh
Product: Geant4 Reporter: Marko Petric <marko.petric>
Component: cmakeAssignee: Ben Morgan <Ben.Morgan>
Status: CLOSED FIXED    
Severity: trivial    
Priority: P5    
Version: 10.2   
Hardware: All   
OS: All   

Description Marko Petric 2016-07-05 18:19:15 CEST
Hi,
When building Geant4 10.2.2 with external CLHEP and XercesC the resulting geant4.sh does only contain the inclusion CLHEP to third-party binary and library paths but not XercesC. It a bit confusing since the Geant4Config.cmake lists:

set(Geant4_THIRD_PARTY_INCLUDE_DIRS /cvmfs/clicdp.cern.ch/software/Xerces-C/3.1.3/x86_64-slc6-gcc48-opt/include)

and

set(CLHEP_ROOT_DIR "/cvmfs/clicdp.cern.ch/software/CLHEP/2.3.1.1/x86_64-slc6-gcc48-opt")

but the geant4.sh only

      54 #-----------------------------------------------------------------------
      55 # Setup Third-party binary and library paths...
      56 # - CLHEP
      57 
      58 if test "x$LD_LIBRARY_PATH" = "x" ; then
      59   export LD_LIBRARY_PATH=/cvmfs/clicdp.cern.ch/software/CLHEP/2.3.1.1/x86_64-slc6-gcc48-opt/lib
      60 else
      61   export LD_LIBRARY_PATH=/cvmfs/clicdp.cern.ch/software/CLHEP/2.3.1.1/x86_64-slc6-gcc48-opt/lib:${LD_LIBRARY_PATH}
      62 fi

Wouldn't it make sense to include XercesC also at this point?

Cheers,
Marko
Comment 1 Ben Morgan 2016-07-19 14:48:59 CEST
We'll take a look at this.

You can also use RPATHing of the build/install executable to avoid having to set LD_LIBRARY_PATH. In CMake, this is very easy to do:

https://cmake.org/Wiki/CMake_RPATH_handling
https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/
https://cmake.org/cmake/help/v3.3/search.html?q=RPATH&check_keywords=yes&area=default

Other build tools have similar facilities, and at worst it's just a case of setting the appropriate flags to the linker.
Comment 2 Marko Petric 2016-07-19 14:53:04 CEST
Hi,
thank you for looking into this. I don't mean this is really an serious error, but it would be good to have consistent behavior for all external packages. Either geant4.sh initializes all the dependent software or none.
Cheers,
Marko
Comment 3 Ben Morgan 2016-12-14 14:38:50 CET
Fixed in the 10.3 release