Software/Geant4/Installation/Qt: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 9: Line 9:
; Website : http://qt-project.org
; Website : http://qt-project.org
; Source URL : http://download.qt.io/official_releases/qt/5.6/5.6.0/submodules/
; Source URL : http://download.qt.io/official_releases/qt/5.6/5.6.0/submodules/
; Installed version : 5.6.0 (13 May 2016)
; Installed Production version : 5.6.0 (13 May 2016)
; Source code : <code>src/geant4-prerequisites/qt/qtbase-opensource-src-5.6.0.tar.gz</code>
; Source code : <code>src/geant4-prerequisites/qt/qtbase-opensource-src-5.6.0.tar.gz</code>
; Installed Development version : 5.8.0 (20 October 2017)
; Central Repository : https://github.com/qt/qt5


== Installation Notes ==
== Installation Notes ==
Line 30: Line 32:
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/qt</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/qt</code>.


The source code should then be extracted into a suitable subdirectory in <code>/unix/pbt/software/build</code>.  The extracted source code directory can only be deleted once the software has been built and installed
The source code should then be extracted into a suitable subdirectory in <code>/unix/pbt/software/build</code>.  The extracted source code directory can only be deleted once the software has been built and installed.


=== Source Code Extraction ===
=== Installation from Central Repository ===
 
After the latest version has been pulled from its [https://github.com/qt/qt5 central repository] and placed within <code>/unix/pbt/software/src/qt</code>, create a build directory within the PBT software directory from which you can compile the code:
 
<pre>
cd /unix/pbt/software/build/
mkdir qt-5.8.0
cd qt-5.8.0
</pre>
 
<code>Qt</code> is then compiled using its <code>/configure</code> script with the following options. '''Note:''' Here, the software is to be installed into the development software directory using the command <code>-prefix /unix/pbt/software/dev/qt-5.8.0</code>. Define this as appropriate for your system.
 
<pre>
../../src/qt/configure -prefix /unix/pbt/software/dev/qt-5.8.0 -verbose -release -opensource -confirm-license -system-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-pcre -nomake tests -nomake examples -pkg-config -c++std c++14 -qt-xcb -fontconfig -system-freetype
</pre>
 
'''Note:''' the installation options used here are specific to <code>Qt v5.8.0</code> and are taken from Ben Morgan's [https://github.com/SuperNEMO-DBD/homebrew-cadfael/blob/master/Formula/qt5-base.rb script]. If installing a different version of <code>Qt</code>, it is likely that the configuration options may need to be different for your system.
 
<code>Qt</code> can then be compiled and installed using the usual commands:
 
<pre>
make
make install
</pre>
 
=== Installation from source code ===
 
==== Source Code Extraction ====


<pre>
<pre>
Line 40: Line 69:
</pre>
</pre>


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


These instructions assume the code has already been built for the '''Development''' environment before building for the '''Production''' environment, so some of the commands for the '''Production''' install are omitted.   
It is possible to build for the '''Production''' environment without deleting the <code>Qt build</code> directory created for the '''Development''' installation, meaning that significant time is saved when running <code>make</code>.   
Although it is highly discouraged to install straight to the '''Production''' environment without first compiling a '''Development''' version, it is possible to do so by adding in the directory creation commands at the start.  
However, it isn't recommended to do so as the '''Production''' installation ends up referencing components within <code>/unix/pbt/software/dev</code> which is not desirable as the two environments are no longer independent. 
As such, these instructions assume one is building from scratch for each environment: to do so, make sure that the <code>build/qt</code> directory is deleted before recreating it for the subsequent build and install.


==== Development Environment ====
Also, although it is possible to install straight to the '''Production''' environment, it is highly discouraged to do so without first compiling a '''Development''' version.
 
===== Development Environment =====


<pre>
<pre>
Line 56: Line 88:
</pre>
</pre>


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


<pre>
<pre>
cd /unix/pbt/software/build/qt/qt-5.6.0
cd /unix/pbt/software/build
mkdir -pv qt/qt-5.6.0
cd qt/qt-5.6.0
../../../src/geant4-prerequisites/qt/qt-5.6.0/configure -prefix /unix/pbt/software/prod-sl6 -release -opensource -confirm-licence -nomake tests -nomake examples -optimized-qmake -opengl -qt-xcb
../../../src/geant4-prerequisites/qt/qt-5.6.0/configure -prefix /unix/pbt/software/prod-sl6 -release -opensource -confirm-licence -nomake tests -nomake examples -optimized-qmake -opengl -qt-xcb
make
make
make install
make install
</pre>
</pre>

Latest revision as of 10:11, 20 October 2017

Introduction

Qt "is a cross-platform application framework that is widely used for developing application software that can be run on various software and hardware platforms with little or no change in the underlying codebase, while still being a native application with the capabilities and speed thereof".

For Geant4, the Qt headers and libraries are required in order to allow visualisation and interaction through the Qt user interface.

Details

Website
http://qt-project.org
Source URL
http://download.qt.io/official_releases/qt/5.6/5.6.0/submodules/
Installed Production version
5.6.0 (13 May 2016)
Source code
src/geant4-prerequisites/qt/qtbase-opensource-src-5.6.0.tar.gz
Installed Development version
5.8.0 (20 October 2017)
Central Repository
https://github.com/qt/qt5

Installation Notes

Geant4 supports Qt 4.6 or higher (Qt 4.8 or higher on Mac).

Qt is available in a number of different versions and with a vast array of submodules. Only the "qtbase" submodule is required to compile all the elements required for Geant4. The various different installer and source code options can be found at: http://www.qt.io/download-open-source/

For installation, Qt does not support installation into a sandbox directory (i.e. there are no options prefix or DESTDIR defined for command make install) and must be given the installation directory with the -prefix option. As such, to recompile Qt for different target directories, the configure script must be rerun with a modified -prefix /path/to/dest option. This has to be managed manually as can be seen in the installation commands below.

The tarball extracts to a rather long folder name. To follow the installation commands below, rename this to src/qt-5.6.0.

Some instructions on the correct package to download and the various compilation flags were provided by Ben Morgan at Warwick, along with this configuration script:

https://github.com/SuperNEMO-DBD/homebrew-cadfael/blob/master/Formula/qt5-base.rb

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/qt.

The source code should then be extracted into a suitable subdirectory in /unix/pbt/software/build. The extracted source code directory can only be deleted once the software has been built and installed.

Installation from Central Repository

After the latest version has been pulled from its central repository and placed within /unix/pbt/software/src/qt, create a build directory within the PBT software directory from which you can compile the code:

cd /unix/pbt/software/build/
mkdir qt-5.8.0
cd qt-5.8.0

Qt is then compiled using its /configure script with the following options. Note: Here, the software is to be installed into the development software directory using the command -prefix /unix/pbt/software/dev/qt-5.8.0. Define this as appropriate for your system.

../../src/qt/configure -prefix /unix/pbt/software/dev/qt-5.8.0 -verbose -release -opensource -confirm-license -system-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-pcre -nomake tests -nomake examples -pkg-config -c++std c++14 -qt-xcb -fontconfig -system-freetype

Note: the installation options used here are specific to Qt v5.8.0 and are taken from Ben Morgan's script. If installing a different version of Qt, it is likely that the configuration options may need to be different for your system.

Qt can then be compiled and installed using the usual commands:

make 
make install

Installation from source code

Source Code Extraction

cd /unix/pbt/software/src/geant4-prerequisites/qt
tar -xvz -f qtbase-opensource-src-5.6.0.tar.gz
mv qtbase-opensource-src-5.6.0 qt-5.6.0

Build And Install

It is possible to build for the Production environment without deleting the Qt build directory created for the Development installation, meaning that significant time is saved when running make. However, it isn't recommended to do so as the Production installation ends up referencing components within /unix/pbt/software/dev which is not desirable as the two environments are no longer independent. As such, these instructions assume one is building from scratch for each environment: to do so, make sure that the build/qt directory is deleted before recreating it for the subsequent build and install.

Also, although it is possible to install straight to the Production environment, it is highly discouraged to do so without first compiling a Development version.

Development Environment
cd /unix/pbt/software/build
mkdir -pv qt/qt-5.6.0
cd qt/qt-5.6.0
../../../src/geant4-prerequisites/qt/qt-5.6.0/configure -prefix /unix/pbt/software/dev/qt-5.6.0 -release -opensource -confirm-licence -nomake tests -nomake examples -optimized-qmake -opengl -qt-xcb
make
make install
Production Environment
cd /unix/pbt/software/build
mkdir -pv qt/qt-5.6.0
cd qt/qt-5.6.0
../../../src/geant4-prerequisites/qt/qt-5.6.0/configure -prefix /unix/pbt/software/prod-sl6 -release -opensource -confirm-licence -nomake tests -nomake examples -optimized-qmake -opengl -qt-xcb
make
make install