How to build 32-bit Python on Ubuntu 9.10 x86_64
This might be useful to someone:
$ cd Python-2.6.4
$ CC="gcc -m32" LDFLAGS="-L/lib32 -L/usr/lib32 \
-L`pwd`/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" \
./configure --prefix=/opt/pym32
$ make
$ sudo make install
Now, to check if the build is correct, try to check the max integer size on your standard 64-bit interpreter and in your fresh 32-bit binary:
$ python -c "import sys; print sys.maxint"
9223372036854775807
$ /opt/pym32/bin/python -c "import sys; print sys.maxint"
2147483647
note: for me the install died at this point:
Compiling /usr/local/lib/python2.5/zipfile.py …
make: *** [libinstall] Error 1
Based on the information found at http://www.velocityreviews.com/forums/t528367-python-dies-on-make-install.html, this solved the problem:
$ sudo mv /usr/local/lib/python2.6 /usr/local/lib/python2.6.bak
dan
February 8, 2010 at 13:52