Skip to main content.

Updated 20.6.2007! Made in a hurry so can contain mistakes.

Compiling OpenSceneGraph 2.0 in Ubuntu (Feisty)


First, you need your development tools:

sudo apt-get install build-essential

sudo apt-get install cmake

Get OpenSceneGraph source code and sample dataset from openscenegraph.org and extract them:

Extract those somewhere. I have all source codes in my home directory under "programs".

Then install depencies:
sudo apt-get build-dep openscenegraph

You'll also need OpenGL-headers. If you are using Nvidia drivers from Ubuntu repository, then

sudo apt-get install nvidia-glx-dev

It's a good idea to build outside source directory. So make a build directory:

mkdir build_OSG

cd build_OSG

Then we can built:

cmake ../OpenSceneGraph -DCMAKE_BUILD_TYPE=Release

make

sudo make install

ccmake . gives you a list of different compile options, like compiling examples.


Then make some settings:
export PATH=${PATH}:/usr/local/share/OpenSceneGraph/bin

export OSG_FILE_PATH=/WHEREDIDYOUEXTRACTDATAFILES/OpenSceneGraph-Data

export LD_LIBRARY_PATH=/usr/local/lib

>If everything went fine, you can write osgviewer cow.osg and spin the cow :)