Software/Geant4/Installation/CMake: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 10: Line 10:
; Website : https://cmake.org/
; Website : https://cmake.org/
; Source URL : https://cmake.org/files/v3.5/
; Source URL : https://cmake.org/files/v3.5/
; Installed version : 3.5.2 (16 April 2016)
; Installed Production version : 3.5.2 (16 April 2016)
; Source code : <code>src/geant4-prerequisites/cmake/cmake-3.5.2-Linux-x86_64.tar.gz</code>
; Source code : <code>src/geant4-prerequisites/cmake/cmake-3.5.2-Linux-x86_64.tar.gz</code>
; Installed Development version : 3.9.4 (20 October 2017)
; Central Repository : https://gitlab.kitware.com/cmake/cmake


== Installation Notes ==
== Installation Notes ==


<code>Geant4</code> requires <code>CMake</code> 3.3 or higher.
<code>Geant4</code> requires <code>CMake</code> 3.3 or higher.
=== Installation from Central Repository ===
The latest version of <code>CMake</code> can be downloaded from its central repository, https://gitlab.kitware.com/cmake/cmake. Once downloaded, a simple bootstrap installation can be used to install the software as outlined below.
=== Installation using precompiled binaries ===


Unlike most of the other <code>Geant4</code> prerequisites, <code>CMake</code> comes as precompiled binaries downloaded directly from https://cmake.org/download/ .   
Unlike most of the other <code>Geant4</code> prerequisites, <code>CMake</code> comes as precompiled binaries downloaded directly from https://cmake.org/download/ .   
Line 31: Line 39:
When downloading software, the downloaded tarball (or other <code>Zip</code> archive) should be placed in an appropriately named directory in <code>/unix/pbt/software/src</code>: the instructions below assume that the directory is <code>/unix/pbt/software/src/cmake</code>.
When downloading software, the downloaded tarball (or other <code>Zip</code> archive) should be placed in an appropriately named directory in <code>/unix/pbt/software/src</code>: the instructions below assume that the directory is <code>/unix/pbt/software/src/cmake</code>.


=== Source Code Extraction ===
=== Installation from central repository ===
 
After the latest version (here v3.9.4) has been pulled from the central repository, create a directory within the build section of the PBT Software directory from which you can compile <code>CMake</code>:
 
<pre>
cd /unix/pbt/software/build/
mkdir cmake-3.9.4
cd cmake-3.9.4
</pre>
 
A simple bootstrap installation is then used to install <code>CMake</code> within the development section of the PBT Software cluster. '''Note:''' The <code>--prefix</code> option defines the installation prefix, i.e. where the software will be installed. In this case, the software is installed to <code>/unix/pbt/software/dev/cmake-3.9.4/</code>.
 
<pre>
../../../src/cmake/bootstrap --prefix=/unix/pbt/software/dev/cmake-3.9.4/
make
make install
</pre>
 
=== Installation from precompiled binaries ===
 
==== Source Code Extraction ====


<pre>
<pre>
Line 38: Line 66:
</pre>
</pre>


=== Build And Install ===
==== Build And Install ====


Although it is discouraged to copy the <code>CMake</code> binaries from the '''Development''' to the '''Production''' directory &mdash; this should be handled by the <code>dev2prod.sh</code> script &mdash; instructions for doing so are given below.
Although it is discouraged to copy the <code>CMake</code> binaries from the '''Development''' to the '''Production''' directory &mdash; this should be handled by the <code>dev2prod.sh</code> script &mdash; instructions for doing so are given below.


==== Development Environment ====
===== Development Environment =====


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


==== Production Environment ====
===== Production Environment =====


<pre>
<pre>
cd /unix/pbt/software/dev/
cd /unix/pbt/software/dev/
cp -av cmake-3.5.2-Linux-x86_64/* /unix/pbt/software/prod/
cp -av cmake-3.5.2/* /unix/pbt/software/prod/
</pre>
</pre>

Latest revision as of 09:37, 20 October 2017

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 Production version
3.5.2 (16 April 2016)
Source code
src/geant4-prerequisites/cmake/cmake-3.5.2-Linux-x86_64.tar.gz
Installed Development version
3.9.4 (20 October 2017)
Central Repository
https://gitlab.kitware.com/cmake/cmake

Installation Notes

Geant4 requires CMake 3.3 or higher.

Installation from Central Repository

The latest version of CMake can be downloaded from its central repository, https://gitlab.kitware.com/cmake/cmake. Once downloaded, a simple bootstrap installation can be used to install the software as outlined below.

Installation using precompiled binaries

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.

Installation from central repository

After the latest version (here v3.9.4) has been pulled from the central repository, create a directory within the build section of the PBT Software directory from which you can compile CMake:

cd /unix/pbt/software/build/
mkdir cmake-3.9.4
cd cmake-3.9.4

A simple bootstrap installation is then used to install CMake within the development section of the PBT Software cluster. Note: The --prefix option defines the installation prefix, i.e. where the software will be installed. In this case, the software is installed to /unix/pbt/software/dev/cmake-3.9.4/.

../../../src/cmake/bootstrap --prefix=/unix/pbt/software/dev/cmake-3.9.4/
make
make install

Installation from precompiled binaries

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/