pyconfig on 64-bit machines with distutils vs 32-bit legacy code

"Martin v. Löwis" martin at v.loewis.de
Sun Mar 22 02:36:17 EDT 2009


> /data/home/nwagner/local/lib/python2.5/pyport.h:734:2: #error
> "LONG_BIT definition appears wrong for platform (bad gcc/glibc
> config?)."
> 
> 
> Can anyone offer any advice as to what I might be missing or
> misunderstanding? 

You need to understand where the error comes from:
1. what is the *actual* value of SIZEOF_LONG (it should be 4)?
2. what is the actual value of LONG_BIT, and where does it come
   from? (it should be 32)

To understand that better, I recommend to edit the command line
of gcc in the following way (assuming you use gcc 4.x):
1. replace -c with -E -dD
2. remove the -o <file> option

This will generate preprocessor output to stdout, which you then
need to search for SIZEOF_LONG and LONG_BIT. Searching back for
# <number> lines will tell you where the definition was made.

If that doesn't make it clear what the problem is, post your
findings here.

Regards,
Martin



More information about the Python-list mailing list