Grab OpenSG 1.8.X
For debian based systems, we can use the ppa as documented here (http://www.opensg.org/wiki/Releases)
deb http://ppa.launchpad.net/opensg/ubuntu gutsy main restricted universe multiverse deb-src http://ppa.launchpad.net/opensg/ubuntu gutsy main restricted universe multiverse
To 9.10 (karmic koala) the package can be found here (https://launchpad.net/ubuntu/+source/opensg), the simplest way to add it is by:
> sudo add-apt-repository ppa:opensg
OpenSG 1.8.X can be build in Linux either by configure (http://www.opensg.org/wiki/BuildLinuxAutoTools) or by GCC and scons (http://www.opensg.org/wiki/BuildLinuxScons).
(if you are really insane, you can compile OpenSG – note: it took 1/1h30 hours on my netbook… full scale build. There’s a parallel build you you have a multicore/manycores)If you wish to compile OpenSG from source, checkout from cvs first using:
cvs -d:pserver:firstname.lastname@example.org:/cvsroot/opensg login
cvs -z3 -d:pserver:email@example.com:/cvsroot/opensg co -P modulename
(where modulesname is OpenSG)
Then, make sure you have build-essential (basic build package for Debian Linux).
sudo apt-get install g++ libglut3-dev zlib1g-dev bison flex libjpeg62-dev libpng12-dev libtiff4-dev libqt4-dev
Easy install (via Synaptic or apt-get)
The easiest way is by adding the ppa repository as shown above, an then simply use your preferred way to add new software. On Ubuntu I like to use synaptic (which is a graphical frontend and works nice for newbie users). Type opensg in the search bo and install what you need (I installed everything because I’m in developing stage, glut related packages are important), here’s a screenshot:
(larger version by clicking here or in the image)
Building the source code
./configure --enable-glut --enable-jpg --enable-png --enable-qt3 --with-qt3=/usr/lib --enable-qt4 --with-qt4=/usr/share/qt4 ./make >> make.log sudo ./make install >> make-install.log
Make in a Compaq Mini only compiling with one core, 1.6ghz Atom cpu, took:
sys 7m13.607s(I’d recommend going to do something or work in a different core or computer)
Checking the installation
In theory, you’re done. But now I’ll present a way to test if your OpenSG installation was successful:
- Check if GLUT support succedded (this is crucial!), for that we use osg-config which is a small executable that checks OpenSG related issues:
> osg-config --libs GLUT -g -L/usr/local/lib/dbg -lOSGWindowGLUT -lOSGSystem -lOSGBase -ljpeg -lpng -lz -lglut -lGLU -lGL -lXmu -lXi -lXt -lX11 -lpthread -ldl -lm -L/usr/X11R6/lib
And as you see, GLUT is configured with OpenSG (hooray!) – otherwise it would give a warning and say that GLUT was not configured.
- Go to the Tutorial folder (in OpenSG/Tutorial) to test a demo:
Typical FAQ, when compiling the Tutorials
- Cannot find osg-config or OSG root directory:
- Cannot find Glut stuff, (c++ errors) – check again if GLUT support was installed. This is necessary! (see previous paragraphs on how to check with osg-config), If check fails you must build it with GLUT enabled.
- Ld (linker) complains that he cannot find dynamic libraries like libOSGWindowGLUT.so (or libOSGWindowX.so, libOSGBase.so, etc..):
> sudo cp /usr/local/lib/dbg/* /usr/lib
A more extended FAQ (with other issues)
- If you’re not getting it working, you can try to change makefile a bit (for me it was changing LIBTYPE ?= dbg, instead of opt) to compile the tutorials. Of course if you build OpenSG with either opt and dbg, both works.