HOWTOs

From LagoonWiki

(Redirected from SGE)
Jump to: navigation, search

Contents

Python Ogre, CEGUI, OIS, Twisted, yaml, psyco = ECSLent

ECSLent

  • First install python-ogre, cegui, ois (see next section)
  • svn co svn+ssh://cse.unr.edu/staff/sushil/svnroot/trunk/ecslent
  • cd ecslent
  • edit run.sh to set PYTHONPATH and LD_LIBRARY_PATH
  • edit config/plugins.cfg config/resources.cfg to tell ecslent the location of python-ogre and python-ogre data
  • source run.sh or ./run.sh
    • ./run.sh --help for a helpful list of options

Dependencies

ECSLent dependencies

1. YAML, get and install python-yaml (sudo apt-get install python-yaml)

2. Twisted Networking, you will need python twisted (sudo apt-get install python-twisted)

3. Psyco python optimizer to optimize python. Psyco makes a significant difference (sudo apt-get install python-psyco]

Installing Python-ogre

  • Follow the instructions on the Python Ogre Wiki to download, compile, and install python ogre and ogre addons.
  • Follow along below as I keep a log of the step by step instructions. Note that Ubuntu support is very good in that the install scripts use apt-get to get and install missing pieces.

Downloading and building support libraries

Step 0: Create a directory for local install and development

(~/development is good)
    • /scratch/yourName/development would be good on the cse systems

Step 1: Download the current stable version:

Step 2: Ensure that you have prerequisites installed on your system

  • you need sudo

ln -s python-ogre/scripts/00-PreReqs.sh .
sh ./00-PreReqs.sh

Here's what I get on my system, that already has build-tools installed.

The following NEW packages will be installed:
  cvs freeglut3 freeglut3-dev libglew1.5-dev libglut3-dev python-celementtree
0 upgraded, 6 newly installed, 0 to remove and 1 not upgraded.
Need to get 2132kB of archives.
After this operation, 5685kB of additional disk space will be used.

Step 3: "r"etreive the support libraries

python python-ogre/BuildModule.py -r cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus

Note that we are now using "BuildModule" and that these files are downloaded to "~/development/downloads". Boost takes a while.

Step 4: build them

python python-ogre/BuildModule.py -b cmake gccxml boost cg scons freeimage zziplib pygccxml pyplusplus

    • cmake builds fine
    • bjam builds fine
    • boost builds fine
    • cg is a simple untar so no problems
    • scons gives a warning but installs with no problems
    • freeImage builds fine
    • zziplib builds fine
    • pygccxml builds fine
    • pyplusplus build fine

Downloading and building cegui, ois, ogre

  • Note that BuildModule has all the configuration parameters (actually environment.py does, but BuildModule includes environment)


Downloading all three
  • Download cegui, ois, ogre (mutually compatible versions are coded into BuildModule.py)

python python-ogre/BuildModule.py -r cegui ois ogre

ogre-v1-6-3.tar.bz takes a while to download.

  • Note that ~/development/log.out contains the output from the commands (redirected from screen)
Building CEGUI
  • Build cegui

python python-ogre/BuildModule.py -b cegui

Issues with ILvoid, here's the output

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -DUSE_DEVIL_LIBRARY -g -O2 -MT libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.lo -MD -MP -MF .deps/libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.Tpo -c CEGUIDevILImageCodec.cpp  -fPIC -DPIC -o .libs/libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.o
CEGUIDevILImageCodec.cpp: In member function ‘virtual CEGUI::Texture* CEGUI::DevILImageCodec::load(const CEGUI::RawDataContainer&, CEGUI::Texture*)’:
CEGUIDevILImageCodec.cpp:61: error: ‘ILvoid’ was not declared in this scope
CEGUIDevILImageCodec.cpp:61: error: expected primary-expression before ‘)’ token
CEGUIDevILImageCodec.cpp:88: error: expected primary-expression before ‘)’ token
make[2]: *** [libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.lo] Error 1

    • Fix: replace ILvoid with void

Next, we have:

/bin/bash ../../libtool --tag=CXX --mode=link g++  -g -O2   -o libCEGUIDevILImageCodec.la -rpath /flash/projects/gameEngine/development/root/usr/lib  libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.lo libCEGUIDevILImageCodec_la-CEGUIDevILImageCodecModule.lo -lIL -lILU ../../src/libCEGUIBase.la -lglut -lGLU -lGL  -lSM -lICE  
libtool: link: cannot find the library `/usr/lib/liblcms.la' or unhandled argument `/usr/lib/liblcms.la'

    • Fix: sudo apt-get install liblcms1-dev
  • Next:

make[2]: Entering directory `/flash/projects/gameEngine/development/CEGUI-0.6.2/ImageCodecModules/DevILImageCodec'
/bin/bash ../../libtool --tag=CXX --mode=link g++  -g -O2   -o libCEGUIDevILImageCodec.la -rpath /flash/projects/gameEngine/development/root/usr/lib  libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.lo libCEGUIDevILImageCodec_la-CEGUIDevILImageCodecModule.lo -lIL -lILU ../../src/libCEGUIBase.la -lglut -lGLU -lGL  -lSM -lICE  
libtool: link: g++ -shared -nostdlib /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.3/crtbeginS.o  .libs/libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.o .libs/libCEGUIDevILImageCodec_la-CEGUIDevILImageCodecModule.o   -Wl,-rpath -Wl,/flash/projects/gameEngine/development/CEGUI-0.6.2/src/.libs -Wl,-rpath -Wl,/flash/projects/gameEngine/development/root/usr/lib /usr/lib/libILU.so /usr/lib/libIL.so /usr/lib/libtiff.so -lpng12 -lmng /usr/lib/liblcms.so /usr/lib/libjpeg.so ../../src/.libs/libCEGUIBase.so /usr/lib/libfreetype.so -lz -lpcre -lglut -lGLU -lGL -lSM -lICE -L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i486-linux-gnu/4.3.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crtn.o    -Wl,-soname -Wl,libCEGUIDevILImageCodec.so.0 -o .libs/libCEGUIDevILImageCodec.so.0.0.0
/usr/bin/ld: cannot find -lmng

    • Fix: sudo apt-get install libmng-dev
  • Next:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../RendererModules/directfbRenderer -D_REENTRANT -I/usr/include/directfb -g -O2 -MT directfb-renderer.lo -MD -MP -MF .deps/directfb-renderer.Tpo -c directfb-renderer.cpp  -fPIC -DPIC -o .libs/directfb-renderer.o
directfb-renderer.cpp: In member function ‘void CEGUI::DirectfbRenderer::sortQuads()’:
directfb-renderer.cpp:265: error: ‘stable_sort’ is not a member of ‘std’

    • Fix: add "#include <algorithm>" at top of directfb-renderer.cpp
  • That's it for cegui. Once you have made all these fixes. "make" and "make install" should install CEGUI in your development directory.
Building OIS

 python python-ogre/BuildModule.py -b ois

No issues, so on to OGRE

Building Ogre

python python-ogre/BuildModule.py -b ogre

Using the 4 cores
PythonOgre.BuildModule: INFO     Build Command ./bootstrap 
PythonOgre.BuildModule: INFO     Build Command ./configure --prefix=/flash/projects/gameEngine/development/root/usr --includedir=/flash/projects/gameEngine/development/root/usr/include 
PythonOgre.BuildModule: INFO     Build Command make 
PythonOgre.BuildModule: INFO     Build Command make install 
sushil@flash /flash/projects/gameEngine/development > python python-ogre/BuildModule.py -b ogre
Using the 4 cores
PythonOgre.BuildModule: INFO     Build Command tar  jxf /flash/projects/gameEngine/development/downloads/ogre-v1-6-3.tar.bz2 --overwrite 
PythonOgre.BuildModule: INFO     Build Command patch -s -N -i ./python-ogre/patch/ogre_1.6.1.patch -p0  
PythonOgre.BuildModule: WARNING  Task Failed
PythonOgre.BuildModule: INFO     Build Command aclocal 
PythonOgre.BuildModule: INFO     Build Command ./bootstrap 

This takes a while. But ignoring the Warning above is fine. You are done with the first part.

Configuring environment and test OGRE, OIS, CEGUI

  • Create a file called setup.sh and put the following in it:

#!/bin/bash
export TMP=`pwd`
export LD_LIBRARY_PATH=$TMP/root/usr/lib/

Now in the development directory:

source setup.sh


Then cd to ogre/Samples/Common/bin and edit plugins.cfg to look like:


# Defines plugins to load

# Define plugin folder
PluginFolder=/flash/projects/gameEngine/development/root/usr/lib/OGRE

# Define D3D rendering implementation plugin
Plugin=RenderSystem_GL.so
Plugin=Plugin_ParticleFX.so
Plugin=Plugin_BSPSceneManager.so
# to run PCZTestApp comment OctreeSceneManager and uncoment PCZSceneManager & OctreeZone
Plugin=Plugin_OctreeSceneManager.so
#Plugin=libPlugin_PCZSceneManager.so
#Plugin=Plugin_OctreeZone.so
Plugin=Plugin_CgProgramManager.so

Now run the smoke demo

./Smoke

Next step, building Python-ogre!


Building python ogre

-g is generate wrapper, -c is compile, -b install installs the modules


python python-ogre/BuildModule.py -g -c ogre ois cegui
python python-ogre/BuildModule.py -b install

No other problems? ...

Setting up the environment before running demos

  • Create a setup.sh bash script for setting up the environment and put this in the ~/development directory.

setup.sh should contain:


#!/bin/bash

export TMP=`pwd`
echo $TMP

export LD_LIBRARY_PATH=$TMP/root/usr/lib/
export PYTHONPATH="$TMP/root/usr/lib/python2.6/site-packages"

Note: Do NOT put a colon (:) at the end of PYTHONPATH as listed in the original python-ogre wiki installation howto.

  • Edit /<path-to-development-directory>/development/python-ogre/demos/plugins.cfg to contain

# Defines plugins to load
## Use this for Windows
##
## NOTE use this for MacOS or Linux
PluginFolder=/<path-to-development-directory>/development/root/usr/lib/OGRE
Plugin=RenderSystem_GL
Plugin=Plugin_ParticleFX
Plugin=Plugin_BSPSceneManager
Plugin=Plugin_OctreeSceneManager
Plugin=Plugin_CgProgramManager

  • Run the Demo_Grass.py ogre demo
    • cd <path-to-development-directory>/development/python-gre/demos/ogre
    • python Demo_Grass.py
That is it! If you have problems, fix them and document your fix on this wiki
Personal tools