scrapinghub / python-crfsuite

A python binding for crfsuite
MIT License
770 stars 221 forks source link

Small change to make crfsuite build under PyPy #15

Closed GregBowyer closed 4 years ago

GregBowyer commented 9 years ago

There is also a small thing needed in Cython for this to work, and presently it appears that a Cython needs to be installed to correctly generate a PyPy friendly version of the code.


This change is Reviewable

kmike commented 9 years ago

Could you please also fix travis.yml and tox.ini? If we support PyPy then we should run tests for PyPy.

Downchuck commented 9 years ago

What's the status on this? I'm looking for a pypy friendly download.

Error I'm hitting:

    building 'pycrfsuite._pycrfsuite' extension
    cc -O2 -fPIC -Wimplicit -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I/home/chuck/data/geo/tmp/pypy-2.5.1-linux64/include -c pycrfsuite/_pycrfsuite.cpp -o build/temp.linux-x86_64-2.7/pycrfsuite/_pycrfsuite.o
    cc1plus: warning: command line option ‘-Wimplicit’ is valid for C/ObjC but not for C++ [enabled by default]
    pycrfsuite/_pycrfsuite.cpp: In function ‘PyObject* __pyx_convert_PyByteArray_string_to_py_std__string(const string&)’:
    pycrfsuite/_pycrfsuite.cpp:289:98: error: ‘PyByteArray_FromStringAndSize’ was not declared in this scope
     #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
                                                                                                      ^
    pycrfsuite/_pycrfsuite.cpp:9446:15: note: in expansion of macro ‘__Pyx_PyByteArray_FromStringAndSize’
       __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                   ^
    error: command 'cc' failed with exit status 1
Downchuck commented 9 years ago

@GregBowyer @kmike Is this ready to be merged?

kmike commented 9 years ago

Hi @Downchuck - no, it is not ready. There are merge conflicts, and Travis build is failing.