Bootstrapping 1.7.0RC1 on Linux

Problems building or running the engine, queries about how to use features etc.
Post Reply
peters
Gnoblar
Posts: 3
Joined: Sat Jan 09, 2010 4:20 pm

Bootstrapping 1.7.0RC1 on Linux

Post by peters »

Hello.

I am a newcomer to Ogre3D and have had some trouble getting up and running to where I can build applications. I am running Gentoo Linux with gcc 4.3.4. Here is what I have done and where I have gotten stuck:
  1. I downloaded, compiled, and installed the 1.7.0RC1 source release with no problems following the wiki instructions
  2. Set up an environment variable pointing to the ogre folder extracted from the source release. (The Wiki says to point it at the 'ogrenew' folder, but then I saw an old post on the forum that said 'ogrenew' isn't used anymore... looks like the wiki needs an update?)

    Code: Select all

    peter@i7beast ~/gamedev $ env | grep OGRE
    OGRE_SRC=/home/peter/gamedev/ogre-source/ogre
  3. Set up the SampleApp project following the instructions from the wiki, which involved
    • copying some headers from $OGRE_SRC/Samples/Common/include to the application's include folder
    • creating the SampleApp.cpp within the application's src folder
    • creating the CMakeLists.txt within the application's folder. (I am willing to try other build setups, but I figured since Ogre uses cmake, I might as well also)

      Code: Select all

      peter@i7beast ~/gamedev/00_baseOgreProject $ ls . include/ src/
      .:
      CMakeCache.txt  CMakeFiles  CMakeLists.txt  Makefile  cmake_install.cmake  include  src
      
      include/:
      ExampleApplication.h  ExampleFrameListener.h
      
      src/:
      SampleApp.cpp
      
    • Running cmake looks OK

      Code: Select all

      peter@i7beast ~/gamedev/00_baseOgreProject $ cmake .
      -- Looking for OGRE...
      -- Found Ogre Cthugha (1.7.0)
      -- Found OGRE: optimized;/usr/local/lib64/libOgreMain.so;debug;/usr/local/lib64/libOgreMain.so
      -- Looking for OGRE_Paging...
      -- Found OGRE_Paging: optimized;/usr/local/lib64/libOgrePaging.so;debug;/usr/local/lib64/libOgrePaging.so
      -- Looking for OGRE_Terrain...
      -- Found OGRE_Terrain: optimized;/usr/local/lib64/libOgreTerrain.so;debug;/usr/local/lib64/libOgreTerrain.so
      -- Looking for OGRE_Property...
      -- Found OGRE_Property: optimized;/usr/local/lib64/libOgreProperty.so;debug;/usr/local/lib64/libOgreProperty.so
      -- Looking for OGRE_RTShaderSystem...
      -- Found OGRE_RTShaderSystem: optimized;/usr/local/lib64/libOgreRTShaderSystem.so;debug;/usr/local/lib64/libOgreRTShaderSystem.so
      -- Looking for OIS...
      -- Found OIS: optimized;/usr/lib64/libOIS.so;debug;/usr/lib64/libOIS.so
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /home/peter/gamedev/00_baseOgreProject
    • make looks OK

      Code: Select all

      peter@i7beast ~/gamedev/00_baseOgreProject $ make
      [100%] Building CXX object CMakeFiles/SampleApp.dir/src/SampleApp.cpp.o
      Linking CXX executable SampleApp
      [100%] Built target SampleApp
      
    • Executing SampleApp fails (but I fixed it -- keep reading)

      Code: Select all

      ...
      plugins.cfg not found, automatic plugin loading disabled.
      *-*-* OGRE Initialising
      *-*-* Version 1.7.0RC1 (Cthugha)
      Exception:
      OGRE EXCEPTION(6:FileNotFoundException): 'resources.cfg' file not found! in ConfigFile::load at /home/peter/gamedev/ogre/ogre/OgreMain/src/OgreConfigFile.cpp (line 83)
      *-*-* OGRE Shutdown
      ...
      
      I remember the wiki saying I needed some cfg files, but with no additional explanation... I found them installed in /usr/local/bin, so I copied them to the application folder and took a look at them. I changed PluginFolder within plugins.cfg because the original used a relative path (that didn't exist!). I then also manually changed all relative paths in resources.cfg to absolute paths. At this point I was thinking, I must be doing this wrong (more on this later).

      Code: Select all

      [plugins.cfg]
      # Define plugin folder
      PluginFolder=/usr/local/lib/OGRE
      ...
      
      [resources.cfg]
      # Resources required by the sample browser and most samples.
      [Essential]
      Zip=/home/peter/gamedev/ogre-source/ogre/Samples/Media/packs/SdkTrays.zip
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/thumbnails
      
      # Common sample resources needed by many of the samples.
      # Rarely used resources should be separately loaded by the
      # samples which require them.
      [Popular]
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/fonts
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/materials/programs
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/materials/scripts
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/materials/textures
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/materials/textures/nvidia
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/models
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/particle
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/DeferredShadingMedia
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/PCZAppMedia
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media/RTShaderLib
      Zip=/home/peter/gamedev/ogre-source/ogre/Samples/Media/packs/cubemap.zip
      Zip=/home/peter/gamedev/ogre-source/ogre/Samples/Media/packs/cubemapsJS.zip
      Zip=/home/peter/gamedev/ogre-source/ogre/Samples/Media/packs/dragon.zip
      Zip=/home/peter/gamedev/ogre-source/ogre/Samples/Media/packs/fresneldemo.zip
      Zip=/home/peter/gamedev/ogre-source/ogre/Samples/Media/packs/ogretestmap.zip
      Zip=/home/peter/gamedev/ogre-source/ogre/Samples/Media/packs/ogredance.zip
      Zip=/home/peter/gamedev/ogre-source/ogre/Samples/Media/packs/skybox.zip
      
      [General]
      FileSystem=/home/peter/gamedev/ogre-source/ogre/Samples/Media
      
    • Running SampleApp then yielded:
      Image
Not sure what to do from here. I am running xmonad and my results are pretty ugly, but I am not sure what to expect from this 'SampleApp'. I haven't read any of the documentation on actually programming something with Ogre, but I am curious if I am on the right track or if I should be expecting something... a little nicer looking. Moving the window off the screen fills it with uncleared copies of things (which may be expected?). I also suspect I am loading a whole bunch of resources that I don't need.

more on the installer... I installed Ogre3D using the quick start guide which basically just tells you to cmake and then make. What it didn't tell me is that this would NOT install the samples and media content that I would need(?) in order to build the SampleApp. Looking at the installed /usr/local/bin/*.cfg was confusing as the locations point to relative paths (under ../share) that didn't exist. I went back and changed the following build options to TRUE within $OGRE_SRC/CMakeLists.txt, and reinstalled Ogre.

Code: Select all

option(OGRE_INSTALL_PLUGINS_HEADERS "Install header files for Ogre plugins." TRUE)
option(OGRE_INSTALL_SAMPLES "Install Ogre demos." TRUE)
option(OGRE_INSTALL_DOCS "Install documentation." TRUE)
option(OGRE_INSTALL_MEDIA "Install media files." TRUE)
option(OGRE_INSTALL_SAMPLES_SOURCE "Install samples source files." TRUE)
Now I actually had some things within /usr/local/share/OGRE to work with. I went back and updated the plugins and resources.cfg from within the SampleApp application folder to point to the globally installed locations because that makes more sense to me.

latest resources.cfg

Code: Select all

# Resources required by the sample browser and most samples.
[Essential]
Zip=/usr/local/share/OGRE/media/packs/SdkTrays.zip
FileSystem=/usr/local/share/OGRE/media/thumbnails

# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[Popular]
FileSystem=/usr/local/share/OGRE/media/fonts
FileSystem=/usr/local/share/OGRE/media/materials/programs
FileSystem=/usr/local/share/OGRE/media/materials/scripts
FileSystem=/usr/local/share/OGRE/media/materials/textures
FileSystem=/usr/local/share/OGRE/media/materials/textures/nvidia
FileSystem=/usr/local/share/OGRE/media/models
FileSystem=/usr/local/share/OGRE/media/particle
FileSystem=/usr/local/share/OGRE/media/DeferredShadingMedia
FileSystem=/usr/local/share/OGRE/media/PCZAppMedia
FileSystem=/usr/local/share/OGRE/media/RTShaderLib
Zip=/usr/local/share/OGRE/media/packs/cubemap.zip
Zip=/usr/local/share/OGRE/media/packs/cubemapsJS.zip
Zip=/usr/local/share/OGRE/media/packs/dragon.zip
Zip=/usr/local/share/OGRE/media/packs/fresneldemo.zip
Zip=/usr/local/share/OGRE/media/packs/ogretestmap.zip
Zip=/usr/local/share/OGRE/media/packs/ogredance.zip
Zip=/usr/local/share/OGRE/media/packs/skybox.zip

[General]
FileSystem=/usr/local/share/OGRE/media
Everything worked, but I am not really confident that I am on the right track. I don't mind the above learning process to get going because if Ogre jives with what I need then it will be invaluable to future projects. So.... it looks like SampleApp should be a gui that then goes to a blank window which exits upon an escape keypress? If so, should I be expecting a better looking gui dialog before I get to the blank screen part? Also, where should I go from here, the Ogre tutorials on the wiki?

Thanks for reading. Comments/suggestions appreciated.
User avatar
Svenstaro
Greenskin
Posts: 115
Joined: Fri Dec 15, 2006 1:30 pm
Location: Germany
x 3
Contact:

Re: Bootstrapping 1.7.0RC1 on Linux

Post by Svenstaro »

See here for my Arch Linux PKGBUILD for Ogre. You should be able to easily get all the listed deps and follow the steps on your Gentoo system as it really is just a bunch of shell script. You should probably also poke your Ogre ebuild maintainer.
mukik182
Halfling
Posts: 68
Joined: Mon Nov 09, 2009 10:30 pm
Location: Barcelona, Spain
x 1

Re: Bootstrapping 1.7.0RC1 on Linux

Post by mukik182 »

Also, instead of changing the cmake files try using either cmake-gui (graphical configurator) or ccmake (ncurses configurator) so you can see all options and turn on/off whatever you like.

I'm not sure if you referred to this, Ogre Samples are actually seen by SampleBrowser which is a graphical application to show you a menu with all samples and you select which you like to use.

If you aren't trying to build your own application yet, you can view the samples without installing, only compiling (I suppose you already knew that, but if someone google's this up...).
peters
Gnoblar
Posts: 3
Joined: Sat Jan 09, 2010 4:20 pm

Re: Bootstrapping 1.7.0RC1 on Linux

Post by peters »

Thank you for the replies. I am just now catching up.
Svenstaro wrote:See here for my Arch Linux PKGBUILD for Ogre. You should be able to easily get all the listed deps and follow the steps on your Gentoo system as it really is just a bunch of shell script. You should probably also poke your Ogre ebuild maintainer.
Interesting. I noticed the sed line :-). Thanks for contributing to the Arch community. I've got Arch installed on another partition, but X hard freezes (I think I have bad luck!). Anyhow, on Gentoo as you probably noticed the stable release is 1.4.9 and the unstable is 1.6.3. I prefer to have newer versions, and with the switch to cmake, I would rather learn how the puzzle pieces fit together once.
mukik182 wrote:Also, instead of changing the cmake files try using either cmake-gui (graphical configurator) or ccmake (ncurses configurator) so you can see all options and turn on/off whatever you like.
I didn't mind editing the CMakeLists.txt by hand, but ccmake is definitely the way to go now that I know about it!
mukiki182 wrote: I'm not sure if you referred to this, Ogre Samples are actually seen by SampleBrowser which is a graphical application to show you a menu with all samples and you select which you like to use.
If you aren't trying to build your own application yet, you can view the samples without installing, only compiling (I suppose you already knew that, but if someone google's this up...).
I want to be able to build a simple application and then start learning the code. The SampleBrowser and SampleApp that I have run so far produce different erroneous behavior I am working through at the moment.

Sidenote: Once I got past some of the initial errors discussed in the original post, I noticed my Ogre.log file was blowing up. I saw a 10Mb log file after running SampleApp for a few seconds. Searching around on the forums here, I discovered that my app couldn't find OgreCore.zip. I copied one of the two OgreCore.zip files from within the source directory to /usr/local/share/OGRE/media/packs, and then added an reference to it within the resources.cfg file.

Now, I am stuck on the following error about a missing png codec (which probably explains why I am seeing garbage):

Code: Select all

22:08:22: OGRE EXCEPTION(5:ItemIdentityException): Can not find codec for 'png' image format.
Supported formats are: dds. in Codec::getCodec at /home/peter/gamedev/ogre-source/ogre/OgreMain/src/OgreCodec.cpp (line 69)
22:08:22: Error loading texture sdk_cursor.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(5:ItemIdentityException): Can not find codec for 'png' image format.
Supported formats are: dds. in Codec::getCodec at /home/peter/gamedev/ogre-source/ogre/OgreMain/src/OgreCodec.cpp (line 69)
I am also seeing, but less concerned about:

Code: Select all

22:08:22: Font SdkTrays/Valueusing texture size 512x256
22:08:22: Info: Freetype returned null for character 127 in font SdkTrays/Value
22:08:22: Info: Freetype returned null for character 128 in font SdkTrays/Value
I am looking at the output of cmake, the PKGBUILD, and ebuilds to see what I am missing as a starting point for moving forward. Will update this thread as I get closer to my goal of being able to read and write code instead of debug my installation.

Thanks
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Re: Bootstrapping 1.7.0RC1 on Linux

Post by dermont »

From the problems you posted it looks like you are missing a dependency, namely FreeImage.
http://freeimage.sourceforge.net/
peters
Gnoblar
Posts: 3
Joined: Sat Jan 09, 2010 4:20 pm

Re: Bootstrapping 1.7.0RC1 on Linux

Post by peters »

dermont wrote:From the problems you posted it looks like you are missing a dependency, namely FreeImage.
http://freeimage.sourceforge.net/
Yup, I am missing a couple of other things as well (on Gentoo). Rather than work on dependencies today, I fixed my Arch xorg issues and then installed Ogre 1.7 via Svenstaro's nice AUR package. I just played around with the SampleBrowser, and it is very impressive! I'm looking forward to learning. At some point, I will go back and fix my Ogre install on Gentoo and update this thread, but for now, SampleBrowser is more fun!

Thanks to all for the help.
User avatar
Svenstaro
Greenskin
Posts: 115
Joined: Fri Dec 15, 2006 1:30 pm
Location: Germany
x 3
Contact:

Re: Bootstrapping 1.7.0RC1 on Linux

Post by Svenstaro »

Make sure to contribute the Ebuild to Gentoo.
cyborgmuppet
Gnoblar
Posts: 7
Joined: Sat May 10, 2014 11:52 pm

Re: Bootstrapping 1.7.0RC1 on Linux

Post by cyborgmuppet »

seems like you have the config files located wrong. they must be in teh top folder to work for some reason...
Post Reply