Wiki Tools:

How To Build a 64-bit Python and use Corepy/x86 64 on OSX

From CorePy

Jump to: navigation, search

This was done with OSX 10.5 and Python 2.5.2; milage may vary with other versions.

1. Grab the Python 2.5.2 source:

http://python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2

2. Unpack it:

  $ tar xjf Python-2.5.2.tar.bz2
  $ cd Python-2.5.2

3. Configure, compile, and install:

  $ ./configure --disable-toolbox-glue --prefix=$PREFIX OPT="-fast -arch x86_64 -fPIC -pipe" LDFLAGS="-arch x86_64"
  $ make
  $ make install

Set the PREFIX variable to where you want python installed, or just replace it yourself in the configure line.

When compiling you'll probably see some errors go by; the compile still seems to complete fine.

Once installed, be sure to update your PATH to include the location of your new python binary at the beginning. Verify that you're getting the right python by doing this:

  $ export PATH=$HOME/local/osx/bin:$PATH
  $ which python
  /prefix/bin/python
  $ file `which python`
  /prefix/bin/python: Mach-O 64-bit executable x86_64


4. Now just set up CorePy as you normally would (see Installation for more details):

  $ cd $COREPY
  $ python setup.py build_ext -i -f


5. Should be good to go now; just make sure CorePy is in your PYTHONPATH.

  $ export PYTHONPATH=$COREPY:$PYTHONPATH