Software/Geant4/Installation/Coin3D
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 beforeCoin3D
.SoXt
: needs to be installed afterCoin3D
.SoQt
: needs to be installed afterCoin3D
.
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
- There are a number of programming errors in the Coin3D code. Most can be ignored and skipped over by adding the compiler flag
fpermissive
at the configuration step. - One error needs to be fixed in the source code - the file
src/fonts/freetype.cpp
needs two lines inserted before the line#include fonts/freetype.h
:#include <cstdlib>
#include <cmath>
This fix needs to be carried out (manually) using thenano
editor, if the exact installation commands below are being used.
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.
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 directorysrc/fonts/
and open the filesrc/fonts/freetype.cpp
.
• Insert the following two lines in src/fonts/freetype.cpp
before the line #include fonts/freetype.h
:
#include <cstdlib>
- include <cmath>
This fix needs to be carried out (manually) using the nano editor, if the exact installation commands below are being used.
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.
Build simage
cd /unix/pbt/software/build nano ../src/Coin-3.1.3/src/fonts/freetype.cpp ../src/Coin-3.1.3/configure --prefix=/unix/pbt/software/dev CXXFLAGS=-fpermissive make make install prefix=/unix/pbt/software/dev/stow/coin-3.1.3
Stow commands:
cd /unix/pbt/software/dev/stow stow coin-3.1.3
Development Environment: image
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