Software/Geant4/Installation/CMake

From PBTWiki
Jump to navigation Jump to search

Introduction

CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice..

For Geant4, CMake is used to control the installation process through the generation of CMake makefiles.

Details

Website
https://cmake.org/
Source URL
https://cmake.org/files/v3.5/
Installed version
3.5.2 (16 April 2016)
Source code
src/geant4-prerequisites/cmake/cmake-3.5.2-Linux-x86_64.tar.gz

Installation Notes

Geant4 requires CMake 3.3 or higher.

Unlike most of the other Geant4 prerequisites, CMake comes as precompiled binaries downloaded directly from https://cmake.org/download/ . There are versions available for myriad operating systems, including 32-bit and 64-bit Linux. These instructions show the latter since the UCL HEP Cluster runs 64-bit Scientific Linux.

There are a number of different Zip archive formats available: any of these can be downloaded and extracted into the appropriate location in /unix/pbt/software/src (see instructions below).

Once unpacked, the files need only be moved into the correct target directory. Although files can be moved by hand for the Production environment, it is recommended to use the dev2prod.sh script as part of the automated copying process. Instructions for the former, however, are given below.

Installation

When downloading software, the downloaded tarball (or other Zip archive) should be placed in an appropriately named directory in /unix/pbt/software/src: the instructions below assume that the directory is /unix/pbt/software/src/cmake.

Source Code Extraction

cd /unix/pbt/software/src/geant4-prerequisites/cmake
tar -xvz -f cmake-3.5.2-Linux-x86_64.tar.gz

Build And Install

Although it is discouraged to copy the CMake binaries from the Development to the Production directory — this should be handled by the dev2prod.sh script — instructions for doing so are given below.

Development Environment

cd /unix/pbt/software/src/geant4-prerequisites/cmake
mv -v cmake-3.5.2-Linux-x86_64 /unix/pbt/software/dev/cmake-3.5.2

Production Environment

cd /unix/pbt/software/dev/
cp -av cmake-3.5.2/* /unix/pbt/software/prod/