Building PyPy on Windows
- Install Microsoft Visual Studio 2010
- Install Python for Windows
- Download PyPy sources
- tar jxf pypy-1.4.1-src.tar.bz2
- cd pypy-1.4.1-src/pypy/translate/goals
- C:Python27python translate.py
Some errors:
[platform:ERROR] platcheck_1.c [platform:ERROR] c:userschuitoyapppypy-1.4.1-srcpypytranslatorgoalusession-1platcheck_1.c(21) : fatal error C10 83: Cannot open include file: 'expat.h': No such file or directory : : [translation:ERROR] File "C:Python27libctypes__init__.py", line 353, in __init__ [translation:ERROR] self._handle = _dlopen(self._name, mode) [translation:ERROR] WindowsError: [Error 193] %1 is not a valid Win32 application [translation] start debugger... > c:python27libctypes__init__.py(353)__init__() -> self._handle = _dlopen(self._name, mode) (Pdb+) (Pdb+) p self._name 'C:\Users\Chui\toyapp\pypy-1.4.1-src\pypy\translator\c\src\libffi_msvc\externmod.dll'
This is probably because I’m running 64-bit python, but the DLL built is 32 bit.
The easiest option seems to be download 32-bit python and build instead.
C:Python27-32python translate.py
So far, I’m getting some platcheck errors, mainly due to missing third party files.
- expat
- openssl
- zlib
- bzlib
- gettimeofday
- bind_textdomain_codeset
After an hour or so, two little executables appeared.
13M 2010-12-23 10:51 libpypy-c.dll 6.0K 2010-12-23 10:51 pypy-c.exe
$ ./pypy-c.exe Python 2.5.2 (, Dec 23 2010, 00:10:05) [PyPy 1.4.1] on win32 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: `` : w [sigh] -s'' >>>> import sys >>>> sys.path ['', 'C:\Users\Chui\toyapp\pypy-1.4.1-src\lib_pypy', 'C:\Users\Chui\toyapp\pypy-1.4.1-src\lib-python\modified -2.5.2', 'C:\Users\Chui\toyapp\pypy-1.4.1-src\lib-python\2.5.2', 'C:\Users\Chui\toyapp\pypy-1.4.1-src\site-pa ckages']
For this effort, I end up with a fast python interpreter that was built from python sources. Now to find the bytecode intepreter…
The opcodes are in src/pypy/interpreter/pyopcode.py.
This looks reasonably easy to modify:
def ROT_TWO(self, oparg, next_instr):
w_1 = self.popvalue()
w_2 = self.popvalue()
self.pushvalue(w_1)
self.pushvalue(w_2)
Any ideas what experiments I could run with PyPy?
About this entry
You’re currently reading “ Building PyPy on Windows ,” an entry on Chui's Counterpoint
- Published:
- 12.23.10 / 11am
- Category:
- Engineering notes, Python
3 Comments
Jump to comment form | comments rss [?] | trackback uri [?]