Download and install
Here are the various binaries of PyPy 1.6 that we provide for x86 Linux, Mac OS/X or Windows.
“JIT Compiler” version
These binaries include a Just-in-Time compiler. They only work on x86 CPUs that have the SSE2 instruction set (most of them do, nowadays), or on x86-64 CPUs. (This is the official release 1.6; for the most up-to-date version see below.)
- Linux binary (32bit)
- Linux binary (64bit)
- Mac OS/X binary (64bit)
- Windows binary (32bit) release c (BETA!)
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.
Other versions
The other versions of PyPy are:
- The most up-to-date nightly build with a JIT, if the official release is too old for what you want to do.
- No JIT: A version without the JIT. Consumes a bit less memory and may be faster on short-running scripts.
- Stackless: Provides Stackless extensions, as well as greenlets. It is not possible right now to combine Stackless features with the JIT.
- Sandboxing: A special safe version. Read the docs about sandboxing. (It is also possible to translate a version that includes both sandboxing and the JIT compiler, although as the JIT is relatively complicated, this reduces a bit the level of confidence we can put in the result.)
These versions are not officially part of the release 1.6, which focuses on the JIT. You can find prebuilt binaries for them on our nightly build, or translate them yourself.
Installing
All versions are packaged in a tar.bz2 or zip file. When uncompressed, they run in-place. For now you can uncompress them either somewhere in your home directory or, say, in /opt, and if you want, put a symlink from somewhere like /usr/local/bin/pypy to /path/to/pypy-1.6/bin/pypy. Do not move or copy the executable pypy outside the tree – put a symlink to it, otherwise it will not find its libraries.
Building from source
Get the source code. The following packages contain the source at the same revision as the above binaries:
- pypy-1.6-src.tar.bz2 (sources, Unix line endings)
- pypy-1.6-src.zip (sources, Unix line endings too, sorry)
Or you can checkout the current trunk using Mercurial (the trunk usually works and is of course more up-to-date):
hg clone http://bitbucket.org/pypy/pypy
Make sure you installed the dependencies. See the list here.
Enter the goal directory:
cd pypy/pypy/translator/goal
Run the translate.py script. Here are the common combinations of options (works also with python instead of pypy):
pypy translate.py -Ojit # get the JIT version pypy translate.py -O2 # get the no-jit version pypy translate.py -O2 --sandbox # get the sandbox version pypy translate.py -O2 --stackless # get the stackless version pypy translate.py -Ojit --backend=cli # only for branch/cli-jit
Enjoy Mandelbrot :-) It takes on the order of half an hour to finish the translation, and 2.x GB of RAM on a 32-bit system and 4.x GB on 64-bit systems. (Do not start a translation on a machine with insufficient RAM! It will just swap forever. See notes below in that case.)
Notes:
It is recommended to use PyPy to do translations, instead of using CPython, because it is twice as fast. You should just start by downloading an official release of PyPy (with the JIT).
If RAM usage is a problem, then you can (for now) tweak some parameters via environment variables and command-line options. The following command takes a bit more time, but finishes with only using 3.0 GB of RAM (on Linux 64-bit; probably not much more than 1.5 GB on 32-bit). It should be noted that it is less than with CPython.
PYPY_GC_MAX_DELTA=200MB pypy --jit loop_longevity=300 ./translate.py -Ojit
Because of asmgcroot, compiling the generated C files containing the JIT is delicate. It requires using either MSVC or gcc with no particularly fancy options. It does not work e.g. with clang, or if you pass uncommon options with the CFLAGS environment variable. You can also try to compile PyPy with the shadow stack option.
Checksums
Here are the checksums for each of the downloads (md5 and sha1):
ee949986fc5ec5c4a11ecbd546b87fbb pypy-1.6-linux.tar.bz2 a34e3113508449393e874f409dd888fc pypy-1.6-linux64.tar.bz2 78bbf70f55e9fec20d7ac22531a997fc pypy-1.6-osx64.tar.bz2 1bdef4c7adc023033552754258fd02bb63612632 pypy-1.6-linux.tar.bz2 4a42625139351f9a1c2f8d7ec13ff636cfc9d8ac pypy-1.6-linux64.tar.bz2 d703aa34fe1a45682ce4a09470ee9b1fa873d9be pypy-1.6-osx64.tar.bz2