Software/Geant4/Installation/Coin3D: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:


== Details ==
== Details ==
=== <code>Coin3D</code> ===


; Website : https://bitbucket.org/Coin3D/coin/wiki/Home
; Website : https://bitbucket.org/Coin3D/coin/wiki/Home
Line 18: Line 20:
; Installed version : 3.1.3 (13 February 2012)
; Installed version : 3.1.3 (13 February 2012)
; Source tarball : <code>src/geant4-prerequisites/coin3d/Coin3d-3.1.3.tar.gz</code>
; Source tarball : <code>src/geant4-prerequisites/coin3d/Coin3d-3.1.3.tar.gz</code>
=== <code>simage</code> ===
=== <code>SoXt</code> ===
=== <code>SoQt</code> ===


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

Revision as of 14:23, 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

Coin3D

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

simage

SoXt

SoQt

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