axiak / pyre2

Python wrapper for RE2
BSD 3-Clause "New" or "Revised" License
295 stars 39 forks source link

Problems building #10

Closed thegoleffect closed 12 years ago

thegoleffect commented 12 years ago

I'm trying to install pyre2 from source. I have re2 installed w/o errors. I'm on Ubuntu 10.04. Here is the output from trying to build or install:

$ sudo python setup.py build -v running build running build_ext building 're2' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.6 -c src/re2.cpp -o build/temp.linux-x86_64-2.6/src/re2.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ src/re2.cpp:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation. error: command 'gcc' failed with exit status 1

axiak commented 12 years ago

Are you building from git or from a release?

axiak commented 12 years ago

Also - what version of cython are you using?

thegoleffect commented 12 years ago

Building from git. Cython version 0.11.2

axiak commented 12 years ago

To quote the readme: If you want to make changes to the bindings, you must have Cython >=0.13.

I guess it might be worth running a version check before proceeding to build using cython...

thegoleffect commented 12 years ago

D'oh. Thanks for catching that.

axiak commented 12 years ago

Oddly, setup.py shouldn't even try cython buliding if you didn't specify --cython. I would git reset --hard and then just run setup.py build again.

axiak commented 12 years ago

This commit is for you: https://github.com/axiak/pyre2/commit/6222fe991320aaa33fc2bf156fdd9c08489d67de

thegoleffect commented 12 years ago

Thanks. I was also using PyPy which doesn't seem to want to install Cython.

axiak commented 12 years ago

Are you talking about Pypi or pypy? If pypy, then I don't this will work. If Pypi, then the standard pip install/easy_install for re2 should just work. The only way this will fail is if you use the Makefile or if you add --cython to the setup.py parameter. This commit makes it so that doing so will no longer damage the c file forcing you to re-download, it will just safetly abort.

thegoleffect commented 12 years ago

I meant PyPy. With normal Python, everything installs just fine but I have to rewrite some of my code to compensate.

axiak commented 12 years ago

How does one get an arbitrary c extension to work on PyPy? I was under the impression that they handled it on a largely case by case basis.

thegoleffect commented 12 years ago

IDK, TBH.