What about Python 2.5

What about Python 2.5

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
nicko117
Posts: 19
Joined: 30 Nov 2006, 10:33

What about Python 2.5

Post by nicko117 »

Ok, I've upgraded my system with the brand new OpenSuSE, and now python 2.5 is the reference ...

I've tried to recompile my little spring, and it seems the dependancy with python is tied to version 2.4 (ans only 2.4, not > 2.4)

So, could the makefile (or scons equivalent, I don't really knows how this things works) be tweaked, or does the migration to python2.5 implies some more complicated changes ?

Thanks.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Easily fixed. In <your source directory>/rts/build/scons, open config.py and search for the function check_libraries(). Scroll down a bit and comment out these lines:

Code: Select all

if not conf.CheckLib('python2.4') and not conf.CheckLib('python24'):
	print 'python is required for this program'
	env.Exit(1)
You should have no trouble configuring/compiling Spring then.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

If it compiles fine with that commented out, could you post here then I add checks for python2.5 too.

EDIT: oh btw, maybe don't comment them out as then python probably can't be found. Rather change 2.4 to 2.5 in those lines.
nicko117
Posts: 19
Joined: 30 Nov 2006, 10:33

Post by nicko117 »

Ok, I changed the file config.py like this:

config.py:246
# second check for Windows.
if not conf.CheckLib('python2.5') and not conf.CheckLib('python25'):
print 'python is required for this program'
env.Exit(1)

config.py:171
def check_python(env, conf):
print "Checking for Python 2.5...",
print ""
guess_include_path(env, conf, 'Python', 'python')

(on this distrib, the directory /usr/include/python is a symbolic link to the current python release, so here python2.5)

And it does work !!

Thanks again.
terrak
Posts: 2
Joined: 09 Nov 2006, 13:00

Post by terrak »

Thanks for the answer, I have the same problem with my OpenSuse 10.2
wazzubrad
Posts: 9
Joined: 22 May 2007, 03:37

Python 2.5

Post by wazzubrad »

I think I am running into the same problem with python 2.5. I used the advice to edit my config.py as shown and it worked lovely, I had been compiling for 10 minutes or so, well past the initial compiling problem, and then for some reason again I got this,

-I/usr/include/python2.4 tools/unitsync/pybind.cpp
tools/unitsync/pybind.cpp:4:20: error: Python.h: No such file or directory
tools/unitsync/pybind.cpp:66: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:75: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:84: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:92: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:99: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:106: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:113: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:123: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:132: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:140: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:149: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:156: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:164: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:172: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:180: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:189: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:196: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:205: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:214: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:222: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:229: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:237: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:296: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:334: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:342: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:350: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:358: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:365: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:373: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:381: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:389: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:397: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:405: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:413: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:420: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:428: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:436: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:445: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:460: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:468: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:476: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:486: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:494: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:503: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:516: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:525: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:541: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:551: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:563: error: expected initializer before '*' token
tools/unitsync/pybind.cpp:584: error: 'PyMethodDef' does not name a type
tools/unitsync/pybind.cpp:660: error: expected constructor, destructor, or type conversion before 'initunitsync'
scons: *** [build/unitsync/tools/unitsync/pybind.os] Error 1
scons: building terminated because of errors.

I was hoping I just missed something in the config.py file but I checked it out and everything looked as it should. Any ideas? Thanks for the help ahead of time. -Brad
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Python 2.5

Post by Tobi »

wazzubrad wrote: tools/unitsync/pybind.cpp:4:20: error: Python.h: No such file or directory
Apparently it still can't find it. I wonder why the configure succeeds though, but maybe that is because of this modifications. EIther way, make sure you installed python development headers.
wazzubrad
Posts: 9
Joined: 22 May 2007, 03:37

Post by wazzubrad »

I located the python.h file in my /usr/include/python2.5 . So it is installed. Any other ideas?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

hm seems the unitsync file expects it to be called Python.h (note the big P)

Could rename it on line 4 of tools/unitsync/pybind.cpp, if it's indeed called python.h on your system..
wazzubrad
Posts: 9
Joined: 22 May 2007, 03:37

Post by wazzubrad »

Whoops, it is Python.h. Sorry about that.
wazzubrad
Posts: 9
Joined: 22 May 2007, 03:37

Post by wazzubrad »

any other ideas?
wazzubrad
Posts: 9
Joined: 22 May 2007, 03:37

Post by wazzubrad »

Anything?
Post Reply

Return to “Linux”