12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix• Microsoft Visual Studio development environment.• Parasoft Insure++ run-time debugger and memory checker• Parasoft C++ Test source code analyzer.• Enterprise Architect UML Visual Modeling tool.• Borland Together Visual Modeling <strong>for</strong> Software Architecture Design tool.8. Python InterfacePython is a popular scripting language with an interactive interpreter. <strong>Geant4</strong>Py, a <strong>Geant4</strong>-Python bridge, providesa bridge <strong>for</strong> <strong>Geant4</strong> classes. This enables to directly access <strong>Geant4</strong> classes from Python scripting. User applicationscan be easily configured with many Python third-party modules, such as PyROOT, on the Python software bus.<strong>Geant4</strong>Py is located in the directory environments/g4py/.8.1. Installation8.1.1. Software Requirements<strong>Geant4</strong>Py requires Boost-C++ external library, which helps Python binding of C++ codes. A Precompiled packageis available <strong>for</strong> many Linux distributions (SL, SuSE, Ubuntu, etc) and Mac OSX.<strong>Geant4</strong> libraries can be built as "static" and "granular", where library components (variables, functions, ...) used inthe application are linked statically and shipped with the application. On the other hands, in dynamic binding, thelibrary components are not included in the application, and their binding is carried out at run time. The modularapproach of Python is based on dynamic binding mechanism, so you have <strong>Geant4</strong> shared libraries are requiredinstead.For generic in<strong>for</strong>mation about building <strong>Geant4</strong> libraries, please refer to the Installation <strong>Guide</strong>.Here are some tips <strong>for</strong> manually building "global" and "shared" libraries from an already existing "static + granular"installation. After setting additional environment variables like:Environment Variable Description Value (example)G4LIBG4TMPPath where the <strong>Geant4</strong> libraries areinstalledPath where temporary files areplaced$G4INSTALL/slib$G4INSTALL/tmp-slibG4LIB_BUILD_SHARED Flag <strong>for</strong> building shared libraries 1Table 11. Additional environment variables <strong>for</strong> building global and shared libraryexecute the following:# cd $G4INSTALL/source# make# make globalIn addition, it is required that all header files are installed in a single directory.# cd $G4INSTALL/source# make includesThis will collect all relevant header files in $G4INSTALL/include (or $G4INCLUDE).There are additional tools <strong>for</strong> helping building a <strong>Geant4</strong> library in the directory g4py/tools/.8.1.2. Building <strong>Geant4</strong>Py module<strong>Geant4</strong>Py provides a configure scrtipt <strong>for</strong> building modules.# ./configure --help`configure' configures <strong>Geant4</strong>Py to adapt to many kinds of systems.303

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!