Help compiling python-ogre on linux

Dosfish

14-03-2007 04:36:10

Hi, I'm a total python noob and I am having a lot of trouble figuring out how to build python-ogre on gentoo, I've built ogre, and all it's required packages I have python with Py++, gccxml and pygccxml installed, where I'm having problems is where should I be pointing the directorys inPythonOgreConfig_posix.py should the be pointed at the source or the built packages? A clearer install process would be much appreciated.

Thanks.

Game_Ender

14-03-2007 05:42:03

Thought using gentoo was supposed to teach you how things worked in Linux ;)? Just a little joke from an Ubuntu user. You are confused probably because the example that is posted by our main developer Andy and he choose to work out of the source directories.

The cleanest way to do things it to set up a directory like "/home/<user>/dev/local" and make it the directory every "make install" command sends files to. You can do this with the configure flag "--prefix=/home/<user>/dev/local". This will create lib and include in ~/dev/local. After that almost all the paths in that config file become "/home/<user>/dev/local/include" and "/home/<user>/dev/local/lib". When I rebuild Python-Ogre I will updated a better default posix config.

You need to adjust your LD_LIBRARY_PATH to include those new directories you have created (this will allow running of python Ogre but shouldn't be needed for compilation). Also when building the other libraries which depend on each other you might have to set the LDFLAGS, CPPFLAGS, and PKG_CONFIG_PATH environment variables to reference you new set of "~/dev/local" directories.

Dosfish

14-03-2007 05:46:22

also when I run python setup.py install I get:

File "setup.py", line 40
"package_dir": {'': 'packages'},
^
SyntaxError: invalid syntax

an error in the install script?

Thanks for your help, although this seems like a very messy way to get things going, coming from a gentoo user with his nice neat ebuilds :-)

Game_Ender

14-03-2007 14:20:42

Ebuilds are in end result no different than binary packages in that they handle most of the nasty details for you. You don't have to it my way, you can always whip up (or find) an ebuild for each the dependencies and install them system wide. That willl make it so you don't really have to muck with environment variables, but then it just gets a little harder if you have to tweak the packages a lot.

Here is an updated setup.py

#!/usr/bin/env python
#
# This is the distutils setup script for python-ogre.
# Full instructions are in "install.txt" or "install.html"
#
# To configure, compile, install, just run this script.

DESCRIPTION = """Python-Ogre is a Python wrapper module for the
OGRE 3D Graphics library. It contains python functions and classes
that will allow you to fully utilitize the Ogre library. It is
Unique in that the python wrappers are created automatically by
Py++, hence making maintainence etc very simple."""

METADATA = {
"name": "Python-Ogre",
"version": "0.9 Release",
"license": "LGPL",
"url": "http://python-ogre.python-hosting.com/",
"author": "Lakin Wecker, Roman Yakovenko, Andy Miller, Joseph Lisee",
"author_email": "python-ogre-developers@googlegroups.com",
"description": "Py++ Ogre Python Binding",
"long_description": DESCRIPTION,
}
from distutils.core import setup
import os, sys

def GetFileList ( basepath ):
filesout = []
for root, dirs, files in os.walk(basepath):
for name in files:
filesout.append(os.path.join(root, name))
return filesout

base = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]) )
demofiles = GetFileList ( os.path.join (base, "demos") )

PACKAGEDATA = {
# Doesn't install everything, modify this line to install more packages
"packages": ['Ogre', 'OIS','CEGUI','OgreNewt'],
"package_dir": {'': 'packages'},
"package_data": {'': ['*.pyd', '*.dll', '*.so']},
# "data_files": [(base+'Demos', demofiles),]

}

PACKAGEDATA.update(METADATA)
setup(**PACKAGEDATA)

Dosfish

15-03-2007 03:00:59

I really can't seem to get this compiled, I've edited the PythonOgreConfig_posix.py correctly (I think) so I've gone into the code_generator directory and then the ogre directory and ran python generate_code.py which looks like it ran correctly so I go back into the python-ogre base directory and run python setup.py install which says it installs I then try to run a demo and get ImportError: No module named _ogre_. I'm starting to get the feeling I've made a total pigs breakfast of it, any help would be most welcome.

Game_Ender

15-03-2007 04:01:20

Have you been following the basic instructions here? generate_code.py does only what it says, generate the wrapper files. After that you have to run the SConstruct file with scons to build the actual modules.

Dosfish

15-03-2007 04:18:28

when I run scons I get this :

scons: Reading SConscript files ...
WARNING: Unable to find Ogreode_Prefab.h include file (ogreode class) in include_dirs
WARNING: Unable to find OgreAL.h include file (ogreal class) in include_dirs
Using Override for class fmod
Set fmod.libs to ['libboost_python.so', 'fmodexL_vc']
Set fmod.version to 4.06

scons: *** Error converting option: PROJECTS
Invalid value(s) for option: ogre ois ogrerefapp ogrenewt cegui ode fmod ogreode ogreal
File "SConstruct", line 84, in <module>

Dosfish

15-03-2007 05:10:02

ooh hang on, I feel like an idiot I'm using gcc 4.1 not 4.0, are there plans for gcc 4.1 support?

andy

15-03-2007 06:44:07

GCC 4.0 is the currently tested/working compiler under Linux -- however there is testing underway with GCC 4.1 which you are welcome to try...

The original issue related to wrapping the shared pointers under GCC 4.1..

There is a test environment in the Python-Ogre build system (you need to set Version1 to False in common_utils/shared_ptr.py) which will become the default if testing goes well.. You can read more about this in the Goolge Groups mailing list -- http://groups.google.com/group/python-ogre-developers?hl=en

Cheers
Andy

Dosfish

15-03-2007 10:47:06

cool I'll check it out

Balancer

01-07-2007 17:34:58

Have you been following the basic instructions here?

At step:

Rebuild Boost
cd boost/libs/python/build
bjam release --V2


I got error:

Unable to load Boost.Build: could not find "boost-build.jam"
---------------------------------------------------------------
Attempted search from /home/balancer_homesrv/work/programming/python/python-ogre/src/boost/libs/python/build up to the root
and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: /usr/share/boost-build.
Please consult the documentation at 'http://www.boost.org'.

andy

07-07-2007 12:39:11

If you are running Ubuntu (latest version) then we have binaries being tested that might solve your problem.

Otherwise use the install script from http://www.python-ogre.org/wiki/LinuxNotes as a starting point and report any problems on the Google mailing list..

Cheers
Andy