Building on Ubuntu 7.10 (Gutsy)

pornstarin

21-10-2007 19:34:40

I've been trying for the better part of the weekend to build python-ogre from source. I'm following the wiki page on how to build from source on linux. So basically I've been running all the scripts in SVN revision 447.

I'm running Ubuntu 7.10 (Gutsy). I've tried using GCC 4.1 and 4.2.

Ogre builds fine and I can run all the Ogre demos. The rest of the scripts run without error, but _ogre_.py never gets built. Any ideas?

Game_Ender

21-10-2007 20:35:43

First the dumb question, how do you know it never gets built?
Oh, and are you sure you want _ogre_.py, or is that _ogre_.pyd?

pornstarin

21-10-2007 21:32:17

When I try to run any of the python-ogre demos, say Demo_Basic.py, I get the following error:

Traceback (most recent call last):
File "Demo_Basic.py", line 14, in <module>
import PythonOgreConfig
ImportError: No module named PythonOgreConfig

So I comment out the line:
#import PythonOgreConfig

Running it again produces this error:

Traceback (most recent call last):
File "Demo_Basic.py", line 18, in <module>
import ogre.renderer.OGRE as ogre
File "/home/grim/development/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/__init__.py", line 10, in <module>
from _ogre_ import *
ImportError: No module named _ogre_

I looked in that directory and there is no _ogre_.py or _ogre_.pyd. So I assume that it never got built.

Game_Ender

21-10-2007 23:28:30

How long did the build take? Building the wrappers will take over an hour on decent computer. I would do a "find . -name "_ogre_.pyd" " in the directory where Python-Ogre is checked out to. The setup.py file could just be broken and not have copied them in.

pornstarin

22-10-2007 00:07:40

I searched for anything beginning with '_ogre_.', but the only result was from .python-ogre/generated/ogre_1.4/_ogre_.main.cpp. I'm pretty sure it just wasn't built.

I appreciate the suggestions.

andy

22-10-2007 04:01:36

Simply comment out the import PythonOgreConfig and try again...

Or you can do a fresh update from the SVN as it was my mistake in that I didn't add this file to the SVN on my last commit..

It doesn't currently do much, however is intended as a solution to the need to set environment variables under Linux

Andy

pornstarin

22-10-2007 04:34:07

Yeah, I commented out that line, but now my problem is that I don't have a _ogre_.pyd file anywhere. It wasn't built after running all the build scripts.

andy

22-10-2007 05:13:10

I've added some hints to the wiki -- have a look at:

http://wiki.python-ogre.org/index.php/LinuxBuild#It_Didn.27t_Work_--_What_Now.3F

And let me know what happens..

Andy

pornstarin

22-10-2007 07:30:40

*Ogre demos work
*python-ogre code was generated (for both ogre and ois)

./06-GenerateCode.sh ogre && ./06-GenerateCode.sh ois
OUTPUT:
=== generating ogre ===
~/development/python-ogre/code_generators/ogre ~/development
/home/grim/development/root/usr/lib/python2.5/site-packages/pygccxml/parser/scanner.py:297: UserWarning: unable to find out array size from expression "(_Nw - 1)"
warnings.warn( 'unable to find out array size from expression "%s"' % attrs[ XML_AN_MAX ] )
~/development

=== done building code ===
=== generating ois ===
~/development/python-ogre/code_generators/ois ~/development
~/development

=== done building code ===

./07-BuildModules.sh ogre
I get this error for every file in ./python-ogre/generated/ogre_1.4/:
--------------------------------------------------------------------------------------

g++ -o build_dir_2.5/ogre_1.4/VisibleObjectsBoundsInfo.pypp.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -fPIC -I/home/grim/development/root/usr/include/boost-1_34 -I/home/grim/development/root/usr/include/OGRE -I/usr/include/python2.5 -I/home/grim/development/root/usr/include/boost-1_34 generated/ogre_1.4/VisibleObjectsBoundsInfo.pypp.cpp
In file included from generated/ogre_1.4/python_ogre_masterlist.h:36,
from generated/ogre_1.4/VisibleObjectsBoundsInfo.pypp.cpp:5:
/home/grim/development/root/usr/include/OGRE/OgreConfigDialog.h:39:38: error: gtk/OgreConfigDialogImp.h: No such file or directory
In file included from generated/ogre_1.4/python_ogre_masterlist.h:50,
from generated/ogre_1.4/VisibleObjectsBoundsInfo.pypp.cpp:5:
/home/grim/development/root/usr/include/OGRE/OgreErrorDialog.h:39:37: error: gtk/OgreErrorDialogImp.h: No such file or directory
scons: *** [build_dir_2.5/ogre_1.4/VisibleObjectsBoundsInfo.pypp.os] Error 1

andy

22-10-2007 08:01:12

The only way that this can happen is if OGRE_GUI_gtk is defined -- on my system (with an Nvidia card) it defaults to OGRE_GUI_GLX.

And the really confusing issue is that this isn't set anywhere by the Python-Ogre build system, which means that during the Ogre build it decided to go with gtk, but for some reason didn't copy across the necessary include files as part of it's "make insta''

You could copy the ogrenew/OgreMain/include/gtk to root/usr/include/OGRE/gtk and try again..

Andy

dermont

22-10-2007 09:11:10

On my system, with a nvidia card, OGRE_GUI_gtk has been the default for some time. To build I have to "./configure --with-gui=Xt", so you could try adding "--with-gui=Xt" to your configure command.

andy

22-10-2007 10:05:17

I wonder if I should force this in the Python-Ogre build scripts.. ??

Is there a preference -- ie. does GLX (xt) always work ?

And I guess this is really a bug in the Ogre installer script as it doesn't copy the include/gtk directory across.....

Andy

andy

22-10-2007 11:19:57

I've updated the scripts to force Xt as the Ogre GUI under Linux -- it's not as pretty but it works with Python-Ogre :)

There are also some changes to force the includedir which was causing issues in OIS and CEGUI

Regards
Andy

pornstarin

23-10-2007 01:11:14

It works! :D

I renamed my development directory and followed the LinuxBuild directions again using SVN revision 452. For some reason the boost libraries didn't build this time, but I just copied them over from my old development dir and everything compiled just fine.

I appreciate all the help I received from you guys. Now it's time to start programming!