Software/Geant4/Installation/Coin3D: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
(Created page with "== Introduction == <code>Coin3D</code> is a high-level, retained-mode toolkit for effective 3D graphics development. It is API compatible with Open Inventor 2.1. <code>Geant4<...")
 
No edit summary
Line 20: Line 20:


== Installation Notes ==
== Installation Notes ==
* There are a number of programming errors in the Coin3D code. Most can be ignored and skipped over by adding the compiler flag <code>fpermissive</code> at the configuration step.
* One error needs to be fixed in the source code - the file <code>src/fonts/freetype.cpp</code> needs two lines inserted before the line <code>#include fonts/freetype.h</code>: <code>#include &lt;cstdlib&gt;</code> <code>#include &lt;cmath&gt;</code> This fix needs to be carried out (manually) using the <code>nano</code> editor, if the exact installation commands below are being used.


The [https://bitbucket.org/Coin3D/coin/wiki/How%20to%20build%20Coin3D%20and%20SIM%20Voleon <code>Coin3D</code> documentation] provides some useful instructions on building and installing <code>Coin3D</code>.
The [https://bitbucket.org/Coin3D/coin/wiki/How%20to%20build%20Coin3D%20and%20SIM%20Voleon <code>Coin3D</code> documentation] provides some useful instructions on building and installing <code>Coin3D</code>.
Line 29: Line 26:
As such, to recompile <code>Coin3D</code> for different target directories, the <code>configure</code> script must be rerun with a modified <code>-prefix /path/to/dest</code> option.   
As such, to recompile <code>Coin3D</code> for different target directories, the <code>configure</code> script must be rerun with a modified <code>-prefix /path/to/dest</code> option.   
This has to be managed manually as can be seen in the installation commands below.
This has to be managed manually as can be seen in the installation commands below.
<code>Coin3D</code> and each of the components contain a number of programming errors. 
Most can be ignored and skipped over by adding the compiler flag <code>-fpermissive</code> at the configuration step.
However, there is an error in the <code>Coin3D</code> source code that needs to be fixed before the code will compile: details on how to do so are given below.


== Installation ==
== Installation ==
Line 57: Line 59:


* In the <code>Coin3D</code> source directory, find the directory <code>src/fonts/</code> and open the file <code>src/fonts/freetype.cpp</code>.
* In the <code>Coin3D</code> source directory, find the directory <code>src/fonts/</code> and open the file <code>src/fonts/freetype.cpp</code>.
Insert the following two lines in <code>src/fonts/freetype.cpp</code> before the line <code>#include fonts/freetype.h</code>:
* Insert the following two lines in <code>src/fonts/freetype.cpp</code> before the line <code>#include fonts/freetype.h</code>:
** <code><nowiki>#include <cstdlib></nowiki></code>
** <code><nowiki>#include <cstdlib></nowiki></code>
#include <cmath>
** <code><nowiki>#include <cmath></nowiki></code>
This fix needs to be carried out (manually) using the nano editor, if the exact installation commands below are being used.
 
The code should now compile successfully.


=== Build And Install ===
=== Build And Install ===
Line 70: Line 73:
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.  
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.  


==== Build <code>simage</code> ====
==== Development Environment: <code>simage</code> ====
 
<pre>
cd /unix/pbt/software/build
mkdir -pv coin3d/simage-1.7.0
cd coin3d/simage-1.7.0
../../../src/geant4-prerequisites/coin3d/simage-1.7.0/configure -prefix /unix/pbt/software/dev/simage-1.7.0 CXXFLAGS=-fpermissive
make
make install
</pre>
 
==== Development Environment: <code>Coin3D</code> ====
 
<pre>
cd /unix/pbt/software/build
mkdir -pv coin3d/Coin-3.1.3
cd coin3d/Coin-3.1.3
../../../src/geant4-prerequisites/coin3d/Coin-3.1.3/configure -prefix /unix/pbt/software/dev/Coin-3.1.3 CXXFLAGS=-fpermissive
make
make install
</pre>
 
==== Development Environment: <code>SoXt</code> ====
 
<pre>
cd /unix/pbt/software/build
mkdir -pv coin3d/SoXt-1.3.0
cd coin3d/SoXt-1.3.0
../../../src/geant4-prerequisites/coin3d/SoXt-1.3.0/configure -prefix /unix/pbt/software/dev/SoXt-1.3.0 CXXFLAGS=-fpermissive
make
make install
</pre>
 
==== Development Environment: <code>SoXt</code> ====


<pre>
<pre>
cd /unix/pbt/software/build
cd /unix/pbt/software/build
nano ../src/Coin-3.1.3/src/fonts/freetype.cpp
mkdir -pv coin3d/SoQt-1.5.0
../src/Coin-3.1.3/configure --prefix=/unix/pbt/software/dev CXXFLAGS=-fpermissive
cd coin3d/SoQt-1.5.0
../../../src/geant4-prerequisites/coin3d/SoQt-1.5.0/configure -prefix /unix/pbt/software/dev/SoQt-1.5.0 CXXFLAGS=-fpermissive
make
make
make install prefix=/unix/pbt/software/dev/stow/coin-3.1.3
make install
</pre>
</pre>


Stow commands:
==== Production Environment: <code>simage</code> ====


<pre>
<pre>
cd /unix/pbt/software/dev/stow
cd /unix/pbt/software/build
stow coin-3.1.3
mkdir -pv coin3d/simage-1.7.0
cd coin3d/simage-1.7.0
../../../src/geant4-prerequisites/coin3d/simage-1.7.0/configure -prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive
make
make install
</pre>
 
==== Production Environment: <code>Coin3D</code> ====
 
<pre>
cd /unix/pbt/software/build
mkdir -pv coin3d/Coin-3.1.3
cd coin3d/Coin-3.1.3
../../../src/geant4-prerequisites/coin3d/Coin-3.1.3/configure -prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive
make
make install
</pre>
</pre>


==== Development Environment: <code>image</code> ====
==== Production Environment: <code>SoXt</code> ====


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


==== Production Environment ====
==== Production Environment: <code>SoQt</code> ====


<pre>
<pre>
cd /unix/pbt/software/build
cd /unix/pbt/software/build
mkdir -pv xerces-c/xerces-c-3.1.3
mkdir -pv coin3d/SoQt-1.5.0
cd xerces-c/xerces-c-3.1.3
cd coin3d/SoQt-1.5.0
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure -prefix /unix/pbt/software/prod-sl6
../../../src/geant4-prerequisites/coin3d/SoQt-1.5.0/configure -prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive
make
make
make install
make install
</pre>
</pre>

Revision as of 14:22, 26 May 2016

Introduction

Coin3D is a high-level, retained-mode toolkit for effective 3D graphics development. It is API compatible with Open Inventor 2.1.

Geant4 requires the Coin3D headers and libraries in order to provide support for Open Inventor visualisations.

In order to function correctly, Coin3D requires the following additional components to be installed:

  • simage: must be installed before Coin3D.
  • SoXt: needs to be installed after Coin3D.
  • SoQt: needs to be installed after Coin3D.

Details

Website
https://bitbucket.org/Coin3D/coin/wiki/Home
Source URL
https://bitbucket.org/Coin3D/coin/downloads
Installed version
3.1.3 (13 February 2012)
Source tarball
src/geant4-prerequisites/coin3d/Coin3d-3.1.3.tar.gz

Installation Notes

The Coin3D documentation provides some useful instructions on building and installing Coin3D.

For installation, Coin3D and the required libraries do 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 Coin3D 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.

Coin3D and each of the components contain a number of programming errors. Most can be ignored and skipped over by adding the compiler flag -fpermissive at the configuration step.

However, there is an error in the Coin3D source code that needs to be fixed before the code will compile: details on how to do so 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/geant4-prerequisites/coin3d.

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.

Instructions are given for compiling each component of Coin3D: these must be followed in order.

Source Code Extraction

cd /unix/pbt/software/src/geant4-prerequisites/coin3d
tar -xvz -f simage-1.7.0.tar.gz
tar -xvz -f Coin-3.1.3.tar.gz
tar -xvz -f SoXt-1.3.0.tar.gz
tar -xvz -f SoQt-1.5.0.tar.gz

Fix Errors In Coin3D Code

Coin3D and each of the components contain a number of programming errors. Most can be ignored and skipped over by adding the compiler flag -fpermissive at the configuration step.

However, there is an error in the Coin3D source code that needs to be fixed before the code will compile:

  • In the Coin3D source directory, find the directory src/fonts/ and open the file src/fonts/freetype.cpp.
  • Insert the following two lines in src/fonts/freetype.cpp before the line #include fonts/freetype.h:
    • #include <cstdlib>
    • #include <cmath>

The code should now compile successfully.

Build And Install

It is possible to build for the Production environment without deleting the Coin3D 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/coin3d 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: simage

cd /unix/pbt/software/build
mkdir -pv coin3d/simage-1.7.0
cd coin3d/simage-1.7.0
../../../src/geant4-prerequisites/coin3d/simage-1.7.0/configure -prefix /unix/pbt/software/dev/simage-1.7.0 CXXFLAGS=-fpermissive
make
make install

Development Environment: Coin3D

cd /unix/pbt/software/build
mkdir -pv coin3d/Coin-3.1.3
cd coin3d/Coin-3.1.3
../../../src/geant4-prerequisites/coin3d/Coin-3.1.3/configure -prefix /unix/pbt/software/dev/Coin-3.1.3 CXXFLAGS=-fpermissive
make
make install

Development Environment: SoXt

cd /unix/pbt/software/build
mkdir -pv coin3d/SoXt-1.3.0
cd coin3d/SoXt-1.3.0
../../../src/geant4-prerequisites/coin3d/SoXt-1.3.0/configure -prefix /unix/pbt/software/dev/SoXt-1.3.0 CXXFLAGS=-fpermissive
make
make install

Development Environment: SoXt

cd /unix/pbt/software/build
mkdir -pv coin3d/SoQt-1.5.0
cd coin3d/SoQt-1.5.0
../../../src/geant4-prerequisites/coin3d/SoQt-1.5.0/configure -prefix /unix/pbt/software/dev/SoQt-1.5.0 CXXFLAGS=-fpermissive
make
make install

Production Environment: simage

cd /unix/pbt/software/build
mkdir -pv coin3d/simage-1.7.0
cd coin3d/simage-1.7.0
../../../src/geant4-prerequisites/coin3d/simage-1.7.0/configure -prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive
make
make install

Production Environment: Coin3D

cd /unix/pbt/software/build
mkdir -pv coin3d/Coin-3.1.3
cd coin3d/Coin-3.1.3
../../../src/geant4-prerequisites/coin3d/Coin-3.1.3/configure -prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive
make
make install

Production Environment: SoXt

cd /unix/pbt/software/build
mkdir -pv coin3d/SoXt-1.3.0
cd coin3d/SoXt-1.3.0
../../../src/geant4-prerequisites/coin3d/SoXt-1.3.0/configure -prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive
make
make install

Production Environment: SoQt

cd /unix/pbt/software/build
mkdir -pv coin3d/SoQt-1.5.0
cd coin3d/SoQt-1.5.0
../../../src/geant4-prerequisites/coin3d/SoQt-1.5.0/configure -prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive
make
make install