Index | Introduction | Contents | Install | Dependencies | Demos | Data | Viewer | Stereo | Plan | Reference Guides |
The osgText library adds the dependency of the freetype library for support of true type fonts, however it is not essential to the core library, so you can comment it out from compilation by modifying the src/Makefile, and src/Demos/Makefile. I you wish to use fonts then you can download freetype from www.freetype.org. The osgText library also requires an up to date GLU implementation which supports GLU1.2 tessellation routines. If you your current GLU is out of date you'll need to download the latest, for instance the sgi's sample implementation for GLU from the www.opengl.org website.
The OSG also has a set of plug-ins which support non-native 3d database and image formats, several have no dependencies on external libraries (flt,3ds,obj, lwo,dw, tga & pic), while others (pfb,jpeg,gif,tiff) require other libraries to be installed to compile them. If you don't already have them installed then don't worry, you'll still be able to use the OSG, just comment out the plugins you can't compile from the src/osgPlugins/Makefile. The core osg library and viewer has been designed to load the plug-ins at run-time only and if they are required to load a specific data set. If you don't need them for your datasets then it won't matter that you haven't been able to compile all the plug-ins. A full list of dependencies and where to download the required libraries are listed in the dependencies.html
If you're coming across the OSG for the first time and want to get started quickly, go right ahead and follow the compilation instructions. You can always later download the libraries which the plug-ins require if you eventually need them.
Building the OSG requires 'gmake', due to the extensive use of gmake
directives in the Makefiles. You can get gmake from here if you don't already
have it installed: http://www.gnu.org/software/make/
Almost all of the unix compiling is done simply with make; make install with make help to bring up help. For platform specific details:
To execute the viewer the file path for the .dll's and .exe, both compiled into the OSG's bin directory, need to be setup, such as by adding the PATH to your autoexec.bat, its also useful to add the OSGFILEPATH to your autoexec.bat to help the location of datafiles. For example :
SET OSGFILEPATH=D:\OpenSceneGraph-Data;D:\OpenSceneGraph-Data\Images
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;D:\osg-0.8.43\bin;
To help compilation of the image reader plugins, various image libraries have been zipped up for your convenience, your find these on the OSG release download directory.
Once it is installed everything should compile fine and not crash, but you won't be running at full speed since the build #ifdef's out some important state optimizations since the basic VisualStudio can't handle it. You can safely remove the #ifdef from src/osgUtil/Otimizer.cpp, Line 44. The #ifdef is smart enough to do this automatically when using VisualStudio .NET and STLport so that modification by hand won't be required. Unfortunately there doesn't seem to be a special define associated with the Dinkumware STL for the #ifdef to pick up on.
% makeNote, make should automatically detect linux and build optimized targets for your system. And if you wish to install the OSG type:
% make installor
% make instlinksTo get full details of make options, type:
% make help(highly recommended)
The osgText library now depends upon GLU1.3 functionality, and only the recent Mesa version have this as standard. Unfortunately not all Linux distributions are up to date even recent ones. If you have problems compiling osgText due to GLU problems then check out the details at the bottom of this file, under the title RedHat7.1 & GLU1.3 for a quick way of installing GLU1.3 in the right place.
English
1) Untar the tarball. It will create a directory called fixosg/Cmd line
2) Change to the ReadHat7.2_fixglu/ directory
3) Become root
4) Run the script called fixglu
tar xvzf ReadHat7.2_fixglu.tar.gzYou should then be able to do a "make" in your OSG directory and everything will build as it should. Let me know if this doesn't work and I will try to improve it. Email me directly for help instead of posting here. There's a README in the tarball with some info on what the script actually does. There's nothing wrong with OSG itself; the problem with Redhat 7.2 is that it doesn't have GLU 1.3 by default, which OSG is now dependent on (for osgText.) Good luck everyone. - Clay
cd ReadHat7.2_fixglu/
su (your root password)
./fixglu
exit
% makeNote, make should automatically detect linux and build optimized targets for your system. And if you wish to install the OSG type:
% make installor
% make instlinksTo get full details of make options, type:
% make help(highly recommended)
Compile, from the OSG root directory, ('%' is UNIX csh prompt) type:
% makeNote, make should automatically detect linux and build optimized targets for your system. And if you wish to install the OSG type:
% make installor
% make instlinksTo get full details of make options, type:
% make help(highly recommended)
% makeNote, make should automatically detect linux and build optimized targets for your system. And if you wish to install the OSG type:
% make installor
% make instlinksTo get full details of make options, type:
% make help(highly recommended)
Everything is done command-line, so you need to get to a shell before proceeding. The Mac comes with an app in Applications/Utilities called Terminal - open up any Finder window (e.g double-click on your hard disk icon), click on the Applications icon at the top right of the window, then click on the Utilities folder to get access to the Terminal. When you start Terminal it brings you up a csh running from your ~/ directory. Now, go to your OpenSceneGraph directory, and simply type:
make -j2And some time later you'll be rewarded with a lovely set of binaries and libraries. The Mac OSX build currently only builds a subset of the total functionality in OpenSceneGraph, but a large subset at that. Some of the remaining projects are known to build as well, but have external dependencies on libraries such as libtiff, libjpg, libpng, etc. and so are not included in the default build. However, if you examine the file OpenSceneGraph/Make/makedefs you will find which extra projects build for the mac, provided you have the external libraries required. Details on how to install these external libraries are outside the scope of this document, but for starting points, see one of:
setenv OSGHOME `pwd`/OpenSceneGraph
setenv OSGFILEPATH `pwd`/OpenSceneGraph-Data
setenv OSG_LD_LIBRARY_PATH ${OSGHOME}/lib
setenv DYLD_LIBRARY_PATH ${OSG_LD_LIBRARY_PATH}
OSG_FILE_PATH environmental variable
For the OSG to locate file data files easily an environmental variable OSG_FILE_PATH is used at run-time by the osgDB library. Note, for examples below substitute in the ${OSGDATA} directory with your own path where appropriate) Add the following to your .cshrc (note paths separated by colon's): setenv OSG_FILE_PATH ./:${OSGDATA}:${OSGDATA}/Images Or the following if you're using a sh compatible shell : export OSG_FILE_PATH=./:${OSGDATA}:${OSGDATA}/Images: Or under windows (note paths seperated by semi-colon's) : SET OSG_FILE_PATH=./:${OSGDATA};${OSGDATA}/Images