GregBowyer / cld2-cffi

Python bindings to the Compact Language Detector
Apache License 2.0
32 stars 10 forks source link

Missing `ffi.h` header on Linux build? #16

Open ceteri opened 7 years ago

ceteri commented 7 years ago

Build errors seem to point to a missing ffi.h header on Linux build?

Running pip install cld2-cffi on my MacBook Pro worked fine. The same run on our Ubuntu server failed with:

Collecting cld2-cffi
  Using cached cld2-cffi-0.1.4.tar.gz
    Complete output from command python setup.py egg_info:
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
    compilation terminated.

The full error listing is at error.txt

Taking a cue from #12 I tried some of the compiler flags, although we're already on GCC 5:

$ env | grep "^C"
CFLAGS=-Wno-narrowing
CC=/usr/bin/gcc-5

Using pip install git+https://github.com/GregBowyer/cld2-cffi.git also fails.

System info:

$ uname -a
Linux chomsky 4.4.0-71-generic #92-Ubuntu SMP Fri Mar 24 12:59:01 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

$ python --version
Python 3.5.2

FWIW, was able to run pip install git+https://github.com/aboSamoor/pycld2.git on the same system with no issues, if that helps?

GregBowyer commented 7 years ago

apt-get these packages and you should be good

libffi-dev python-dev