Message: Re: Problem building geant4.9.5.b01 with Qt using CMake Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Re: Problem building geant4.9.5.b01 with Qt using CMake 

Forum: Installation and Configuration
Re: Question Problem building geant4.9.5.b01 with Qt using CMake (Zach Hartwig)
Re: Feedback Re: Problem building geant4.9.5.b01 with Qt using CMake (Ben Morgan)
Re: Agree Re: Problem building geant4.9.5.b01 with Qt using CMake (Zach Hartwig)
Date: 18 Jul, 2011
From: Ben Morgan <Ben Morgan>

Hi Zach,

On Mon, 18 Jul 2011 14:31:45 GMT, Zach Hartwig wrote:
> A minor question: I have several scripts that I use often which depend
> on the G4INSTALL environmental variable, which formerly pointed to the
> top-level Geant4 directory (i.e., the first directory available after
> unpacking the geant4.X.X.tgz source code). I notice that CMake configure
> script sets this variable to point to (for example on my machine):
>   G4INSTALL=/home/hartwig/scratch/geant4/geant4.9.5.b01/share/Geant4-9.5.0
> While this is inconvenient, it's certainly not a show-stopper. I was
> just curous if this was by design and other environmental variables will
> depend on this value for G4INSTALL (Doesn't seem to be the case but you
> never know)? Or if I can modify this environmental variable to point
> where I want it to without breaking anything.

This setting of G4INSTALL is by design - the aim being to provide a bridge between the 'old style' directory structure expected by the GNUmakefile system and the newer CMake based build, which aims to use standard locations for installing things.

The PREFIX/share/Geant4-9.5.0 directory simply has the config directory installed into it. The makefile fragments in config are then able to find each other via G4INSTALL. The headers and libraries are found because the environment setup scripts set the G4INCLUDE and G4LIB variables explicitly. Unfortunately, this means you can't modify the value of G4INSTALL if you are using the Geant4 makefile system, because the fragments will no longer be able to find each other correctly.

Apart from config, there shouldn't be anything under the geant4.9.5.b01 source directory that is needed to compile applications. Therefore you shouldn't, in general, rely on G4INSTALL for application building except to locate makefile fragments. That being said, you may have a different use case here, and I don't know what your scripts do!

If you absolutely, positively have to have G4INSTALL pointing to the unpacked geant4.9.5.b01 directory, then you can use the 'build tree' of Geant4 directly, without installing it. For example, if you did

$ pwd
$ tar -zxf /tmp/geant4.9.5.b01.tar.gz
$ mkdir geant4.9.5.b01-build
$ ls
geant4.9.5.b01  geant4.9.5.b01-build
$ cd geant4.9.5.b01-build
$ cmake  ../geant4.9.5.b01
$ make

you'll see that the directory where you build Geant4, (i.e. the 'build tree') geant4.9.5.b01-build, contains the scripts geant4-environment-setup.(c)sh. If you source one of these scripts, G4INSTALL will point to /somewhere/geant4.9.5.b01, the 'source tree'.

However, please note that this pattern of building/using Geant4 is generally for developers of Geant4 itself, or those integrating Geant4 into another CMake based project. Whilst the 'build tree' will give you a working version of the toolkit, it's fragile against any change to the build or source trees, so the majority of use cases should prefer to install Geant4.

So in general you should prefer modifying your script away from using G4INSTALL rather than use the 'build tree' pattern. However, if you feel you have a use case that warrants it, let us know and we can consider options.



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

1 Ok: Re: Problem building geant4.9.5.b01 with Qt using CMake   (Zach Hartwig - 18 Jul, 2011)
 Add Message Add Message
to: "Re: Problem building geant4.9.5.b01 with Qt using CMake"

 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 ]