Download and install
Here are the various binaries of PyPy 1.2 that we provide for x86 Linux, Mac OS/X or Windows. This is the first release of PyPy containing JIT, hence the main goal is to try this out and see how it works for you. We put a lot of effort into making JIT a stable piece of software and we don't observe crashes, however, please consider it a beta version to try things out.
“JIT Compiler” version
These binaries include a Just-in-Time compiler. They only work on 32-bit x86 (IA-32) CPUs that have the SSE2 instruction set (most of them do, nowadays), as well as on any x86-64 machine in the 32-bit compatibility mode.
- Linux binary
- Mac OS/X binary
- Windows binary
If your CPU is really old, it may not have SSE2. In this case, you need to translate yourself with the option --jit-backend=x86-without-sse2.
If your CPU is a 64-bit machine and you want to translate a 32-bit version of PyPy yourself, here are hints.
If you want to help us with implementing the 64-bit JIT backend, contact us!
“No JIT” version
WARNING! Unless you really want to try this out, we recommend the JIT version.
This version still has a few advantages over the JIT Compiler version. Notably, for Python programs that require large amounts of memory (at least a few hundred MBs), the following version of pypy-c runs them by requiring generally 1.5x or 2x less memory than CPython. These binaries work on 32-bit x86 (IA-32) CPUs as well as x86-64 CPUs in the 32-bit compatibility mode.
- Linux binary
- Mac OS/X binary
- Windows binary
If your CPU is a 64-bit machine and you want to translate a 32-bit version of PyPy yourself, here are hints.
If you want to help us with finishing the implementation of the native 64-bit version (there are a few known issues, like missing code in ctypes to implement calls to C functions), contact us. In general this version will more or less translate anywhere.
“Sandbox” version
A special safe version. Read the docs about sandboxing. These binaries work on 32-bit x86 (IA-32) CPUs as well as x86-64 CPUs in the 32-bit compatibility mode.
- Linux binary
- Mac OS/X binary
- Windows binary
It is also possible to translate a version that includes both sandboxing and the JIT compiler, although as the JIT is relatively complicated, this reduce a bit the level of confidence we can put in it.
If your CPU is a 64-bit machine and you want to translate a 32-bit version of PyPy yourself, here are hints.
The native 64-bit version needs testing and careful reviewing; contact us!
“Stackless” version
Provides Stackless extensions, as well as greenlets. These binaries work on 32-bit x86 (IA-32) CPUs as well as x86-64 CPUs in the 32-bit compatibility mode.
- Linux binary
- Mac OS/X binary
- Windows binary
It is not possible right now to combine Stackless features with the JIT.
If your CPU is a 64-bit machine and you want to translate a 32-bit version of PyPy yourself, here are hints.
For the native 64-bit version, see the issues of the no jit version..
Installing
All versions are packaged in a tar.bz2 or zip file. When uncompressed, they run in-place. On Linux or Mac OS/X, they can also be installed by manually moving the files in the following directories:
/usr/bin/pypy-c /usr/share/pypy-1.2/lib-python/* /usr/share/pypy-1.2/pypy/*
You can also install it to /usr/local/bin and /usr/local/share.
Building from source
Get the source code. The following packages contain the source at the same revision as the above binaries:
- pypy-1.2-src.tar.bz2 (sources, Unix line endings)
- pypy-1.2-src.zip (sources, Windows line endings)
Or you can checkout the current trunk using Subversion (the trunk usually works and is of course more up-to-date):
svn co http://codespeak.net/svn/pypy/trunk pypy-trunk
Windows users trying the zip file are expected to use MSVC. The trunk version contains fixes to support MinGW32. More information on our dev site.
Enter the goal directory:
cd pypy-trunk/pypy/translator/goal
Run the translate.py script. Here are the common combinations of options:
python translate.py -Ojit # get the JIT version python translate.py -O2 # get the no-jit version python translate.py --sandbox # get the sandbox version python translate.py --stackless # get the stackless version python translate.py -Ojit --backend=cli # only for branch/cli-jit
Enjoy Mandelbrot :-) It takes on the order of one hour to finish the translation, and 1.3 GB of RAM on a 32-bit system. (Do not start a translation on a machine with 1GB or less!)
Note on building a 32-bit version on 64-bit systems
To build 32-bit versions of pypy-c you need to run translate.py in a 32-bit version of Python. You can check with:
$ python Python 2.6.2 (...) >>> import sys >>> sys.maxint
This prints 9223372036854775807 in 64-bit versions and 2147483647 in 32-bit versions.
On Linux, you may have to compile yourself a 32-bit Python, e.g.:
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 make # and then use this ./python to run translate.py
On Mac OS/X: the easiest is to systematically use Python 2.5 when working with PyPy. Indeed, the standard Python 2.5 runs in 32-bit mode.
On Windows, the only known way is to install a 32-bit Python manually.