Python-Problem

Questions, problems and discussion about compiling FreeOrion.

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Python-Problem

#1 Post by kroddn » Fri Jul 06, 2007 8:46 am

I read that python2.5 is now required. I have python2.5 installed, but it seems to me that scons always uses python2.4 if that is the system-default. Maybe scons should check for "python2.5" and only take "python" if it cannot find the first.

I saw, that for win32 there is an option in build_config.py named python_win32_libname.

The scons configure outputs:

Code: Select all

scons: Reading SConscript files ...
Configuring for POSIX system...
Checking for Py_Initialize() in C library python2.4... yes
I hacked the problem by symlinking /usr/bin/python and python-config to the python2.5-versions. But i dont like changing system-files.


/Edit Kroddn:
FreeOrion should be using Python2.5. Scons may run with Python2.4, while linking the freeorion has to be done with 2.5!

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Python-Problem

#2 Post by loonycyborg » Fri Jul 06, 2007 6:04 pm

kroddn wrote:SCons always uses python2.4 if that is the system-default.
SCons uses the python that is used to run it.

Currently I have no problems compiling and running freeorion with Python2.4.
In Soviet Russia, forum posts YOU!!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12457
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Python-Problem

#3 Post by Geoff the Medio » Fri Jul 06, 2007 7:19 pm

loonycyborg wrote:
kroddn wrote:SCons always uses python2.4 if that is the system-default.
SCons uses the python that is used to run it.
His point is that it should be possible to run SCons with one version of python (eg. 2.4) and have it build GG and FreeOrion to run using another version (eg. 2.5), presumably by setting python_version in build_config.py, or something similar.

User avatar
tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: Python-Problem

#4 Post by tzlaine » Fri Jul 06, 2007 7:27 pm

kroddn wrote:I read that python2.5 is now required. I have python2.5 installed, but it seems to me that scons always uses python2.4 if that is the system-default. Maybe scons should check for "python2.5" and only take "python" if it cannot find the first.

I saw, that for win32 there is an option in build_config.py named python_win32_libname.

The scons configure outputs:

Code: Select all

scons: Reading SConscript files ...
Configuring for POSIX system...
Checking for Py_Initialize() in C library python2.4... yes
I hacked the problem by symlinking /usr/bin/python and python-config to the python2.5-versions. But i dont like changing system-files.


/Edit Kroddn:
FreeOrion should be using Python2.5. Scons may run with Python2.4, while linking the freeorion has to be done with 2.5!
Python 2.4 is fine, and that's what I'm using. Python 2.5 is only required when using the Win32 SDK. The SCons build determines which Python to use by using the Python distutils module. It's best if you stick to one version, or if you need two versions of Python installed on your system, manually edit the python-related env variables in the SConstruct file to work with the one you want to use.

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Python-Problem

#5 Post by loonycyborg » Fri Jul 06, 2007 10:14 pm

Geoff the Medio wrote: His point is that it should be possible to run SCons with one version of python (eg. 2.4) and have it build GG and FreeOrion to run using another version (eg. 2.5)
My point was that it is possible to set python version used by invoking the right python:

Code: Select all

python2.5 `which scons`
instead of just "scons".
In Soviet Russia, forum posts YOU!!

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Python-Problem

#6 Post by kroddn » Fri Jul 06, 2007 11:32 pm

The compilation with python2.4 failed, so i switched to 2.5. And then it worked.

I'll try again with 2.4 later, maybe the problem was not python (although i tracked it down that it had to be...).

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12457
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Python-Problem

#7 Post by Geoff the Medio » Fri Jul 06, 2007 11:38 pm

kroddn wrote:The compilation with python2.4 failed, so i switched to 2.5. And then it worked.

I'll try again with 2.4 later, maybe the problem was not python (although i tracked it down that it had to be...).
Didn't you have boost built with 2.5, but were trying to compile GG and FO with 2.4? Though you can use either, I suspect the versions need to be consistent amongst all the dependencies.

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Python-Problem

#8 Post by kroddn » Sat Jul 07, 2007 8:16 am

Yes, now I remember.

Thats the point, the debian-package for boost 1.34 depends on python2.5, and uses this version. And as I normally do not manually change packets which are automatically built i must use python2.5 for freeorion.

So - a solvation to this problem could be that a parameter "--with-python=xxx" could be added to scons.

User avatar
tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: Python-Problem

#9 Post by tzlaine » Sat Jul 07, 2007 9:12 pm

kroddn wrote:Yes, now I remember.

Thats the point, the debian-package for boost 1.34 depends on python2.5, and uses this version. And as I normally do not manually change packets which are automatically built i must use python2.5 for freeorion.

So - a solvation to this problem could be that a parameter "--with-python=xxx" could be added to scons.
That can't help you if you link against the boost 1.34 debian package. In fact, it will cause enormous problems, becuase you will end up linking in libpython2.4.so and libpython2.5.so if xxx=2.4. The SCons system currently just uses whatever version Python tells it to via python.distutils, which IMO is the safest bet.

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Python-Problem

#10 Post by kroddn » Sun Jul 08, 2007 6:48 am

Thats right. I will build boost again, trying python-2.4.

Post Reply