OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: Building From Source - Linux - Shoggoth
View page
Source of version: 20
(current)
%prevogre% {DIV(class="Layout_box5")}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, use the GCC & Make section.{DIV} {maketoc} !!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. {CODE(wrap="1")} 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 {CODE} 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" ). {CODE(wrap="1")} g++ -v gcc -v {CODE} 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. {CODE(wrap="1")} FreeType2 +2.1.x zziplib +0.13.x (do not use 0.12.x - [http://www.ogre3d.org/phpBB2/viewtopic.php?t=34751 causing memory leak]) FreeImage http://freeimage.sourceforge.net/ libpng, libmng, libtiff, libjpeg (for FreeImage) {CODE} Optional Libraries {CODE(wrap="1")} Cg (Nvidia's shader library) CEGUI (Gui library) Gtkmm2 (For samples config dialog) Glademm2 (For samples config dialog) libsigc (for Gtkmm) {CODE} !!!Building * Go to [http://www.ogre3d.org/] and click on ''More Downloads'', then ''Source Releases: Linux & OSX'' * Download the latest Linux/OSX source package. {CODE(wrap="1", colors="bash")} 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) {CODE} {img src="img/wiki_up/Ogrecmake.jpg" alt="thumb|cmake-gui example" width="200"} 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 Ogre)) for an in-depth guide of the CMake build system with OGRE): {CODE(wrap="1", colors="bash")} tar xjf ./ogre-linux_osx-v1-0-?.tar.bz2 ([http://www.ogre3d.org/developers/subversion 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) {CODE} You can use {MONO()}make -j <number-of-processes>{MONO} 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. {MONO()}make -j 4{MONO} for a dual-core CPU. Note (for Ubuntu): After you run "{MONO()}make{MONO}," and when you run "{MONO()}make install{MONO}," and you get an error like this: {CODE(wrap="1", colors="bash")} /usr/bin/install: cannot stat `.libs/libOgreMain.lai': No such file or directory {CODE} Then you need to: {CODE(wrap="1", colors="bash")} cp OgreMain/src/libOgreMain.la OgreMain/src/.libs/libOgreMain.lai vi OgreMain/src/.libs/libOgreMain.lai {CODE} and change(on line 25) "{MONO()}installed=no{MONO}" to "{MONO()}installed=yes{MONO}" (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, [http://www.ogre3d.org/phpBB2/search.php|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 [http://www.ogre3d.org/phpBB2/viewtopic.php?t=5706|this thread]. It is about Debian but should be useful to other distributions. An older [http://www.ogre3d.org/docs/README.linux|linux readme file] may provide some useful information. When Ogre has been compiled successfully, the sample applications will be built in the ''{MONO()}./ogre/Samples/Common/bin{MONO}'' directory. --- !!Debian {img src="img/wiki_up/Debian_logo.png" alt="" align="left"}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. %clear% !!!Using the source package You need to have this line in your ''/etc/apt/sources.list'' to get the source packages : {CODE(wrap="1", colors="bash")}deb-src http://ftp.debian.org/debian unstable main{CODE} If needed, update sources: {CODE(wrap="1", colors="bash")}sudo apt-get update{CODE} If you want to compile everything automatically, you only need to type this command : {CODE(wrap="1", colors="bash")} apt-get source --compile ogre {CODE} 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 : {CODE(wrap="1", colors="bash")}apt-get source ogre cd ogre-1.0.4 DEB_BUILD_OPTIONS="insert your options for the configure script here" fakeroot debian/rules binary{CODE} After the compilation, you can install the packages from the parent directory by typing : {CODE(wrap="1", colors="bash")} dpkg -i *.deb {CODE} !!!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 : {CODE(wrap="1", colors="bash")} 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{CODE} 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 {img src="img/wiki_up/Fedora.jpg" alt="fedora.jpg"} These instructions have been updated for Ogre 1.6.1 on Fedora 10: Install the developer tools: {CODE(wrap="1", colors="bash")} sudo yum groupinstall "Development Tools" {CODE} Enable "free" and "nonfree" repositories from rpmfusion (needed for Cg): {CODE(wrap="1", colors="bash")} 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 {CODE} Install library dependencies: {CODE(wrap="1", colors="bash")} sudo yum install zziplib-devel libXt-devel libXaw-devel libXxf86vm-devel xorg-x11-fonts-misc freeimage-devel freetype-devel ois-devel cegui-devel Cg {CODE} Build Ogre: {CODE(wrap="1", colors="bash")} 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 {CODE} !!!!-Older Fedora instructions {DIV(type="span", class="nxOgre_sup")}(Click the ''+'' sign to view){DIV} The unofficial, but more active community [http://fedoraproject.org/wiki/|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: {CODE(wrap="1")} setsebool -P allow_execmod=1{CODE} 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: {CODE(wrap="1", colors="bash")} 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 {CODE} 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 : {CODE(wrap="1", colors="make")} 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) {CODE} * ./bootstrap * ./configure __--without-pic__ * and the usual : make; make install !!! --- !![http://www.gentoo.org|Gentoo] {img src="img/wiki_up/Gentoo-logo.png" alt="" align="left"} 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: {CODE(wrap="1", colors="bash")} 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{CODE} 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: {CODE(wrap="1", colors="bash")} 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 {CODE} --- !!Ubuntu / Kubuntu {img src="img/wiki_up/Ubuntu_logo.png" alt="" align="left"}The following guide is for __Ubuntu 8.04 and newer__. For older versions please go ((FromSourceUbuntu|here)) __Please post feedback in this [http://www.ogre3d.org/phpBB2/viewtopic.php?t=40991|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. {CODE(wrap="1", colors="bash")} cd ~/Desktop {CODE} * Uncomment all Ubuntu repositories in sources.list. {CODE(wrap="1", colors="bash")} sudo nano /etc/apt/sources.list {CODE} * Run apt-get update. {CODE(wrap="1", colors="bash")} sudo apt-get update {CODE} * Install necessary packages. {CODE(wrap="1", colors="bash")} 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{CODE} {DL()} ''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. {DL} * Setup OIS (Object Oriented Input System) -- note that this is potentially obsoleted if libois-dev and libois1 are present for your distro version: {CODE(wrap="1", colors="bash")} 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 {CODE} * Setup CEGUI (Crazy Eddies GUI System): {CODE(wrap="1", colors="bash")} 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{CODE} {DL()} CEGUI-0.6.2 is available and can be used instead, but depending on system configuration you may need to add ~np~'#include <algorithm>'~/np~ to ~np~RenderModules/directfbRenderer/directfb-renderer.cpp~/np~ {DL} * Setup Ogre3D: {CODE(wrap="1", colors="bash")} 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 {CODE} * Complete installation: {CODE(wrap="1", colors="bash")} sudo ldconfig {CODE} {DL()} If during linking your program code, you get an error: ''~np~OGRE/GLX/OgreTimerImp.h:33:31: error: OgrePrerequisites.h: No such file or directory~/np~'' Then add a __ '../' __ in the OgreTimerImp.h file so that it reads ''~np~#include "__../__OgrePrerequisites.h~/np~'' to find the file. {DL} If it all ran fine you now have a dirty (but quick) source-compiled installation of Ogre3D, congratulations! The demos are located at ''~np~<ogre>/Samples/Common/bin/~/np~'' If during execution you get an error such as: {CODE(wrap="1", colors="bash")}(0) : fatal error C9999: *** exception during compilation *** Cg compiler terminated due to fatal error{CODE} 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. {CODE(wrap="1", colors="bash")} sudo apt-get remove nvidia-cg-toolkit cd / sudo tar xzf path/to/Cg-X.X_DATE_ARCH.tgz{CODE} You may wish to recompile Ogre to ensure it picks up any changes in the Cg version. ("~np~cd ogre; make clean; make; sudo make install~/np~") Enjoy.
Search by Tags
Search Wiki by Freetags
Latest Changes
One Function Ogre
IDE Eclipse
FMOD SoundManager
HDRlib
Building Ogre V2 with CMake
Ogre 2.1 FAQ
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
...more
Search
Find
Advanced
Search Help
Online Users
359 online users