Indefinite Studies

Academic ramblings about software security.

How to build 32-bit Python on Ubuntu 9.10 x86_64

with 2 comments

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

About these ads

Written by dan

February 8, 2010 at 10:42

Posted in python

2 Responses

Subscribe to comments with RSS.

  1. 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

  2. Thanks. This was exactly what I was trying to do … unsuccessfully until now!

    Jonathan

    January 29, 2014 at 15:05


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: