New Cmake-based builds

Location(s):

new Geant4 build procedure, with cmake. An outline of this build procedure is available in the G4 installation guide at

http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch02.html#sect.UnixBuildAndInstall

There are several differences (most should be advantages):

  • the source code does NOT get copied into the build area;
  • you specify the install location, and it creates configuration scripts which use this location;
  • you specify the location of data files, and it will inform you which ones are missing (optionally it can download them too).

To redo the build from scratch you should:

  • rm CMakeCache.txt # This is memory of the configuration, and must be removed if you change OS, gcc version, or had a problem
  • source config-cmake.[c]sh # A file which I created to set up gcc, choose a compatible cmake and run with options I chose
  • gmake -jX # X is the number of threads to use for compiling. This creates the 'global' libraries in one go.

(Note: When using the GNUmakefile only (not cmake) it was not possible to build global libraries using several processes. First you had to do "gmake -jX" which build the granular libraries in parallel; then after that do "gmake global" to make the global libraries.)

Example configuration files for config-cmake.[c]sh can be found at /afs/cern.ch/atlas/project/geant4/builds/geant4.9.6.cand01.atlas01.x86_64-slc5-gcc43-opt

You can change the configuration by running "ccmake ." Note the dot "." which means use the same directory for the source code as before.

You can use this to tailor the installation to includes any Geant4 options ( visualization, persistency, UI etc).

In order to make this repeatable, you need to extract the name of the relevant variable, and add it to the config file (with the -DVariable=Value syntax.)

Note: rerunning cmake (or ccmake) without removing the cache file will remember all previous variables set. So

  cmake -DVarA=ValA /directory/to/source
  cmake -DVarB=ValB .  
will result in a configuration in which both VarA and VarB are set.

We discussed the details on November 23rd. The notes of these discussions contain the issues and needs required.

-- JohnApostolakis - 04-Dec-2012

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2012-12-04 - JohnApostolakis
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback