-
Notifications
You must be signed in to change notification settings - Fork 14
Building OpenSceneGraph on Ubuntu
Ravi Mathur edited this page Apr 2, 2020
·
22 revisions
The following dependencies are needed to build OpenSceneGraph and its associated plugins
sudo apt install build-essential
sudo apt install git
sudo apt install cmake
-
sudo apt install cmake-qt-gui
(for cmake-gui, an easy-to-use cmake GUI)- Alternatively,
sudo apt install cmake-curses-gui
(for ccmake, a text-based cmake UI)
- Alternatively,
sudo apt install mesa-common-dev
sudo apt install freeglut3-dev
sudo apt install libfreetype6-dev fonts-liberation
sudo apt install libpng-dev libjpeg-dev libtiff-dev
(Optional) Qt
- download
.run
installer -
chmod +x *.run
in the Terminal ./<RUNFILE>.run
- follow on-screen instructions to install
- Qt install path with be referred to as
[QT_ROOT]
by this wiki
-
git clone https://github.com/openscenegraph/OpenSceneGraph.git --branch OpenSceneGraph-X.X.X
whereX.X.X
is replaced by the latest stable tag under Branch > Tags on Github - the root OpenSceneGraph directory will be referred to as
[OSG_ROOT]
by this wiki
In Terminal:
cd [OSG_FOLDER]
mkdir build
mkdir install
cd build
cmake ..
-
cmake-gui
(alternativelyccmake .
)- Enable "Grouped" and "Advanced" options
- Set
CMAKE_INSTALL_PREFIX
=[OSG_FOLDER]/install
- (Optional)
BUILD_OSG_EXAMPLES
=ON
- Ensure that
OPENGL_INCLUDE_DIR
,OPENGL_gl_LIBRARY
, andOPENGL_glu_LIBRARY
were found - Configure, then Generate
In Terminal:
-
cd [OSG_FOLDER]/build
if you aren't already there -
make
ormake -j <NUMBER_OF_CORES>
if you know the number of cores your computer has -
sudo make install
to install the compiled OpenSceneGraph into the[OSG_FOLDER]/install
folder - Confirm that the
osgversion
executable is in[OSG_FOLDER]/install/bin
In Terminal:
- Add the following to your
.bashrc
login file
export OSG_ROOT=[OSG_FOLDER]/install
export PATH=$PATH:$OSG_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OSG_ROOT/lib
source ~/.bashrc
- Run
osgversion
in the Terminal, it should tell you the version of OpenSceneGraph that you have installed
Congratulations, OpenSceneGraph is now built and installed; ready for use with OpenFrames!
- Download the resources from here
- Unzip the files
-
cd
to the unzipped directory -
osgviewer cow.osg --window 0 0 640 480
to run a demo visualization of a cow