Building PyOgre 1.2 on Debian Unstable

Scramblejams

12-11-2006 01:16:17

Hi all, I'm new at this. I installed CEGUI 0.4.1 from Debian's unstable binary respository, then I compiled and installed Ogre 1.2.3, and then tried to build PyOgre 1.2.0 dev, and it stopped here:

[steve@lothar:~/dev/sim/pyogre/dev-1.2.0]$ python setup.py build
running build
running build_ext
building 'pyogre._cegui' extension
skipping pyogre/cegui/cegui.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/OGRE -I/usr/local/include -I/usr/include/CEGUI -I/usr/include/python2.4 -c pyogre/cegui/cegui_wrap.cxx -o build/temp.linux-i686-2.4/pyogre/cegui/cegui_wrap.o -DEXT_HASH
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
pyogre/cegui/cegui_wrap.cxx: In function 'int Real_To_Tuple(const Ogre::Real*, PyObject*, int)':
pyogre/cegui/cegui_wrap.cxx:3265: warning: unused variable 'toReturn'
pyogre/cegui/cegui_wrap.cxx: At global scope:
pyogre/cegui/cegui_wrap.cxx:3651: error: extra qualification 'EventCallback::' on member 'operator='
pyogre/cegui/cegui_wrap.cxx: In constructor 'EventCallback::EventCallback(PyObject*)':
pyogre/cegui/cegui_wrap.cxx:3726: warning: 'EventCallback::mSubscriber' will be initialized after
pyogre/cegui/cegui_wrap.cxx:3725: warning: 'swig_type_info* EventCallback::mType'
pyogre/cegui/cegui_wrap.cxx:3636: warning: when initialized here
pyogre/cegui/cegui_wrap.cxx: In copy constructor 'EventCallback::EventCallback(const EventCallback&)':
pyogre/cegui/cegui_wrap.cxx:3726: warning: 'EventCallback::mSubscriber' will be initialized after
pyogre/cegui/cegui_wrap.cxx:3725: warning: 'swig_type_info* EventCallback::mType'
pyogre/cegui/cegui_wrap.cxx:3645: warning: when initialized here
pyogre/cegui/cegui_wrap.cxx: In function 'const CEGUI::String& CEGUI_Window_tooltipType_get(CEGUI::Window*)':
pyogre/cegui/cegui_wrap.cxx:4088: warning: returning reference to temporary
pyogre/cegui/cegui_wrap.cxx: In function 'const CEGUI::UVector2& CEGUI_Window_windowSize_get(CEGUI::Window*)':
pyogre/cegui/cegui_wrap.cxx:4098: warning: returning reference to temporary
pyogre/cegui/cegui_wrap.cxx: At global scope:
pyogre/cegui/cegui_wrap.cxx:3263: warning: 'int Real_To_Tuple(const Ogre::Real*, PyObject*, int)' defined but not used
pyogre/cegui/cegui_wrap.cxx:3276: warning: 'int Tuple_To_Real(Ogre::Real*, PyObject*, int)' defined but not used
error: command 'gcc' failed with exit status 1

Could it be I need to compile and install CEGUI 0.5.0 instead? Getting Dagon compiled took the better part of the afternoon, so I'd like to have someone tell me that before I go off in that potentially difficult direction. Also, I saw some notes about having to compile parts of PyOgre individually on Linux but couldn't find any specifics. Any help would be appreciated. Thanks!

Steve

Game_Ender

12-11-2006 04:27:25

The PyOgre compile was buggy for me on Ubuntu and you don't need CEGUI 0.5, Ogre 1.2.3 isn't compatible with it. Just keep running "python setup.py install" I had to run it tons of times (don't ask me why).

If you are still stuck you might want to try the PythonOgre project. Try with the Debian Boost libraries first, if they fail you will have to compile Boost from CVS and build against it.

dermont

12-11-2006 05:45:44

Someone else had this problem using gcc 4.1, try editing pyogre/cegui/CEGUIEventSet.i

//EventCallback &EventCallback::operator=(const EventCallback &rhs)
EventCallback &operator=(const EventCallback &rhs)


Clear out pyogre/cegui cegui_wrap.cxx and cegui_wrap.h files, then rerun setup. This should create pycegui. The problem with having to rerun setup multiple times should be resolved.

Scramblejams

12-11-2006 08:45:32

Thanks for the replies, Ender and dermont! I tried dermont's suggestion and I got a little further, until this:

[steve@lothar:~/dev/sim/pyogre/dev-1.2.0]$ python setup.py build
running build
running build_ext
building 'pyogre._cegui' extension
skipping pyogre/cegui/cegui.i
g++ -pthread -shared build/temp.linux-i686-2.4/pyogre/cegui/cegui_wrap.o -o build/lib.linux-i686-2.4/pyogre/_cegui.so -L/usrÃ/lib -L/usr/local/lib -lCEGUIOpenGLRenderer -lCEGUIOgreRenderer -lOgreMain -lCEGUIBase -lCEGUIFalagardBase
/usr/bin/ld: cannot find -lCEGUIOpenGLRenderer
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1

I've already run ldconfig as root and that didn't help. Doing "locate CEGUIOpenGLRenderer" didn't turn up anything (and I reran /etc/cron.daily/slocate to be sure), so I guess I'm missing a prereq here. I guess I need to disable CEGUI from the build? I looked around but couldn't find anything in the build scripts that was an obvious way to do that.

BTW, I'm awfully curious about these lines:
CEGUI-OGRE-PYTHON.pc:1:prefix=/usrÃ
CEGUI-OGRE-PYTHON.pc.in:1:prefix=@prefix@Ã

What's with the Ã?

Again, any help would be much appreciated. Thanks!

Steve

dermont

12-11-2006 10:20:38

Setup.py builds pycegui by default and assumes that CEGUIOpenGLRenderer is installed, it shouldn't since it isn't needed. Setup.py should be split up for pyogre, pycegui (Ogre/CEGUIRenderer).
I'll look at this and the problem with à in CEGUI-OGRE-PYTHON.pc if no one else does - this caused me problems as well when submitting patches.

Meantime:

At line 48 in pyogre/cegui/cegui.i

#define WRAP_OPENGL_GUIRENDERER
//#define WRAP_OPENGL_GUIRENDERER


setup.py

#ext_cegui= pyogre_Extension("pyogre._cegui", ["pyogre/cegui/cegui.i"],
# pkg_config_module='CEGUI CEGUI-OPENGL CEGUI-OGRE',
# pkg_config_generate='CEGUI-OGRE-PYTHON',
# swig_includes=["-Ipyogre/ogre"])
ext_cegui = pyogre_Extension("pyogre._cegui", ["pyogre/cegui/cegui.i"],
pkg_config_module='CEGUI CEGUI-OGRE',
pkg_config_generate='CEGUI-OGRE-PYTHON',
swig_includes=["-Ipyogre/ogre"])


Clear out the cegui_wrap.cxx and cegui_wrap.h files and run setup.

There are also scons project files where you can set 'OGRE_RENDERER_ONLY' in the SUserOptions file in pyogre/cegui.

Scramblejams

12-11-2006 11:57:21

Thanks for your help, Dermont. I actually ended up building CEGUI 0.4.1 from source and installing it, redoing Ogre 1.2.3 to satisfy my OCD, then building PyOgre, which thanks to the newly built CEGUI went fine with your patch above. I discovered that checkinstall just doesn't like installing PyOgre, but whateva.

So I hit the media package and the demos sure look like they need some help, but SmokeDemo and SkyPlaneDemo work great, so I guess I'm on my way. Thanks again.

Steve

dermont

12-11-2006 12:22:08

Yes the demos probably need cleaning up but they should all run, if your having problems with a specific demo post here.