Compiles with Python 2.5? Doesn't finds zlib.h?

Compiles with Python 2.5? Doesn't finds zlib.h?

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

Moderator: Moderators

Post Reply
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Compiles with Python 2.5? Doesn't finds zlib.h?

Post by PauloMorfeo »

1- I tried to compile Spring got from svn, from tag/...0.72
In my distro, the portuguese Caixa Mágica, i only had Python 2.3 and scons configure would complaint that it needs python 2.4. So, i downloaded the most recent Python, 2.5, and ./configured it, maked it and make installed it. scons configure still complained about python 2.4.

Will it be something wrong with the instalation of python or does the configure script checks only for python 2.4 exclusively?

2- I tried to compile Spring i got from svn/trunk
scons configure is complaining me that it doesn't finds zlib

Code: Select all

Checking header files
Checking for C header file zlib.h... no
Zlib headers are required for this program
However, i have the file zlib.h in /usr/include and /usr/linux/include
Anyone has any idea why it isn't finding it?
own3d
Posts: 129
Joined: 25 Aug 2006, 16:31

Post by own3d »

I had this problem on ppc linux (ubuntu draper) but it does not appear on x86 ubuntu linux. Wierd. maybe something needs to be linked?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I guess scons checks for python 2.4 only. Will look at it asap.
ssam
Posts: 2
Joined: 15 Mar 2006, 19:45

Post by ssam »

i am still getting the

Code: Select all

Checking header files
Checking for C header file zlib.h... no
Zlib headers are required for this program
error.

this is on ubuntu edgy powerpc

update:
config.log says

Code: Select all

file rts/build/scons/config.py,line 316:
        Configure(confdir = build/sconf_temp)
/usr/bin/freetype-config --ftversion
2.2.1
scons: Configure: Checking for C header file zlib.h... 
build/sconf_temp/conftest_1.c <-
  |
  |#include "zlib.h"
  |
  |
gcc -o build/sconf_temp/conftest_1.o -c -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -fvisibility=hidden -mfpmath=387 -pthread -D_GNU_SOURCE=1 -D_REENTRANT -DNDEBUG -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts/System -Ilua/luabind -Ilua/lua/include -I/usr/include -I/usr/include/GL -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include/python2.4 build/sconf_temp/conftest_1.c
cc1: error: unrecognized command line option "-mieee-fp"
cc1: error: unrecognized command line option "-mfpmath=387"
scons: Configure: no
ssam
Posts: 2
Joined: 15 Mar 2006, 19:45

Post by ssam »

the complaint about zlib is because the example zlib file does not build. the reason is not the lack of zlib, but the gcc command used to build it. the flags -mieee-fp and -mfpmath=387 are only valid on x68 cpus.

the patch

Code: Select all

Index: rts/build/scons/rts.py
===================================================================
--- rts/build/scons/rts.py	(revision 3406)
+++ rts/build/scons/rts.py	(working copy)
aa -200,7 +200,8 aa
 		# Use single precision constants only.
 		# This should be redundant with the modifications done by tools/double_to_single_precision.sed.
 		# Other options copied from streflop makefiles.
-		env['CCFLAGS'] = ['-fsingle-precision-constant', '-frounding-math', '-fsignaling-nans', '-mieee-fp']
+		#env['CCFLAGS'] = ['-fsingle-precision-constant', '-frounding-math', '-fsignaling-nans', '-mieee-fp']
+		env['CCFLAGS'] = ['-fsingle-precision-constant', '-frounding-math', '-fsignaling-nans']
 
 		# profile?
 		bool_opt('profile', False)
aa -277,7 +278,7 aa
 
 		# Allow easy switching between 387 and SSE fpmath.
 		if env['fpmath']:
-			env['CCFLAGS'] += ['-mfpmath='+env['fpmath']]
+			#env['CCFLAGS'] += ['-mfpmath='+env['fpmath']]
 			if env['fpmath'] == 'sse':
 				print "WARNING: SSE math vs X87 math is unsynced!"
 				print "WARNING: Do not go online with the binary you are currently building!"
(phpbb would not let me include at symbols in the code, so please replace the 'aa's with 2 at symbols)


seems to cheer scons up (a better patch would only remove these options on powerpc).

however, i think those flags are there for a good reason (to make passing floats between architectures work?).
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Yes, they are there to make linux vs. windows synchronization work. You could rip them out tho if you just want single player (no clue whether powerpc CPUs have sync with i386 anyway..., never tested it)
User avatar
elio
Posts: 133
Joined: 29 Dec 2006, 06:44

Post by elio »

at least the endian issuse knock out i386 and ppc sync (rather, how such issuse are dealt with), as well as a few other bits and pieces; been slowly trying to locate where problems lie, but there doesn't seem to be anything plainly obvious that would help. I think though it's just a problem that needs time to be looked into.
Post Reply

Return to “Linux”