explosion / srsly

🦉 Modern high-performance serialization utilities for Python (JSON, MessagePack, Pickle)
MIT License
438 stars 31 forks source link

Build fails on PyPy #2

Closed mhham closed 5 years ago

mhham commented 5 years ago

I am trying to build spacy 2.1.3 on an alpine PyPy docker image, everything seems to build without an issue except srsly.

Dockerfile to reproduce:

FROM jamiehewland/alpine-pypy:3.6-7.0

RUN apk add --no-cache --virtual .build-deps musl-dev g++ \
    && apk add --no-cache openblas-dev \
    && pip install --no-cache-dir spacy==2.1.3 \
    && rm -rf ~/.cache \
    && apk del .build-deps

Error output:

    ----------------------------------------
    Failed building wheel for srsly
    Running setup.py clean for srsly
  Successfully built cymem preshed murmurhash thinc blis thinc-gpu-ops numpy wrapt
  Failed to build srsly
  Installing collected packages: setuptools, wheel, Cython, cymem, preshed, murmurhash, numpy, blis, thinc-gpu-ops, wrapt, plac, tqdm, six, wasabi, srsly, thinc
    Running setup.py install for srsly: started
      Running setup.py install for srsly: finished with status 'error'
      Complete output from command /usr/local/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-cxeja_a8/srsly/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-c7x55i7s/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-8tt8bidn/overlay --compile:
      running install
      running build
      running build_py
      running build_ext
      building 'srsly.msgpack._unpacker' extension
      gcc -pthread -DNDEBUG -O2 -fPIC -D__LITTLE_ENDIAN__=1 -I/usr/local/include -I. -I/tmp/pip-install-cxeja_a8/srsly/include -I/usr/local/include -c srsly/msgpack/_unpacker.cpp -o build/temp.linux-x86_64-3.6/srsly/msgpack/_unpacker.o -O2 -Wno-strict-prototypes -Wno-unused-function
      gcc: error: srsly/msgpack/_unpacker.cpp: No such file or directory
      gcc: fatal error: no input files
      compilation terminated.
      error: command 'gcc' failed with exit status 1

      ----------------------------------------

FYI build works OK on a standard python alpine docker image

honnibal commented 5 years ago

Support for PyPy isn't on the roadmap, as it's C-extensions all the way down here.

I think you'll also struggle to get spaCy running on PyPy, and if you do, I don't expect you'll find it to be faster. Like most machine learning codebases, the bottleneck for spaCy is in numeric code. PyPy isn't faster than numpy for this.