Message: Re: Getting Xerces dir used by Geant4 into my CMakeLists.txt Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Re: Getting Xerces dir used by Geant4 into my CMakeLists.txt 

Forum: Installation and Configuration
Re: Question Getting Xerces dir used by Geant4 into my CMakeLists.txt (Jeremy McCormick)
Date: 25 Oct, 2016
From: Ben Morgan <Ben Morgan>

On Wed, 19 Oct 2016 00:24:35 GMT, Jeremy McCormick wrote:
> Hi,
> 
> Is it possible within my own CMakeLists.txt file to get the setting of
> XERCESC_ROOT_DIR that was used by Geant4 when it was built?
> 
> I basically want to generate a setup script using a configured
> setup.sh.in script so I would like to get this directory in order to add
> the Xerces lib dir to the LD_LIBRARY_PATH.
> 
> I see that the Xerces include dir is accessible in the string produced
> from:
> 
> ./geant4-config --cflags
> 
> But I'm wondering if this variable is directly available in some way so
> that I can avoid parsing this output to get the Xerces base dir.
> 
> Thanks.
> 
> --Jeremy
> 

At present, this isn't possible. There is a bug fix in progress that will add the lib dir to LD_LIBRARY_PATH, in the geant4.(c)sh scripts. but nothing more than that. If you can use RPATHs, then the comments in that bug report show a way to configure things without needing the dynamic loader path set in the environment (for OS X El Capitan and higher this is the only thing that will work anyway).

In the next development cycle we'll be moving to fully use CMake's Imported Targets (this is to help a long term requirement to make an install of Geant4 relocatable). This will remove absolute paths to locations, and put responsibility on all path configuration to the installer's configuration management system. Whilst this will seem like a loss of functionality, it is the cleanest and widest use case compliant way to do things.

For the use case of XercesC (but applicable to other dependencies), if XERCESC_ROOT_DIR has been fed to a build/install of Geant4, then the process that performed this build/install knows that path. It should thus export that path in the desired format to the desired setup script for Geant4 as part of the custom build/install process of Geant4. Geant4's build scripts cannot know what build/install process (rpm spec, brew formula, spack package, custom script ) nor setup system (custom scripts, modulefiles) is being used, hence pushing the setup onto those systems to deal with exactly as desired.

Cheers,

Ben.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Getting Xerces dir used by Geant4 into my CMakeLists.txt   (Jeremy McCormick - 25 Oct, 2016)
(_ None: Re: Getting Xerces dir used by Geant4 into my CMakeLists.txt   (Ben Morgan - 26 Oct, 2016)
(_ None: Re: Getting Xerces dir used by Geant4 into my CMakeLists.txt   (Jeremy McCormick - 03 Nov, 2016)
 Add Message Add Message
to: "Re: Getting Xerces dir used by Geant4 into my CMakeLists.txt"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]