Problem 1285

Summary: Allow local install of data libraries using the GEANT4_INSTALL_DATA option
Product: Geant4 Reporter: Iwan Cornelius <iwancornelius>
Component: cmakeAssignee: Ben Morgan <Ben.Morgan>
Status: CLOSED FIXED    
Severity: enhancement CC: kelsey
Priority: P1    
Version: 9.5   
Hardware: All   
OS: All   

Description Iwan Cornelius 2012-01-28 04:34:34 CET
Hello,

Just a minor inconvenience with the installation process of geant4.9.5:
- I am installing Geant4.9.5 on a machine that does not have network access.  I try to use the GEANT4_INSTALL_DATA cmake option however the install process fails. 
- With Geant4 < 9.4 it was possible to specify a local directory in which the data libraries reside. Unfortunately with Geant4.9.5 this is not the case
- It would be great if this was also possible in the next patch of Geant4.9.5 as not every machine will have network access, for one reason or another. 

Best Regards, 
Iwan
Comment 1 Michael Kelsey 2012-07-13 17:09:44 CEST
In 9.5.p01, cmake/Modules/Geant4InstallData.cmake fills GEANT4_INSTALL_DATADIR to specify the location where the data files should be downloaded.

If the user attempts to set this parameter directly, e.g., 

  cmake -DGEANT4_INSTALL_DATADIR=/path/to/G4data ../g4.9.5.p01

it will be ignored, and none of the data-related environment variables will be set.

If the user sets _both_ this parameter and the download flag, e.g.,

  cmake -DGEANT4_INSTALL_DATA=ON -DGEANT4_INSTALL_DATADIR=/path/to/G4data ../g4.9.5.p01

the envvars will be set, of course.  But that also requires that CMake/Make does the download itself (which it will do even if the user has already unpacked the data files!).

It would be nice if the first option (above) worked as the original poster requested, and as a naive user might expect:  look in that directory for the expected data directories (as already known to CMake), and if they are found, set the corresponding envvar in geant4make.csh/sh.
Comment 2 Ben Morgan 2012-09-07 17:19:57 CEST
Selection of a custom install directory for data is complete.

The check for pre-installed data is being worked on. This will be in Release 9.6
Comment 3 Ben Morgan 2012-09-14 09:11:57 CEST
Marking as high priority for 9.6 release
Comment 4 Ben Morgan 2012-11-02 15:48:17 CET
Fixed in tag cmake-V09-05-61 using the following logic (using Mike's example):

  cmake -DGEANT4_INSTALL_DATADIR=/path/to/G4data ../g4.9.5.p01

Will check for the required datasets under /path/to/G4data. If they exist - defined as the presence of the expected dataset directory - they will be reused. If one or more do not exist, the configuration will set up the environment to assume they will be there at some point in the future - and a warning/advice message will be emitted informing the user which datasets are missing, and how to install them. This will not stop configuration or break a build.

If the GEANT4_INSTALL_DATA option is set:

  cmake -DGEANT4_INSTALL_DATA=ON -DGEANT4_INSTALL_DATADIR=/path/to/G4data ../g4.9.5.p01

then the same logic as above is applied, but CMake will add automatic download and install of any missing datasets to /path/to/G4data.

Cheers,

Ben.