Page 1 of 1

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

Posted: 20 Sep 2006, 21:23
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?

Posted: 22 Sep 2006, 08:39
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?

Posted: 22 Sep 2006, 10:12
by Tobi
I guess scons checks for python 2.4 only. Will look at it asap.

Posted: 10 Feb 2007, 23:57
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

Posted: 11 Feb 2007, 00:24
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?).

Posted: 11 Feb 2007, 02:37
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)

Posted: 11 Feb 2007, 14:40
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.