Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44

Thread: HowTo: Install and Use OGRE

  1. #1
    Join Date
    Jun 2008
    Beans
    109
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    HowTo: Install and Use OGRE

    Here's a quick guide I wrote up for installing OGRE on Ubuntu. I hope it's useful.



    1 Installing OGRE

    1.0 Install Dependencies
    Execute the following in a terminal window:
    Code:
    sudo apt-get install build-essential autoconf libtool libdevil-dev libfreeimage-dev libfreetype6-dev libglew1.5-dev libxaw7-dev libxrandr-dev libxt-dev libxxf86vm-dev libzzip-dev
    In case you're curious, the dependencies are as follows:
    Bootstrap: autoconf libtool
    Make: build-essential
    Ogre: libdevil-dev libfreeimage-dev libfreetype6-dev libglew1.5-dev libxaw7-dev libxrandr-dev libxt-dev libxxf86vm-dev libzzip-dev

    1.1 Install OIS
    Go to OIS's download's page: http://sourceforge.net/project/showf...roup_id=149835 and download the latest release. Decompress the file, open a terminal window, and cd to the decompressed folder. Then, in a rather particular order, type:
    Code:
    ./bootstrap
    ./configure
    make
    sudo make install
    1.2 Obtain the OGRE Source
    Download the "Ogre x.x.x Source for Linux / OSX" from http://www.ogre3d.org/download/source where x.x.x is the current distribution number.

    1.3 Create a Permanent Location
    Unlike most source distributions, you can't simply build, install and dispose. The OGRE directory will need to be situated in a place you won't mind having it forever. Personally, I have everything in ~/.ogre, but you can choose your own. If you pick something else, just remember to substitute the location of your permanent folder whenever I say ~/.ogre.

    1.4 Unpack and Relocate
    Unpack the OGRE source using whatever means you choose, and move it to your undislosed permanent location, (~/.ogre).

    1.5 Configure
    Open a terminal window and cd to the OGRE source directory, (~/.ogre/ogre). Now execute the following in the terminal:
    Code:
    ./bootstrap
    Now enter and execute the following:
    Code:
    ./configure
    If configuration fails after telling you to get nVidia's Cg library, then see the next step.

    1.6 Install nVidia Cg libraries
    Note: Do not perform this step if configuration runs successfully.
    Download the "Linux x86" (32-bit) or Linux x86-64" (64-bit) tar files from http://developer.nvidia.com/object/c...html#downloads . Decompress the file to wherever you want, and copy all the files to their appropriate folders on your system.
    After placing the files, you need to reconfigure Ogre:
    Code:
    ./configure
    1.7 Make
    Once configuration has finished, run the following:
    Code:
    make
    Note that this can take a REALLY long time. On my dual core 2Ghz it took nearly an hour. If you want to speed this up, you can run make in multithreaded mode using the following command:
    Code:
    make -j x
    where x is twice the number of cores your computer has.
    WARNING: Do not execute 'make -j', this will run make with an unlimited number of concurrent threads and will overload and freeze your OS within a couple seconds. This is called a makebomb.

    1.8 Install
    Now that everything has (hopefully) been built correctly, you're finally ready to install OGRE. Cross your fingers and type:
    Code:
    sudo make install
    1.9 Update Dynamic Linker
    Now that you've installed everything in its proper place, you need to tell the linker to update it's chaches. Run:
    Code:
    sudo ldconfig


    2 Installing CEGUI [OPTIONAL]

    2.0 Install Dependencies
    Open a terminal window and type:
    Code:
    sudo apt-get install libpcre++-dev libpng12-dev libjpeg62-dev libmng-dev libwxgtk2.8-dev
    Again, if you're curious, here're the dependencies:
    CEGUI: libpcre++-dev
    SILLY: libpng12-dev libjpeg62-dev libmng-dev
    Layout Editor: libwxgtk2.8-dev
    Imageset Editor:

    2.1 Download and Relocate
    Download the current source release of CEGUI, SILLY Image Loading Library, CEGUI Layout Editor, and CEGUI Imageset Editor. Unzip all the packages and move CEGUI-x.x.x, CEImagesetEditor-x.x.x and CELayoutEditor-x.x.x to your permanent location, (~/.ogre).

    2.2 Install SILLY
    Open a terminal window and cd to the SILLY directory. No execute the following commands, one after another.
    Code:
    ./configure
    make
    sudo make install
    You are now free to dispose of the SILLY source directory.

    2.3 Install CEGUI
    Now cd to the CEGUI directory, (~/.ogre/CEGUI-x.x.x) and run the following commands:
    Code:
    ./bootstrap
    ./configure
    make
    sudo make install
    sudo ldconfig
    This build also takes a while, so if you want to use multithreading you can replace 'make' with 'make -j x' like last time.

    2.4 Install CEGUI Layout Editor
    Open a terminal window, cd to the CEGUI Layout Editor directory, (~/.ogre/CELayoutEditor-x.x.x), and enter:
    Code:
    ./configure
    make
    sudo make install
    To run CEGUI Layout Editor, use 'CELayoutEditor'. You can make a launcher for it or add it to your main menu at your leisure.
    The first time you start it, CELE requires you to give it the location of the default datafiles.

    2.5 Install CEGUI Imageset Editor
    To be done...



    3 Installing QuickGUI [OPTIONAL]

    3.0 Install Dependencies
    Open a terminal window and type:
    Code:
    sudo apt-get install cmake
    This is pretty self explanatory and is only for building the library. QuickGUI's only other dependency is Ogre.

    3.1 Download and Relocate
    Obtain QuickGUI from the latest release thread here: http://www.ogre3d.org/addonforums/viewforum.php?f=13 . Extract the source and move it to your Ogre folder, (~/.ogre).

    3.2 Configure
    You may either use Code::Blocks or CMake to build the QuickGUI library. If you are using Code::Blocks, the process is rather self-explanatory.
    Note: Code::Blocks only builds the library, but does not install it. You will have to manually move the dynamic library file (~/.ogre/QuickGUI/bin/libQuickGUI.so) to /usr/local/lib or wherever else you want to put it.
    If, however, you decided to use CMake, cd to the QuickGUI source directory, (~/.ogre/QuickGUI) and type:
    Code:
    cmake .
    Note: if you want to alter the default build options, you can type 'ccmake .' rather than 'cmake .'

    3.3 Build and Install
    Now that CMake has generated the Makefiles for you, you can simply run:
    Code:
    make
    sudo make install
    sudo ldconfig


    4 Installing Bullet

    4.0 Install Dependencies
    Use apt-get to install dependencies:
    Code:
    sudo apt-get install freeglut3-dev
    4.1 Obtain Source
    Download the Bullet source code from here: http://code.google.com/p/bullet/downloads/list . You don't need to keep the Bullet source, so feel free to install it right from your desktop.

    4.2 Make
    Open a terminal to the Bullet source directory and type:
    Code:
    ./autogen.sh
    ./configure
    make -j 4
    4.3 Install
    As of the time of this writing, the install-sh script included with Bullet has incompatible line endings. Download another version from here: http://www.fastcgi.com/devkit/install-sh and replace the one in the Bullet folder. Then you can run:
    Code:
    sudo make install
    sudo ldconfig


    5 Creating an OGRE Project
    Note: I will be using Code::Blocks for these instructions, although they will probably be easily adaptable to other IDEs as well.

    5.1 Create an Empty project
    Open Code::Blocks and select File->New->Project. Choose an Empty Project, (the Ogre Project is broken on Linux), click Go, and choose a location. Leave all the options on the next page default and click Finish.

    5.2 Add Linked Libraries
    In Project->Build Options select the "Linker Settings" tab and add "OgreMain" and "GL" to the "Link Libraries" box.
    Note: Also add "OIS" for OIS, "CEGUI" for CEGUI, "QuickGUI" for QuickGUI depending on which of these additional libraries you will be using. If you are using Bullet, it is absolutely essential that you include "bulletmath", "bulletcollision", and "bulletdynamics" in exactly that order.

    5.3 Setting up your plugins.cfg File
    Create a file named "plugins.cfg" in the directory your project's executable will reside in. At the very minimum, this should include the following:
    Code:
    PluginFolder=/usr/local/lib/OGRE
    Plugin=RenderSystem_GL.so
    Plugin=Plugin_OctreeSceneManager.so
    5.4 Using the Example Application [OPTIONAL]
    If you are doing the tutorials or otherwise basing your project on the Example Application framework included with the OGRE source, you must copy the Samples/Media, and the Samples/Common/include/* from your OGRE source directory, (~/.ogre/ogre), to your project directory and your project include directory respectively. Finally, you should also copy Samples/Common/bin/resources.cfg file to your project's build directory and replace all '../../'s with the appropriate path to your media directory. Also remember to add
    Code:
    #include "ExampleApplication.h"
    to your main Ogre file, and you should hopefully be good to go.



    Once you have all this done, you should finally be able to follow the generic instructions on the Wiki. I hope somebody finds these instructions helpful. The whole installation process was hellishly time consuming and frustrating for me, and I hope this makes that slightly better.

    -Calder
    Last edited by CalderCoalson; February 4th, 2010 at 06:31 AM.

  2. #2
    Join Date
    Apr 2006
    Location
    Seattle
    Beans
    2,893
    Distro
    Ubuntu Development Release

    Re: HowTo: Install and Use OGRE

    Approved and thank you for your tutorial contribution. I'm curious though, why do you choose to download & install from source instead of using the version of OGRE in the repositories? I've never personally had any problems with the packaged framework, but it's been a while since I've used it.

  3. #3
    Join Date
    Jun 2008
    Beans
    109
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Install and Use OGRE

    The package version is old and hasn't been updated in nearly a year. This also allows you to compile a lot of the newer versions of plug-ins, as well as actually understand what's going on with the library. I don't remember the specifics, but I had a rather horrible time trying to get OGRE working with a lot of the plug-ins I wanted to use with the repository version. Also, as a matter of principle, I prefer building from source when you're going to be developing with something. End-user packages are one thing, but for developers source builds are kinda nice.
    Last edited by CalderCoalson; September 2nd, 2009 at 12:21 AM.

  4. #4
    Join Date
    Aug 2006
    Location
    Cedar Rapids
    Beans
    45
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Install and Use OGRE

    Thanks for your tutorial . I'll give it a try tonight and give you some feedback.

  5. #5
    Join Date
    Aug 2006
    Location
    Cedar Rapids
    Beans
    45
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Install and Use OGRE



    It works! At least the directions for installing Ogre3D worked as I was able to run a couple of the sample demos successfully. I haven't tried the directions to install the optional stuff. And also I still need to try compile a demo myself with CodeBlocks just be sure, but it should be ok.

    I'm curious about something though. Is the default behaviour of the autotool to configure against the GLX plattform. In other words would this be redundant:
    Code:
    ./configure \--with-platform=GLX
    At the beginning, I tried the previous command with GTK but make failed at some point so I ended up just using ./configure like you said.

    Thanks again man! Your post surely made my life easier.

  6. #6
    Join Date
    Jun 2008
    Beans
    109
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Install and Use OGRE

    That's a good question, and one I'm unfortunately ignorant of the answer to. I can tell you that on my system with an nVidia graphics card, the --with-platform=GLX option was automatically assumed, so I didn't think to include it in the tutorial. I'm not what situations or systems would require manual configuration of the with-platform option, but of the two systems I have installed on, both have chosen correctly.

  7. #7
    Join Date
    Aug 2006
    Location
    Cedar Rapids
    Beans
    45
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Install and Use OGRE

    Hey Calder,

    The how-to compile part of your tutorial is very accurate. It worked for me also. Another alternative for setting up an ogre project can be found here http://www.plasticboy.de/2009/06/22/...1/#comment-269. But I like yours better because you showed how to create your own plugins.cfg file.

    Now its time for me to start playing around with ogre.
    Thanks again

  8. #8
    Join Date
    Jun 2008
    Beans
    109
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Install and Use OGRE

    The distinction is between copying your build to the Ogre directory or copying the resources from the Ogre directory to your project. The latter seems more versatile and shows people what's actually going on, so I chose that.

  9. #9
    Join Date
    Aug 2006
    Location
    Cedar Rapids
    Beans
    45
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Install and Use OGRE

    Hey Calder, it's me again.

    I install ogre on another computer running ubuntu 9.04 as well (using your tutorial) but this time I paid more attention to the config summary that ./configure spits out. I noticed that CEGUI demos were not going to be built.
    Here take a look:

    Code:
    --------=== Configuration summary ===--------
        Target platform                 : GLX
        OpenGL Ogre support             : GLX
        GUI library to use              : Xt
        Use double precision arithmetic : no
        Support for threading           : no
        Memory allocator                : ned
        Use STLport                     : no
        Use FreeType                    : yes
        Use FreeImage                   : yes
        Use DevIL                       : no
        Build OGRE demos                : yes
        Build CEGUI demos               : false
        Build the OpenEXR plugin        : no
        Build the Cg plugin             : yes
        Build the DirectX 9 plugin      : no
    --------===============================--------
    So I decided to fix that. Below, I describe the steps I took to have those demos working.

    Basically you need to build DEVIL and CEGUI from source. You can get the latest tarballs from here and here respectively

    Before you compile make sure you uninstall the following packages
    libdevilc2
    libdevil-dev

    Now, because I wanted to make sure I had all the dependencies before trying to compile both projects I checked out the packages suggested at this wiki and compared them with the ones you suggested. Turns out there are some packages that are not repeated but I don't know how much difference they make. At least i tried them and they didn't broke anything

    Code:
    sudo apt-get install pkg-config automake checkinstall libpcre3-dev ibopenexr-dev freeglut-dev mesa-common-dev libtiff4-dev libglademm-2.4-dev libcppunit-dev libxaw7-dev
    These are some I tried on my own but I'm still not really sure if they make a difference or not. Try without them first

    Code:
    pkg-config freetype2-demos zziplib-bin libmng-dev libtiff-doc libmetacity-dev
    Then go to Synaptic and make sure you have all of the following installed (as this will enable sdl support in devil)
    libsdl-1.2debian
    libsdl-1.2debian-alsa
    libsdl-1.2dev
    libsdl-image1.2
    libsdl-image1.2-dev
    libsdl-mixer1.2
    libsdl-mixer1.2-dev
    libsdl-net1.2
    libsdl-net1.2-dev

    once you are in the directory where you unpacked the DEVIL source

    Code:
    autoreconf -i
    ./configure --enable-ILU --enable-ILUT --with-examples 
    make
    sudo make install
    ldconfigq
    This should take care of DEVIL. Now to install CEGUI go to the CEGUI where you unpacked the source and type

    Code:
    aclocal && ./bootstrap && ./configure --with-default-xml-parser=TinyXMLParser
    make
    If make doesn't complete successfully because a strange compilation error related to ILVoid try the following fix:

    in CEGUI-0.6.2/ImageCodecModules/DevILImageCodec/CEGUIDevILImageCodec.cpp
    replace all instances of ILvoid with void (I found two)

    after that

    Code:
    sudo make install
    This should take care of CEGUI

    finally install ogre (again type the following in the dir where you unpacked the ogre tarball)

    Code:
    aclocal
    ./bootstrap
    ./configure
    make
    sudo make install
    sudo ldconfig
    After the ./configure you should have CEGUI demos enabled.

    Code:
    --------=== Configuration summary ===--------
        Target platform                 : GLX
        OpenGL Ogre support             : GLX
        GUI library to use              : Xt
        Use double precision arithmetic : no
        Support for threading           : no
        Memory allocator                : ned
        Use STLport                     : no
        Use FreeType                    : yes
        Use FreeImage                   : yes
        Use DevIL                       : no
        Build OGRE demos                : yes
        Build CEGUI demos               : true
        Build the OpenEXR plugin        : no
        Build the Cg plugin             : yes
        Build the DirectX 9 plugin      : no
    --------===============================--------
    However, there is something that still bothers me and that is the line
    Use DevIL : no
    I don't know how come. I was able to build DEVIL succesfully so I don't know why ogre's autoconfigure tool can't find DEVIL. For that I'm going to ask for some help here in the forum.

    But I can still build ogre successfully and all the demos seem to work fine
    Hope this can be helpful to someone out there.

  10. #10
    Join Date
    Jun 2008
    Beans
    109
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Install and Use OGRE

    Is there any specific reason you wanted to build Devil from source? And did you try my instructions for installing CEGUI first, to compare? If those failed, please post while and I'll try and figure it out. Simply building and installing CEGUI and then rebuilding Ogre did the trick for me, but did you at least try it so we can be sure it didn't work before we start figuring out why? Also, I know CEGUI is kindof the monolithic standard because it was the ONLY GUI system for Ogre for a while, but personally I find QuickGUI's API and especially skinning method infinitely clearer.

Page 1 of 5 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •