BuildingFromSource Shoggoth

From Ogre Wiki

Jump to: navigation, search

This page shows you how to build from source on Ogre v1.6 (Shoggoth) and earlier.

Contents

MS Windows

MS Visual C++

Prerequisites

Visual C++.NET 2002 (VC7) (and older)

These versions are no longer supported. Please do not ask in the forums how to have them supported; the compilers in these versions are hopelessly broken, and Microsoft is falling over itself to give you current, modern versions of their Visual Studio IDE and compilers for free. Please download and install the latest Visual C++ Express Edition, and follow the instructions for that edition below.

Visual C++.NET 2003 (VC71)

All editions of Visual C++.NET 2003, including "student" and "academic", are supported directly by the Ogre Project Team.

Dependencies

You will need the Visual C++.NET 2003 Dependencies package for Shoggoth (Ogre 1.6.x), available from the Ogre Downloads page here. Unzip the full ZIP file directly into ogre/ (or whatever you called the directory containing your Ogre source code), so that you have a new folder called Dependencies at the same level as Samples, OgreMain, and so on.

The Visual C++.NET 2003 Dependencies (all editions including Express, academic and student) work with both the current stable branch (Eihort, or 1.4) as well as CVS HEAD (Shoggoth, or 1.5/1.6).

Visual C++ 2005 (VC8/SP1)

All editions (Express, Standard, Professional, Team Studio), including "student" and "academic", of Visual C++ 2005 (with Service Pack 1) are supported directly by the Ogre Project Team.

NOTE 1: You will need to install Service Pack 1 for the edition of Visual Studio/Visual C++ 2005 that you are using. The reason that you need this even for the source, is that the Dependencies are built against VC8 SP1, and you very likely will encounter errors trying to run apps built against the VC8 SP1 Dependencies, in Visual C++ without Service Pack 1. You will know whether you installed Service Pack 1 or not -- it's a 400MB download and takes up to 45 minutes to patch Visual Studio (depending on how many parts of Visual Studio 2005 you have installed).

NOTE 2: If you are using Visual C++ Express 2005 (vc 8.0) for the first time, make sure you do all 5 steps here prior to building Ogre with VC8 SP1.

Visual C++ Express 2005 does not come with the windows headers and libraries so the second step in that MSDN link is to download the Microsoft Platfrom SDK (PSDK) which has what Express does not. If you don't install the PSDK and do steps 3, 4, and 5 then you will get compiler errors like can't find 'windows.h' etc. Yes, the PSDK is a motherload of a download but hey its free :). An alternative to reading the above psdk installation guide is to visit Visual C++ 2005 Express Learning Resources and scroll down to the videos. Choose to view this one: Using Visual C++ Express Edition and the Platform SDK.

Dependencies

You will need the Visual C++ 2005 (SP1) Dependencies package for Shoggoth (Ogre 1.6.x), available from the Ogre Downloads page here. Unzip the full ZIP file directly into ogre/ (or whatever you called the directory containing your Ogre source code), so that you have a new folder called Dependencies at the same level as Samples, OgreMain, and so on.

The Visual C++ 2005 SP1 Dependencies (all editions including Express, academic and student) work with both the current stable branch (Shoggoth, or 1.6) as well as SVN HEAD (Cthugha, or 1.7/1.8).

Visual C++ 2008 (VC9)

Full support for Visual C++ 2008 (all editions including Express) is still in "test" mode, but building Ogre from source with Visual C++ 2008 is currently supported through the VC9 precompiled dependencies available here. The Visual C++ 2008 Dependencies (all editions including Express) work with both the current stable branch (Shoggoth, or 1.6) as well as SVN HEAD (Cthugha, or 1.7/1.8).

Dependencies

The Visual C++ 2008 Dependencies (all editions including Express, academic and student) work with both the current stable branch (Shoggoth, or 1.6) as well as SVN HEAD (Cthugha, or 1.7/1.8).

Ogre Source
  • Go to http://www.ogre3d.org and select, More Downloads, then Source: Windows. Alternately, you can get the source from SVN, using the instructions at http://www.ogre3d.org/index.php?option=com_content&task=view&id=415&Itemid=144. The current stable branch is titled v1-6.
  • Extract the Ogre source (if you downloaded a source tarball).
  • Regardless of how you obtained the source, you will then need to extract the Dependencies inside the ogre folder (so that you end up with an ogre/Dependencies folder).

If for whatever reason you want to build dependencies yourself (e.g. you're using the unstable version and precompiled dependencies aren't available), see the Building Dependencies page.

DirectX SDK

Download the latest DirectX 9.0 SDK from http://msdn.microsoft.com/directx.

The DirectX SDK install should automatically update the Visual Studio include and library paths with the locations of the DX SDK includes and lib paths. If not, you will need to enter the DirectX include and library directories into MSVC so you can compile against the SDK. It would look something like this:

  • Select Tools|Options|Projects|VC++ Directories

Note: Path to the folder must be ON TOP of the list or you will get errors during compilation (Example: error LNK2001: unresolved external symbol _IID_IDirect3DBaseTexture9)

  • Under library files, set the appropriate library directory for the SDK. E.g.,
    C:\Program Files\Microsoft DirectX SDK (August 2007)\Lib\x86 
  • Under include files, set the appropriate include directory for the SDK. E.g.,
    C:\Program Files\Microsoft DirectX SDK (August 2007)\Include 
Platform SDK (VC++ 2005 Express)

For users of the free VC++ 2005 Express edition, you'll need to install the monolithic (~400Mb) Platform SDK (PSDK). If you are using Visual C++ Express 2008, you can skip ahead to the section titled Building.

For those with restricted bandwidth, the PSDK is available on CD for a nominal fee. After installing the PSDK, start VC++ 2005 Express and:

  • From the main menu, open the Tools|Options dialog. In the Projects and Solutions section, select VC++ Directories and, by browsing your local disk rather than manually typing, add the following paths:
    • In the 'Executable files' list, C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin
    • In the 'Include files' list, C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include
    • In the 'Library files' list, C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\lib
  • With a text editor, edit the file C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults\corewin_express.vsprops and change the string that reads,
    AdditionalDependencies="kernel32.lib" 

to

    AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"
  • In Visual C++ Express, the Win32 Windows Application type is disabled in the Win32 Application Wizard. To enable that type, you need to edit the file AppSettings.htm file located in the folder “%ProgramFiles%\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\1033\". In a text editor comment out lines 441 - 444 by putting a // in front of them as shown here:
    // WIN_APP.disabled = true;
    // WIN_APP_LABEL.disabled = true;
    // DLL_APP.disabled = true;
    // DLL_APP_LABEL.disabled = true;
  • Finally, close and restart VC++ 2005 Express.

If you don't follow these instructions exactly, you are likely to see compile and link problems. More specifically, expect to see copious errors complaining about missing 'windows.h' and 'user32.lib' files. (These instructions are lifted from Microsoft's notes on using Express with the PSDK.)

Note: If you are running Windows Vista you'll have to look for "Microsoft Windows SDK" instead of the PSDK. It was renamed after the release of Windows Vista. A current download can be found at the microsoft website.

Building

With the prerequisites installed, we are ready to build OGRE.

  • Open the ogre\ogre.sln file (ogre\Ogre_vc8.sln for VC++ 2005 and VC++ 2008, all editions; VC++ 2008 will convert the solution and projects for you)
  • Click "build all".

The build process takes around 15 minutes on a modern P4 class system. If all goes well, the engine, plugins, tools, and demos will build.

Next, try running the demos to verify everything worked. They are found in ogre\Samples\Common\bin\Debug (or bin\Release if built in release mode).

Project Setup

If you are using VC++ .NET 2003 or later, you can use the Ogre AppWizard and you are ready to create OGRE apps. See also The Complete Blanks Guide To Using The OGRE SDK AppWizard.

If you feel like setting up a project manually, heres how:

Provided with OGRE is a subclassable ExampleApplication class (found in ogre\Samples\Common\include, just for future reference), which will allow you to develop applications very quickly using a fairly standard set of parameters. While OGRE will allow you to build most any kind of application you wish, the ExampleApplication will provide you with a good base for the majority of 3D applications, and is even suitable for building production-level apps off of.

We'll start by setting up a new Visual C++ Win32 project.

Make sure that "Empty Project" is checked in the application settings. I like to create my smaller projects in the ogre\Samples directory, simply for consistency's sake. You can put them wherever you like, however.

Once you have your project, the first thing you're going to want to do is set up your project properties to use OGRE. There is a tutorial on doing this here (http://www.ogre3d.org/wiki/index.php/SettingUpAnApplication). The tutorial will also walk you through the basics of setting up an app, so feel free to browse through it. However, if you just want the quick rundown, here's what you'll need to do:

  • Right-click the project name in the solution explorer and select "Properties".
  • Add the ogre\OgreMain\include and ogre\Samples\Common\include directories to your "additional includes" directory (Found under C++/General). Visual Studio requires you to create a .cpp or .h file for the C++ options to show up.
  • Add ogre\OgreMain\lib\(Debug|Release) to your "library search paths" field (found under Linker/General)
  • Add OgreMain.lib to the "Additional Dependencies" field (found under Linker/Input)

(Note - if you've downloaded the libraries from the Ogre website and are using the Debug ones you will need to make this OgreMain_d.lib -- not adding the _d will cause ~4 perplexing linker errors. Hope this helps anyone in need. --lurkingfridge79)

  • Under C++/Code Generation, change "Runtime Library" to "Multi-threaded Debug DLL" (for debug-mode apps) and "Multi-threaded DLL" (For release-mode apps).

It is also recommended that you change your "Output Directory" (under General) and your "Working Directory" (under Debugging) to the ogre\Samples\Common\bin\(Debug|Release) directory. This will place the file in the same directory as the already-existing OGRE DLL and configuration files, which are required for any OGRE-based app to run. If you do not do this, you will need to copy a lot of the OGRE DLL and config files over to your output directory, as well as rework your config files and such to get it working properly. This is NOT recommended for your first shot at this.

Once that's done, we can start to use OGRE. Create a file called main.cpp, and see SettingUpAnApplication.

MS Visual C++ Toolkit 2003 & Code::Blocks

Unfortunately the Visual C++ Toolkit does not come with necessary libraries for Multithreaded DLL compiling. This means you won't be able to compile Ogre with it, or at least not easily. The recommended solution for windows is to buy MSVC 7.1 or use GCC with one of the IDEs available.

Discipline gave it a good shot at this thread in the forums. If you find a solution, please remove this and post it here. Also use the Codeblocks page for reference.

Update: You can get the multi-threaded dll runtime libraries by following the instructions at: http://manageddreams.com/osmpwiki/index.php?title=Notes_on_Microsoft_Visual_CPP_Toolkit_2003

GNU Compiler Collection (GCC)

GCC & Code::Blocks

For Ogre 1.6.0 RC1 the Code::Blocks workspace is not correctly configured. Download the Ogre source from SVN instead. See this thread for additional information.
For Ogre 1.4 follow this link Code::Blocks + MinGW C++ Toolbox.
For Ogre 1.2.2 there is an alternative option of using Code::Blocks + MingW + STLPort For Ogre 1.0.x with Code::Blocks 1.0RC2

Here are the steps to build Ogre with mandrav's excellent Code::Blocks IDE under Windows.

Performance Tip: It is suggested to disable Code::Blocks code completion plugin, before opening the Ogre workspace. This workspace contains ~40 projects which will be parsed. Since you 'll be building Ogre and not editing it, you won't be needing this parsing step.

Installation steps:

  1. Download the Ogre source distribution for Windows and unzip it. Everything will unpack in the ogre directory.
  2. Download codeblocks-dependencies-x.x.x.zip.
  3. Unzip codeblocks-dependencies-x.x.x.zip inside ogre (this creates the Dependencies directory)
  4. Launch Code::Blocks and open ogre/Ogre.workspace (wait until all projects have loaded)
  5. Hit "Build/Build Workspace"
  6. Sit back for a few minutes (17mins on a Intel P4 3.0G)
  7. Copy ogre/dependencies/bin/*.dll to ogre/samples/common/bin/release

Before being able to run the provided samples, you should comment out (using a hash # in front of it) the line Plugin=RenderSystem_Direct3D7 inside samples/common/bin/release/plugins.cfg.

You will need quake3 data files(.pk3 and .bsp) in order to run the BSP demo. If you have the files but got a ZipArchive::checkZzipError, just edit ogre\Samples\Common\bin\Release\quake3settings.cfg to point at your quake3 pak and bsp files.

You might have a problem building PlatformManager_Win32: The ogre/Ogre.workspace file has a 2 missing paths for the PlatformManager_Win32 build. To fix it, do the following:

  1. Right click on PlatformManager_Win32 in the workspace window on the left.
  2. Select "Build Options"
  3. Select the "Directories" tab and next the "Resource Compiler" tab.
  4. Add the following 2 directires ..\include and ..\misc, but clicking "Add" and the selecting those directories.
  5. Everything should build correctly now.

Enjoy!

GCC & Cygwin/MinGW

Use the following if you don't want to have to setup Code::Blocks, but would like to have just a pure Cygwin/MinGW environment. Cygwin is used for it's building system and since it can nicely cross-compile for MinGW, you will have a build that doesn't depend on Cygwin anymore.

Note: This information is ripped from this thread in the the Ogre forums.

  1. Fully install cygwin. You might need to add the correct path to /etc/profile.
  2. Get OGRE from CVS (there is a tutorial on how to do it in the CVS Access section). I put this on /usr/dev/ogre. This should also work with release version 1.0.0 or later - actually it worked with 1.0.0RC1 (I used the linux/OSX version. Didn't try the win32, but it must be not that different).
  3. Get the MingW/Cygwin OGRE dependencies from the OGRE website. Either extract it to the root (thus creating /mingw) or to another directory and create a symlink /mingw pointing to the correct location. If you want to build the OGRE dependencies yourself read Build OGRE dependencies using MSYS.
  4. Download and install libtool 1.5.12 (or newer). Version 1.5.10 (the one that came with cygwin) generates a few errors we want to avoid.
    1. Download the stable version from the libtool website.
    2. Configure and install it.
    3. Cygwin has a libtool wrapper that automatically selects 1.5.10 or 1.4.3 - we need to make it use our 1.5.12 (or newer) version instead. To do so, we first copy the libtool files from /usr/local/bin to /usr/autotool/1.5.x/bin (you'll have to create it), then edit /usr/bin/libtool to use that directory instead of the devel dir. It's just a quick, nasty hack - if someone knows of a better way to get the same result, please feel free to write your solution in right here. This shouldn't break anything though.
    4. (Optional): Go to a directory without configure.ac or configure.in files and do a 'libtool --version' to see if the first version number changed. If so, we can go to the next step.
  5. Follow the instructions on the beginning of this post, which I modified slightly and reproduce here. This is to be done in the ogre directory:
    1. export PATH="$PATH:/mingw/bin"
    2. export ACLOCAL_FLAGS="-I /mingw/share/aclocal"
    3. export PKG_CONFIG_PATH=/mingw/lib/pkgconfig
    4. ./bootstrap
    5. CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" CXXFLAGS="-O2 -I/mingw/include" LDFLAGS="-L/mingw/lib -L/lib/w32api" ./configure --with-ft-prefix=/mingw --with-platform=Win32 --with-gl-support=Win32 --disable-static --build="i686-pc-mingw32" --enable-direct3d
    6. make
    7. make install
  6. Set up your development tools.
    1. Passing the arguments "-lOgreMain -Wl,--enable-runtime-pseudo-reloc" to the linker will work.
    2. As far as library directories go, you can link to cygwin/usr/local/lib and be happy about it.
    3. Include directories: cygwin/usr/local/include, cygwin/usr/local/include/OGRE and ogre/Samples/Common/include (if you are using the ExampleApplication class). Where I say cygwin/, I actually mean the cygwin path (such as c:/cygwin) and the same goes for ogre/ (c:/cygwin/usr/local/ogre/ogre, for example).
    4. This is not required, but I tend to copy all required DLLs to my build directory (the one where MingW puts my compiled binary in). By this, I keep my environment clean and you can just copy that directory to another computer and run it with its own dlls. This avoids mess.

There you go. You should be able to safely build any post-1.0.0 with this, unless there are some big changes that break the process.

Additional Notes :

  1. With the last releases of Cygwin, you don't have to compile a new libtool anymore.
  2. I had to tune the makefiles of several Plugins in order to compile: the ld option "-Wl,-z,defs" was refused. I replaced it with its other syntax "-Wl,--no-undefined" everytime I found it and it worked well.

GCC & Eclipse (MinGW + Msys)

If you want to compile Ogre on Windows without cygwin, pkgconfig, autotools, bootstrap, configure, etc. and use only gcc, then take a look : Building Eclipse with GCC (http://www.ogre3d.org/wiki/index.php/Building_Under_Eclipse_And_GCC).

For question/suggestion use the forum thread : Eclipse + Gcc 3.4 (MinGW + Msys) + Ogre 1.0.3 (http://www.ogre3d.org/phpBB2/viewtopic.php?p=90097).

This is work in progress, feedback is appreciated. Help appreciated for a Linux + Mac version. [edit] (K)Ubuntu Linux Notes

  • Here [2] (http://inetserver.europe.homeip.net/~heiko/?p=102) you can see what it takes to compile ogre on Ubuntu Linux.
  • If you run into linker problems with (K)Ubuntu and the aforementioned instructions, try issuing the command export CC=g++ before running ./configure

Setting Up The Anjuta IDE You might want to use an IDE to make your development in Ogre a tad easier. To do so, follow the instructions in this Ogre Forum Thread (http://www.ogre3d.org/phpBB2/viewtopic.php?t=5100), but to paraphrase:

  • Make a new Generic / Terminal
  • After following the prompts, change your Project->Project Options Configuration tab and Libraries sub-tab and add:

PKG_CHECK_MODULES(ogre, [OGRE >= 1.0.0]) AC_SUBST(ogre_CFLAGS) AC_SUBST(ogre_LIBS)

  • Then go into Settings -> Compiler and linker options and add ${ogre_CFLAGS} to CFLAGS and ${ogre_LIBS} in Linker Flags
  • Finally, go to Build->Autogenerate and it should update your make and config files automatically.

Enjoy Ogre in Linux -- bana

GCC & Dev C++

Note: This is deprecated, and generally not recommended. DevCPP is old, the Ogre devpak is old, and you will have a much better time using Code::Blocks with MingW.

If you really, really want to do this, keep in mind that you are on your very own here. You are not likely to get any support on the OGRE Forum, other than people telling you to try other options.

You have been warned: Building From Source using DevCPP

Linux

The preferred method for new users building on linux is to use your distributions source package, if available. Go to the section for your distribution first. If that isn't an option, continue to the GCC & Make section.

GCC & Make

Prerequisites

The following programs are required. The versions below are known to compile Ogre 1.0.3. Minor version differences will probably work (ie 3.3 instead of 3.3.5). Later versions will likely work.

    automake      1.9.5    (1.6+ req)
    autoconf      2.59a    (2.50+ req)
    make          3.80
    libtool       1.5.6    (1.4+ req)
    pkg-config    0.17.2
    gcc           3.3.5
    g++           3.3.5
    cpp           3.3.5

Some users have had trouble with gcc 4.0. Ogre compiles fine with it, but there have been other issues during runtime. You can tell which version you have with the following commands. It is highly recommended that you build from the CVS if you have gcc 4.0+.(ubuntu build-essential has 4.1+). This is the only option(from CVS) if OGRE is unable to loadLibrary()'s when you provide absolute paths( try "/usr/local/lib/OGRE/RenderSystem_GL.so" ).

    g++ -v
    gcc -v

The following external libraries are also necessary for building. Some of these can be found under various names depending on your distribution (ie devil vs libdevil). You will need the package that contains development headers in addition to the libraries.

    FreeType2     +2.1.x 
    zziplib       +0.13.x (do not use 0.12.x - causing memory leak)
    FreeImage     http://freeimage.sourceforge.net/
    libpng, libmng, libtiff, libjpeg (for FreeImage)

Optional Libraries

    Cg            (Nvidia's shader library)
    CEGUI         (Gui library)
    Gtkmm2        (For samples config dialog)
    Glademm2      (For samples config dialog)
    libsigc       (for Gtkmm)

Building

  • Go to http://www.ogre3d.org/ and click on More Downloads, then Source Releases: Linux & OSX
  • Download the latest Linux/OSX source package.
    tar xjf ./ogre-linux_osx-v1-0-?.tar.bz2
    cd ogre
    ./bootstrap
    ./configure           (For nvidia, append --with-platform=GLX)
    make
    make install          (run this command as root)
cmake-gui example
cmake-gui example

Since 26.03.2009 ogre trunk (rev. 8444), cmake replaced the above autoconf build system in the following way (Please take a look at Building With CMake for an in-depth guide of the CMake build system with OGRE):

    tar xjf ./ogre-linux_osx-v1-0-?.tar.bz2   (you can also do a svn checkout of the source if preferred)
    cd ogre
    cmake-gui             (see image to the right for steps if unsure)
    make
    make install          (run this command as root if you wish to install ogre, e.g. sudo make install)

You can use make -j <number-of-processes> instead of just make to have multiple files compile in parallel. This can speed the build up considerably if you have a multi-core processor or more than one CPU. It is often recommended that the number of processes be twice the number of available cores, e.g. make -j 4 for a dual-core CPU.


Note (for Ubuntu):

After you run "make," and when you run "make install," and you get an error like this:

    /usr/bin/install: cannot stat `.libs/libOgreMain.lai': No such file or directory

Then you need to:

    cp OgreMain/src/libOgreMain.la OgreMain/src/.libs/libOgreMain.lai
    vi OgreMain/src/.libs/libOgreMain.lai

and change(on line 25) "installed=no" to "installed=yes" (Hint: to change text in vi, press the "insert" key on your keyboard. To save and quit, push and release "Esc" then type ":w", then type ":q", and hit enter). Now just run "sudo make install" again, and you should be good to go.


Make sure each step completes without errors before moving to the next one. Warnings are usually OK. If you get an error, search in the forums for help. Don't ask questions without searching first. Basic questions have already been answered countless times.

Perhaps the best resource for working through an Ogre compilation on linux is this thread. It is about Debian but should be useful to other distributions. An older linux readme file may provide some useful information.

When Ogre has been compiled successfully, the sample applications will be built in the ./ogre/Samples/Common/bin directory.

Debian

If you want to compile OGRE yourself you can use the official tar.bz2 archive, but on Debian systems it's better to use the source package. This way you can obtain .deb packages that will integrate nicely with your system, just like standard binary packages.

Please note that this method requires Debian Etch or later. If you use Sarge or Woody, you must either download and compile the sources from ogre3d.org, or upgrade to Etch or later.

Using the source package

You need to have this line in your /etc/apt/sources.list to get the source packages :

deb-src http://ftp.debian.org/debian unstable main

If needed, update sources:

sudo apt-get update

If you want to compile everything automatically, you only need to type this command :

apt-get source --compile ogre

If you want to use different compilation options or if you need to modify the source before the compilation (by applying patches for example), you can follow these steps :

apt-get source ogre
cd ogre-1.0.4
DEB_BUILD_OPTIONS="insert your options for the configure script here"
fakeroot debian/rules binary

After the compilation, you can install the packages from the parent directory by typing :

dpkg -i *.deb

Using the tar.bz2 archive

If you still want to compile OGRE from the tar.bz2 archive, this command should be able to install all the needed dependencies :

apt-get install g++ gcc cpp make automake1.9 libtool \
   libsdl1.2-dev libdevil-dev libfreetype6-dev libgtkmm2.0-dev \
   libcegui-mk2-0 libcegui-mk2-dev libcegui-mk2-doc libxerces26-dev \
   libpng3-dev libmng-dev libtiff4-dev liblcms1-dev libpng3 libjpeg62-dev \
   libglademm2.0-dev libzzip-dev libxaw7-dev\
   libopenexr-dev libopenexr2 nvidia-cg-toolkit

You'll then be able to proceed with the standard Linux compilation as mentioned previously or you can use Checkinstall, which creates a nice custom debian package for you.

Fedora

Image:fedora.jpg

These instructions have been updated for Ogre 1.6.1 on Fedora 10:

Install the developer tools:

 sudo yum groupinstall "Development Tools"

Enable "free" and "nonfree" repositories from rpmfusion (needed for Cg):

 sudo rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
 sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Install library dependencies:

 sudo yum install zziplib-devel libXt-devel libXaw-devel libXxf86vm-devel \
     xorg-x11-fonts-misc freeimage-devel freetype-devel ois-devel cegui-devel Cg

Build Ogre:

 wget http://downloads.sourceforge.net/ogre/ogre-v1-6-3.tar.bz2
 tar xjf ogre-v1-6-3.tar.bz2
 cd ogre
 ./bootstrap
 ./configure
 make
 sudo make install && sudo /sbin/ldconfig

Older instructions:

The unofficial, but more active community website. FIXED::The only minor problem at the moment with of running OGRE on FC5 is SELinux preventing some modules to function correctly. A quick fix for this problem is:

 setsebool -P allow_execmod=1

This is an OS-related problem and will only occur if you installed 3rd party ATi or nVIDIA graphics card drivers. This will result in OGRE segfaulting.

Quick OGRE installation guide:

 tar xvfj ./ogre-linux_osx-v1-0-?.tar.bz2
 cd ogre
 ./bootstrap
 ./configure           (For nVIDIA cards, append --with-platform=GLX)
 make
 sudo make install
 sudo /sbin/ldconfig

For more details on installing dependencies and the nVIDIA or ATI Radeon drivers on Fedora Core 5 see the Detailed Fedora Walkthrough


Some people have experienced problems when building OGRE V1.4 on Fedora Core 4 : applications linked with OGRE segfault somewhere in libstdc++. The following measures may help to solve the problem :

  • commenting out the following section in configure.in :
AC_LANG_PUSH(C++) 
AC_LIBTOOL_COMPILER_OPTION([if $CXX supports -fvisibility], 
    [ogre_prog_compiler_supports_visibility], 
    [-fvisibility=hidden -fvisibility-inlines-hidden], [], 
    [CFLAGS_VISIBILITY="-fvisibility=hidden -fvisibility-inlines-hidden -DOGRE_GCC_VISIBILITY"; 
    case $target_cpu in 
        x86_64* ) 
            if ! echo "$CFLAGS $CXXFLAGS" | grep -q "\-O"; then 
                echo "***********************************************************************" 
                echo "WARNING: It looks like you're doing a debug build for an x86_64 target." 
                echo "The -fvisibility-inlines-hidden flag is known to give problems in such" 
                echo "situations with libstdc++ < 4.2. Disabling the compiler flag." 
                echo "***********************************************************************" 
                CFLAGS_VISIBILITY="-fvisibility=hidden -DOGRE_GCC_VISIBILITY" 
            fi 
        ;; 
    esac 
    ]) 
 AC_SUBST(CFLAGS_VISIBILITY)
  • ./bootstrap
  • ./configure --without-pic
  • and the usual : make; make install

Gentoo

Ogre is available through portage, although still masked. We will need to adjust our USE flags to get all features.


Type as a root user:

echo "dev-games/cegui ~*" >> /etc/portage/package.keywords
echo "dev-games/ogre  ~*" >> /etc/portage/package.keywords
echo "dev-games/cegui devil doc" >> /etc/portage/package.use
echo "dev-games/ogre  devil doc cg cegui examples" >> /etc/portage/package.use
emerge ogre

And that's it! The rest will be handled by the system. OGRE will be installed into /usr/lib and /usr/include/OGRE.

AMD64

In Gentoo-AMD64 (x86_64) I managed to build Ogre 1.0.6 with these options:

dev-games/cegui-0.4.0  +devil -doc +opengl -xerces-c
dev-games/ogre-1.0.6  +cegui +cg +devil +doc -double-precision -gtk -openexr +opengl +sdl -threads

Ubuntu / Kubuntu

The following guide is for Ubuntu 8.04 and newer. For older versions please go here

Please post feedback in this thread

I will not do a lot of explaining here and will assume that you know what each command does or at least know how to look it up. This is a guide to get you up and running as fast as possible on Ubuntu.

  • Go to some directory you have write access to.
cd ~/Desktop
  • Uncomment all Ubuntu repositories in sources.list.
sudo nano /etc/apt/sources.list
  • Run apt-get update.
sudo apt-get update
  • Install necessary packages.
sudo apt-get install pkg-config build-essential autoconf automake libtool libzzip-dev libxt-dev libxxf86vm-dev \
    libxrandr-dev libfreeimage-dev nvidia-cg-toolkit checkinstall libfreetype6-dev libpcre3-dev libopenexr-dev \
    freeglut-dev mesa-common-dev libtiff4-dev libglademm-2.4-dev libcppunit-dev libxaw7-dev libxaw-headers libois-dev
libxaw-headers is obsolete on Ubuntu 9.04 and can be dropped from the list. UPDATE FOR Karmic: You *must* remove this for Karmic (9.10) because it's gone with the 9.10 release.
A sufficiently recent version of OIS (at least for Ogre 1.6.x) is available in the libois1 and libois-dev packages, and at least for 9.04 and beyond (older Ubuntu versions not tested).
Many of these packages may already be installed, but this list makes sure we've covered all the bases.
  • Setup OIS (Object Oriented Input System) -- note that this is potentially obsoleted if libois-dev and libois1 are present for your distro version:
wget http://downloads.sourceforge.net/wgois/ois_1.2.0.tar.gz
tar xzf ois_1.2.0.tar.gz
pushd ois
aclocal && ./bootstrap && ./configure
make && sudo make install
popd
  • Setup CEGUI (Crazy Eddies GUI System):
wget http://downloads.sourceforge.net/crayzedsgui/CEGUI-0.6.0.tar.gz
tar xzf CEGUI-0.6.0.tar.gz
pushd CEGUI-0.6.0
aclocal && ./bootstrap && ./configure
make && sudo make install
popd
CEGUI-0.6.2 is available and can be used instead, but depending on system configuration you may need to add '#include <algorithm>' to RenderModules/directfbRenderer/directfb-renderer.cpp
  • Setup Ogre3D:
wget http://downloads.sourceforge.net/ogre/ogre-v1-6-3.tar.bz2
tar xjf ogre-v1-6-3.tar.bz2
pushd ogre
aclocal && ./bootstrap && ./configure
make && sudo make install
popd
  • Complete installation:
sudo ldconfig
If during linking your program code, you get an error:
OGRE/GLX/OgreTimerImp.h:33:31: error: OgrePrerequisites.h: No such file or directory
Then add a '../' in the OgreTimerImp.h file so that it reads #include "../OgrePrerequisites.h" to find the file.

If it all ran fine you now have a dirty (but quick) source-compiled installation of Ogre3D, congratulations! The demos are located at <ogre>/Samples/Common/bin/

If during execution you get an error such as:
(0) : fatal error C9999: *** exception during compilation ***
Cg compiler terminated due to fatal error

Then your Cg installation may be too old. Currently this appears to be the case with Ubuntu 9.04, which is providing Cg version 2.0.0015.

To get an updated version of Cg:
Visit the Nvidia download page to get the appropriate architecture: http://developer.nvidia.com/object/cg_download.html
Do not extract the archive. You want to save it as the original .tgz file.

sudo apt-get remove nvidia-cg-toolkit
cd /
sudo tar xzf path/to/Cg-X.X_DATE_ARCH.tgz

You may wish to recompile Ogre to ensure it picks up any changes in the Cg version. (cd ogre; make clean; make; sudo make install)

Enjoy.

Mac OS X

At this time OS X currently only has build support for Xcode.

Personal tools
administration