Software/Geant4/Installation/Coin3D: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 57: Line 57:
<code>SoXt</code> may require the following modifications to install correctly:
<code>SoXt</code> may require the following modifications to install correctly:


The configuration tool cannot find the libraries it needs unless the environment variable LD_RUN_PATH is manually set to include <code>/unix/pbt/software/prod-sl6/lib</code> (set automatically by the environment scripts on the [[/Software/Geant4/UCL HEP Cluster|UCL HEP Cluster]]).
* The configuration tool cannot find the libraries it needs unless the environment variable LD_RUN_PATH is manually set to include <code>/unix/pbt/software/prod-sl6/lib</code> (set automatically by the environment scripts on the [[/Software/Geant4/UCL HEP Cluster|UCL HEP Cluster]]).
For older versions of SoXt and SoQt, part of the code required for compilation was removed to a separate project called <code>SoGUI</code>.  This GUI code needed to be incorporated into the library code before compilation.  The <code>SoGUI</code> source code is available in a separate tarball, <code>src/geant4- prerequisites/coin3d/sogui-2011-12-03.tar.gz</code>.  The more recent versions of the <code>Coin3D</code> components now incorporate this code by default.
* For older versions of SoXt and SoQt, part of the code required for compilation was removed to a separate project called <code>SoGUI</code>.  This GUI code needed to be incorporated into the library code before compilation.  The <code>SoGUI</code> source code is available in a separate tarball, <code>src/geant4- prerequisites/coin3d/sogui-2011-12-03.tar.gz</code>.  The more recent versions of the <code>Coin3D</code> components now incorporate this code by default.


== Installation ==
== Installation ==

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

  • The simage library with image format loaders and front-ends to common import libraries. simage is meant for use with applications which read image files as textures. simage must be installed before Coin3D.
  • The SoXt open source InventorXt library, which is a GUI binding for using Open Inventor with Xt/Motif. SoXt has been developed for use with Coin3D. SoXt needs to be installed after Coin3D.
  • SoXt open source Qt GUI component toolkit library for 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

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

SoXt

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

SoQt

Website
https://bitbucket.org/Coin3D/coin/wiki/Home
Source URL
https://bitbucket.org/Coin3D/coin/downloads/SoQt-1.5.0.tar.gz
Installed version
1.5.0 (13 February 2012)
Source tarball
src/geant4-prerequisites/coin3d/SoXt-1.5.0.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.

SoXt may require the following modifications to install correctly:

  • The configuration tool cannot find the libraries it needs unless the environment variable LD_RUN_PATH is manually set to include /unix/pbt/software/prod-sl6/lib (set automatically by the environment scripts on the UCL HEP Cluster).
  • For older versions of SoXt and SoQt, part of the code required for compilation was removed to a separate project called SoGUI. This GUI code needed to be incorporated into the library code before compilation. The SoGUI source code is available in a separate tarball, src/geant4- prerequisites/coin3d/sogui-2011-12-03.tar.gz. The more recent versions of the Coin3D components now incorporate this code by default.

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