Compiling the PyOSG wrapper.

Prerequisits and dependencies.

The python wrapper for the Open Scene Graph is currently supported on
the following systems and configurations:

Windows 2K with Microsoft Visual Studio .NET c++ compiler and python2.2
Linux 2.4 with GNU g++ compiler, version 3.2 and python2.2

This version of the PyOSG wrapper is based on the most recent released version
of OSG, version 0.9.4 and the current boost library (version 1.30.0).

For a fully functional setup, you would want to have the Producer library
as well, which coincidentally has a python wrapper too.

Compilation

To compile the PyOSG library, a number environmental variables need to be set:

BOOST_ROOT      should point to the directory where boost is installed, 
PYTHON_ROOT     should point to the toplevel python directory
PYTHON_VERSION  should be set to the python version
OSG_ROOT        should point to the toplevel osg directory, probably /usr/local or the
                directory where it's installed on windows
PRODUCER_ROOT   should point to the toplevel Producer directory


As the Boost compilation process need the BOOST_ROOT, PYTHON_ROOT and PYTHON_VERSION
as well, they are probably set correctly. The only extra variable is OSG_ROOT.

bjam -sBUILD=release
or
bjam -sBUILD=debug

for the debug version

The libraries will be build in the subdirectory bin and have the standard pyd extension 
for python shared libraries.


Install

A setup.py script is supplied with the current distribution. Using setup.py
you are able to create binary distributions for both Linux and Windows. Since
the setup.py script is only used for packing the distribution and not building
the library, only setup.py bdist is supported. As extra options to the script,
you can specify if a debug distribution need to be created. 
For windows call :

python setup.py bdist_wininst debug
or
python setup.py bdist_wininst release

This generates a executable in the dist directory, containing a full functional
windows installer program.

A handy batch file, called build.bat will perform both the compilation
and installer creation.

For linux call :

python setup.py bdist debug
or
python setup.py bdist release

The result is a *.tar.gz file in the dist directory. Check the contents of the
tarball if it is correct for your environment and install it.

Testing

When everything has been installed correctly, you can try to run the demos 
from the interactive python shell:

>>> from PyOSG import Demo
>>> Demo.runexamples()

this will run all ported demos one after each other. 

You will find the source of the demos in the PyOSG/Demo directory, 
which is located under the site-packages directory


When something is not clear, don't hesitate to contact me: gideon@computer.org
