Software/Geant4/Installation/Xerces-C: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
(Created page with "== Introduction == <code>Xerces-C++</code> is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read ...")
 
 
(4 intermediate revisions by 3 users not shown)
Line 9: Line 9:
; Website : http://xerces.apache.org/xerces-c/
; Website : http://xerces.apache.org/xerces-c/
; Source URL : http://www.apache.org/dist/xerces/c/3/sources/
; Source URL : http://www.apache.org/dist/xerces/c/3/sources/
; Installed version : 3.1.3 (17 Feb 2016)
; Installed Production version : 3.1.3 (17 Feb 2016)
; Source code : <code>src/geant4-prerequisites/xerces-c/xerces-c-3.1.3.tar.gz</code>
; Source code : <code>src/geant4-prerequisites/xerces-c/xerces-c-3.1.3.tar.gz</code>
; Installed Development version : 3.2.0 (20 October 2017)
; Central Repository : https://github.com/apache/xerces-c


== Installation Notes ==
== Installation Notes ==
Line 27: Line 29:
The extracted source code directory can only be deleted once the software has been built and installed.
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/apache/xerces-c central repository] and placed within /unix/pbt/software/src/xerces-c, create a build directory within the PBT software directory from which you can compile the code:
 
<pre>
cd /unix/pbt/software/build/
mkdir xerces-c
cd xerces-c
</pre>
 
<code>CMake</code> can then be used to configure and install <code>Xerces-C</code>.
 
<pre>
cmake ../../src/xerces-c
ccmake .
</pre>
 
The command <code>ccmake .</code> opens an interactive GUI that can be used to specify installation options. From within this you can define your installation directory and configure any other options as required. On the PBT cluster it is required that the software is installed to the development directory, and so the <code>CMAKE_INSTALL_PREFIX</code> is defined as follows:
 
<pre>
CMAKE_INSTALL_PREFIX      /unix/pbt/software/dev/xerces-c-3.2
</pre>
 
*''c'' to configure
*''g'' to generate and exit
 
The software can then be installed using the usual commands:
 
<pre>
make
make install
</pre>
 
=== Installation from source code ===
 
==== Source Code Extraction ====


<pre>
<pre>
Line 34: Line 71:
</pre>
</pre>


=== Build And Install ===
==== Build And Install ====
 
It is possible to build for the '''Production''' environment without deleting the <code>Xerces-C build</code> directory created for the '''Development''' installation, meaning that significant time is saved when running <code>make</code>. 
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.


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


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


<pre>
<pre>
Line 45: Line 85:
mkdir -pv xerces-c/xerces-c-3.1.3
mkdir -pv xerces-c/xerces-c-3.1.3
cd xerces-c/xerces-c-3.1.3
cd xerces-c/xerces-c-3.1.3
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure -prefix /unix/pbt/software/dev/xerces-c-3.1.3
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure --prefix /unix/pbt/software/dev/xerces-c-3.1.3
make
make
make install
make install
</pre>
</pre>


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


<pre>
<pre>
cd /unix/pbt/software/build/xerces-c/xerces-c-3.1.3
cd /unix/pbt/software/build
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure -prefix /unix/pbt/software/dev/xerces-c-3.1.3
mkdir -pv xerces-c/xerces-c-3.1.3
cd xerces-c/xerces-c-3.1.3
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure --prefix /unix/pbt/software/prod-sl6
make
make
make install
make install
</pre>
</pre>

Latest revision as of 10:49, 20 October 2017

Introduction

Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data.

Geant4 requires the Xerces-C++ headers and libraries compiled against the C++11 standard in order to provide support for GDML geometry descriptions.

Details

Website
http://xerces.apache.org/xerces-c/
Source URL
http://www.apache.org/dist/xerces/c/3/sources/
Installed Production version
3.1.3 (17 Feb 2016)
Source code
src/geant4-prerequisites/xerces-c/xerces-c-3.1.3.tar.gz
Installed Development version
3.2.0 (20 October 2017)
Central Repository
https://github.com/apache/xerces-c

Installation Notes

The Xerces-C++ website provides some useful instructions on Building and Installing Xerces-C++.

For installation, Xerces-C++ 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 Xerces-C++ 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.

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/geant4-prerequisites/xerces-c.

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/xerces-c, create a build directory within the PBT software directory from which you can compile the code:

cd /unix/pbt/software/build/
mkdir xerces-c
cd xerces-c

CMake can then be used to configure and install Xerces-C.

cmake ../../src/xerces-c
ccmake .

The command ccmake . opens an interactive GUI that can be used to specify installation options. From within this you can define your installation directory and configure any other options as required. On the PBT cluster it is required that the software is installed to the development directory, and so the CMAKE_INSTALL_PREFIX is defined as follows:

CMAKE_INSTALL_PREFIX       /unix/pbt/software/dev/xerces-c-3.2
  • c to configure
  • g to generate and exit

The software can then be installed using the usual commands:

make 
make install

Installation from source code

Source Code Extraction

cd /unix/pbt/software/src/geant4-prerequisites/xerces-c
tar -xvz -f xerces-c-3.1.3.tar.gz

Build And Install

It is possible to build for the Production environment without deleting the Xerces-C 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 xerces-c/xerces-c-3.1.3
cd xerces-c/xerces-c-3.1.3
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure --prefix /unix/pbt/software/dev/xerces-c-3.1.3
make
make install
Production Environment
cd /unix/pbt/software/build
mkdir -pv xerces-c/xerces-c-3.1.3
cd xerces-c/xerces-c-3.1.3
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure --prefix /unix/pbt/software/prod-sl6
make
make install