Skip to main content

History: Prerequisites

Preview of version: 122

prerequisites.jpg

What you need to build Ogre from source.

Introduction

This is a small check list of things you need to do before you're ready to build Ogre from source.

Image

Done Compiler Specific Prerequisites

Done Visual Studio

You need the latest service packs for the following versions of Visual Studio:
Visual Studio 2008 (VC9) Service pack 1 and the ATL security fix (available from Microsoft Update)
Visual Studio 2005 (VC8) Service pack 1


Visual Studio Express users do not need a separate service pack or ATL security fix because the latest install download already contains that fix.
Get it from http://www.microsoft.com/express/Downloads/.

Done MinGW


Get the latest MinGW installer from here and install MinGW.
Make sure to include the C++ compiler (it is the only required compiler for Ogre, but installing all of them doesn't hurt).
You most likely do not want the full "MinGW Developer Toolkit", but you should check the "MSYS Basic System".

Install it to C:\mingw.

Also add C:\mingw\bin to your PATH. The installer might ask if it should do that for you, but if you did not install with admin rights, this likely did not work. In any case, you should check and make sure it is correctly added to your PATH.

Done Boost

Boost is not required to build Ogre - it's optional. ๐Ÿ˜Š
The Boost Threads library is used by the paging component, which in turn is used by the terrain component, enabling background loading and thus faster response times.
It's recommended to get at least Boost version 1.49.0 or newer.
Also, around the same boost version, bjam was renamed to b2, so don't be confused if newer boost manuals require you to use "b2" instead of "bjam" when building. It's actually the same.

Lucky users of Visual Studio 2003 - 2010 can use the Boostpro Boost Installers.
Select your compiler and "Multithreaded" and "Multithreaded Debug".
Be sure to install Boost Date Time and Boost Thread. The default selection (all) makes sure it's installed.

CMake depends on the following environment variables to find Boost successfully:
BOOST_ROOT (C:\Program Files\boost\boost_1_49)
BOOST_INCLUDEDIR (C:\Program Files\boost\boost_1_49)
BOOST_LIBRARYDIR (C:\Program Files\boost\boost_1_49\lib)
Well, at least BOOST_ROOT, but it can't hurt to set the two others.

Building boost from source
As boostpro is not always up-to-date with the newest boost versions, you sometimes might want to build boost from sources yourself.
MinGW users will always have to build boost from sources.

Get Boost from www.boost.org and the b2 executable as detailed on the Boost compile page and follow the chapter 5.2 as a guide on how to build boost from source.
Info For MinGW users: When asked to run "bootstrap.bat", make sure to run "bootstrap.bat gcc" instead.

As an example, this line builds Boost date_time and thread using VC10:
Info Use the Visual Studio Command Prompt when issuing the command.
Copy to clipboard
b2 --build-dir="C:\boost-vc10" toolset=msvc-10.0 --build-type=complete --with-date_time --with-thread


This line builds Boost date_time and thread using gcc:
Copy to clipboard
b2 --build-dir="C:\boost-gcc" toolset=gcc --build-type=complete --with-date_time --with-thread


If you just want all of boost installed, just do the same command without "-with-date_time -with-thread"

When done building, move the contents of boost_dir/stage/lib to boost_dir/lib.
If you are sure you're not going to rebuild Boost, you can safely delete the build directory (i.e. C:\boost-vc10)

Done DirectX


To build Ogreon Windows you'll need the DirectX SDK. As of the release of Windows 8, DirectX is no longer a standalone package, rather it is bundled in the Windows8.x SDK (latest version is the Windows 8.1 SDK.)

Done Dependencies

A repository containing a all sources of the Ogre dependencies (along with the necessary CMake scripts) is available here at Bitbucket. Make sure to read our CMake Guide if you haven't yet.

Tip_icon.png The following two links are outdated and only relevant for Ogre 1.7. It is probably the best to simply build the dependencies using the repository and CMake as described above. But you may of course try to use them:
Visual Studio users need to compile the dependencies themselves: Visual Studio Dependencies
MinGW users can grab the precompiled MinGW Dependencies

Unpack the dependencies into either your Ogre source directory, your Ogre build directory or somewhere else.
The directory should be named Dependencies if put either into the source or the build directory (this ensures that the Ogre CMake scripts should automatically find and user it).
If you choose to place it elsewhere, you can name it however you like, as long as you're setting an environment variable OGRE_DEPENDENCIES_DIR pointing to its location.

It's recommended to use the last option - OGRE_DEPENDENCIES_DIR - as it makes it easier to manage several different dependencies (VC9, VC10, MinGW, etc.) on the same computer, against the same Ogre source directory.

Info Additional information for OIS linking error with dxguid.lib can be found in the forums.

Info Building FreeImage with Visual Studio once was buggy (_ITERATOR_DEBUG_LEVEL bug). If you experience any issues, you can compile FreeImage in the following way:
  1. Build the full FreeImage packet on Debug for all platforms
  2. Switch actual configuration to Release
  3. Save the project map and close VS
  4. Delete all temporary folders of the project (look for "Intermediate Directory")
  5. Start VS and load FreeImage project
  6. Build the full FreeImage packet on Release for all platforms

-(Linux)-

Image

Before you begin

Ogre does not play well with "Software Rasterizers", so if you run glxinfo | grep Software and it finds "OpenGL renderer string: Software Rasterizer", you may need to investigate upgrading your graphics card or its drivers. See jockey-gtk on Ubuntu for driver help.

The easiest way to get Ogre is to install via package manager, e.g.
sudo apt-get install libogre-1.9-dev

 Check Ogre Versions
However, this may be out of date, e.g. for Ubuntu 10.04 only Ogre 1.6.4 is available, although the latest release is 1.7.1. Ogre 1.9 is available for Ubuntu 14.4.


If you want the latest version of Ogre, follow the directions below and then the CMake Quick Start Guide

Done Ubuntu

Image
For Ubuntu Karmic and above:

Compiler And Configuration Tools
Copy to clipboard
sudo apt-get install build-essential automake libtool


Required Dependencies
Copy to clipboard
sudo apt-get install libfreetype6-dev libfreeimage-dev libzzip-dev libxrandr-dev libxaw7-dev freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev

If during Ogre build any headers are still missing, try adding these one at a time, and update the list above please! ๐Ÿ˜Š
  • libxt-dev
  • libpng3-dev
Could probably use libglew1.5-dev instead of freeglut3-dev. It is an open question whether or not libxt-dev and libpng3-dev is required.

Not Strictly Required Dependencies
Copy to clipboard
sudo apt-get install nvidia-cg-toolkit libois-dev libboost-thread-dev

Info While nvidia-cg-toolkit, libois-dev and libboost-thread-dev are not strictly required, you'll want to install them:
  • nvidia-cg-toolkit is used by the Cg plugin for Cg shaders.
  • libois-dev is used as input library for the demos.
  • libboost-thread-dev is used by the paging component and other background threading.

Entirely Optional Dependencies
Copy to clipboard
sudo apt-get install doxygen graphviz libcppunit-dev



-

Done Fedora

fedora.jpg
This is a list of packages to install for Fedora 13:

Required Dependencies
Copy to clipboard
gcc-c++ libXaw-devel freetype-devel freeimage-devel zziplib-devel cmake


Not Strictly Required Dependencies
Copy to clipboard
boost-devel ois-devel Cg

WARNING: To install the Cg package, you need to enable the nonfree RPMFusion repositories

Entirely Optional Dependencies
Copy to clipboard
doxygen cppunit-devel



-

Done OpenSUSE

Image

This is a list of packages to install for OpenSUSE 12.2:

To install these optional dependencies (recommended) you will need to add the OpenSUSE games repo:
Add games repo
Copy to clipboard
zypper ar http://download.opensuse.org/repositories/games/openSUSE_Factory/ games


Required Dependencies
Copy to clipboard
zypper in gcc-c++ libXaw-devel freetype2-devel freeimage-devel libxrandr-devel zziplib-devel cmake


Not Strictly Required Dependencies
Copy to clipboard
zypper in boost-devel libOIS-devel cg-devel


Entirely Optional Dependencies
Copy to clipboard
zypper in doxygen cppunit-devel



-

Done Arch Linux


archlinux.png
Run this to install the Ogre dependencies for Arch Linux:

Copy to clipboard
pacman -S boost-libs boost freeimage freetype2 libxaw libxrandr mesa nvidia-cg-toolkit ois zziplib cmake gcc


-(Mac OS X & iOS)-

Image

Installing Dependencies

Option 1: Extract the dependencies into your Ogre source root. Precompiled archive containing PPC and i386 binaries compiled against the 10.4u SDK are available: OS X Dependencies (link is only valid for Ogre version 1.7). A larger selection of precompiled dependency packages including more recent updates and iOS packages can be browsed to from the ogre-dependencies-mac page.

Option 2: Install Ogre dependencies system-wide via MacPorts. Be forewarned if you intend to distribute binaries, you may have to jump through a few hoops to link against the static archives (.a) or extract the dynamic libraries and modify their install name (install_name_tool). However individual developers may find this easier to manage on their local machines for general development.
Copy to clipboard
sudo port install libpng +universal jpeg +universal libxml2 +universal sudo port install pkgconfig xmlto autoconf automake libtool sudo port install freetype +universal freeimage +universal libzzip +universal boost +universal ois +universal sudo port install cmake

  • Ogre3D requires a 32 bit build due to use of Carbon interfaces via OIS. Thus the +universal specifications to ensure 32 and 64 bit builds for libraries.
  • You need the first line even if you already have libpng/jpeg/xml2 installed because they will be re-installed within the package system and we need to ensure universal build. You may need --enforce-variants if you have already installed these packages.
  • The second line is the build dependencies of libzzip, they do not need to be universal, but use +no_x11 +quartz to avoid unnecessary additional packages
Finally, from the terminal:
Copy to clipboard
touch ~/.bash_profile open -a TextEdit ~/.bash_profile

If it is not already present, add:
Copy to clipboard
export CPPFLAGS="-I/opt/local/include" export LDFLAGS="-L/opt/local/lib"

Finally, you need to install Cg and OIS. (Not strictly required by Ogre, but required for Demos, and generally recommended.)

History

Information Version
Thu 15 of Oct, 2015 18:20 GMT-0000 Sauermann Added note about DirectX 9 SDK 125
Sat 14 of Feb, 2015 07:17 GMT-0000 gtsiam123 Added a warning about the install path 124
Thu 05 of Feb, 2015 11:39 GMT-0000 raffamaiden 123
Mon 06 of Oct, 2014 07:36 GMT-0000 spacegaier 122
Fri 04 of Jul, 2014 02:50 GMT-0000 excaliburHisSheath Updates the out-of-date warning for the Ubuntu apt repository to be accurate for Ubuntu 14.4 121
Thu 17 of Apr, 2014 02:58 GMT-0000 excaliburHisSheath Adds a note about installing DirectX on windows 120
Mon 23 of Dec, 2013 15:24 GMT-0000 jakesee 119
Wed 22 of May, 2013 16:55 GMT-0000 spacegaier 118
Tue 22 of Jan, 2013 08:31 GMT-0000 Transporter Update _ITERATOR_DEBUG_LEVEL bug note: The original instructions have been written for the original source and not CMake 117
Mon 23 of Jul, 2012 16:54 GMT-0000 TheSHEEEP 116
Sun 22 of Jul, 2012 12:55 GMT-0000 TheSHEEEP 115
Sun 22 of Jul, 2012 12:49 GMT-0000 TheSHEEEP 114
Sun 22 of Jul, 2012 12:04 GMT-0000 TheSHEEEP 113
Sun 22 of Jul, 2012 10:57 GMT-0000 TheSHEEEP Added likely "outdated" information 112
Sun 22 of Jul, 2012 10:53 GMT-0000 TheSHEEEP 111
Sun 22 of Jul, 2012 10:35 GMT-0000 TheSHEEEP Inserted link to CMake guide. 110
Sun 22 of Jul, 2012 10:15 GMT-0000 TheSHEEEP 109
Sun 22 of Jul, 2012 10:08 GMT-0000 TheSHEEEP More info 108
Sun 22 of Jul, 2012 10:06 GMT-0000 TheSHEEEP 107
Sun 22 of Jul, 2012 10:05 GMT-0000 TheSHEEEP Added note for building boost with MinGW 106
Sun 22 of Jul, 2012 10:01 GMT-0000 TheSHEEEP 105
Sun 22 of Jul, 2012 10:00 GMT-0000 TheSHEEEP bjam --> b2 104
Sun 22 of Jul, 2012 09:57 GMT-0000 TheSHEEEP Boost manual restructured. 103
Sun 22 of Jul, 2012 09:56 GMT-0000 TheSHEEEP 102
Sun 22 of Jul, 2012 09:55 GMT-0000 TheSHEEEP 101