Download and install
Here are the various binaries of PyPy 1.5 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.5; for the most up-to-date version see below.)
- Linux binary (32bit)
- Linux binary (64bit)
- Mac OS/X binary (64bit)
- Windows binary (32bit) (you may need to install the VS 2010 runtime libraries)
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.5, 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.5/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 (these are svn exports):
- pypy-1.5-src.tar.bz2 (sources, Unix line endings)
- pypy-1.5-src.zip (sources, Windows line endings) not available
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 GB of RAM on a 32-bit system and 4 GB on 64-bit systems. (Do not start a translation on a machine with insufficient RAM! It will just swap forever.)
Notes:
- It is recommended to use PyPy to do translations, instead of using CPython, because it is twice as fast. (Using CPython would lower the memory requirement down to 1.2 GB on 32-bit, 2.4 GB on 64-bit.) You should just start by downloading an official release of PyPy (with the JIT).
- 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):
3dccf24c23e30b4a04cf122f704b4064 pypy-1.4.1-linux.tar.bz2 1fb62a813978c2581e9e09debad6b116 pypy-1.4.1-linux64.tar.bz2 769b3fb134944ee8c22ad0834970de3b pypy-1.4.1-osx64.tar.bz2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx pypy-1.5-win32.zip ebbbb156b1eb842e9e65d909ed5f9f6d pypy-1.4.1-src.tar.bz2 6e2366377ad2f0c583074d3ba6f60d064549bef2 pypy-1.4.1-linux.tar.bz2 1cfd53343e19264905a00d2ffcf83e03e39dcbb3 pypy-1.4.1-linux64.tar.bz2 8e2830bef80b93f4d3c016b972fbdf7bcd403abc pypy-1.4.1-osx64.tar.bz2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx pypy-1.5-win32.zip 922a8815377fe2e0c015338fa8b28ae16bf8c840 pypy-1.4.1-src.tar.bz2