How to Compile PyPy With cx_Oracle

How to Compile PyPy With cx_Oracle


PyPy (http://pypy.org/) and it's JIT (Just in Time Compiler) makes Python super fast... the advantage is awesome - especially with very large datasets. Sometimes very large datasets need to be databased, and sometimes very large databases are maintained in Oracle. The Python connector for Oracle is cx_Oracle (http://cx-oracle.sourceforge.net/). This short writing will show you how to compile PyPy yourself with cx_Oracle so that you too can handle massive datasets easily with PyPy. This was done on Ubuntu 10.04 LTS 64-bit.

Make sure you have Mercurial (distributed version control system) installed:

sudo apt-get install mercurial

Download and install build time dependencies:

sudo apt-get install gcc make python-dev libffi-dev pkg-config libz-dev libbz2-dev libncurses-dev libexpat1-dev libssl-dev libgc-dev python-sphinx

sudo easy_install greenlet

Get the latest version from bitbucket.org:

hg clone https://bitbucket.org/pypy/pypy

Or download latest stable:

http://pypy.org/download.html#building-from-source

tar -xvf pypy*tar.bz

Now enter the goal directory:

cd pypy/pypy/translator/goal/

And now compile with cx_Oracle included (this can take awhile):

python translate.py -Ojit targetpypystandalone.py --withmod-oracle



ClassyBits 2016