- Category: Windows
- Published on 06 February 2013
- Written by openscenegraph
- Hits: 2935
The following assumes that the OpenSceneGraph and its dependencies (OpenThreads, Producer, and optionally gdal) have been downloaded, either from CVS or tarballs, and installed under a common parent directory. I will call this "/development".
The current default gcc compiler version distributed with Cygwin is 3.4.1. Unfortunately, this version has problems dealing with the complexity of the OpenSceneGraph and Producer template usage. The libraries will compile, but they will not run. To build OSG you need to manually direct the cygwin installer to load version 3.3.3 of the gcc compiler family.
You must create some initial environment variables so that the OpenSceneGraph build process knows where OpenThreads and Producer are installed. The best place to locate these variables is in your shell resources file. Assuming you are using the default bash shell, your bash resources file will be
Using your favorite text editor, add these variables to the file:
export OPENTHREADS_INC_DIR=/usr/local/OpenThreads/include export OPENTHREADS_LIB_DIR=/usr/local/OpenThreads/bin
OSG also uses environment variables to control which parts of the distribution is compiled. To compile the example programs, add the following line to the .bashrc file
Introspection does not seem to work within Cygwin, so also add this line to the .bashrc:
If you have installed GDAL (required for the osgTerrain component) also add:
Next you must add these paths and the path to the OpenSceneGraph installed bin directory to the systems PATH environment variable:
export PATH="$OPENTHREADS_LIB_DIR:$PATH" export PATH="$PRODUCER_LIB_DIR:$PATH" export PATH="/usr/local/OpenSceneGraph/bin:$PATH"
The $PATH variable on the end makes sure that any previously assigned paths are also included.
That's all that needs to be done for the .bashrc file, though you could also add the variable that specifies the directory of the OpenSceneGraph data, or any other variables that are particular to your setup.
Go to the OpenThreads directory
$ cd /development/OpenThreads
$ make $ make install
First, we must work around the same bug as in !Producer:
$ cd /development/OpenSceneGraph/lib $ mkdir CYGWIN32
Go to the OpenSceneGraph home directory and make, then install, OpenSceneGraph.
$ cd /development/OpenSceneGraph $ make $ make install