inbloom
inbloom copied to clipboard
inbloom.c compilation error
Great job with this cross-platform implementation.
Therefore, I when I try to install it via pip (and pip3) I got the following compilation error:
Running setup.py install for inbloom Running command /usr/bin/python3 -c "import setuptools, tokenize;file='/tmp/pip_build_root/inbloom/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-e5h0ko0c-record/install-record.txt --single-version-externally-managed --compile running install running build running build_ext building 'inbloom' extension creating build creating build/temp.linux-x86_64-3.4 creating build/temp.linux-x86_64-3.4/inbloom creating build/temp.linux-x86_64-3.4/vendor creating build/temp.linux-x86_64-3.4/vendor/libbloom creating build/temp.linux-x86_64-3.4/vendor/libbloom/murmur2 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Ivendor/libbloom/murmur2 -I/usr/include/python3.4m -c inbloom/inbloom.c -o build/temp.linux-x86_64-3.4/inbloom/inbloom.o
inbloom/inbloom.c:186:9: error: ‘Filter’ has no member named ‘ob_type’ self->ob_type->tp_free((PyObject*)self);
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Is there any other installation requirement?
Hi, The issue is that we lack support for Python 3. I don't think I'll be able to add Python 3 support soon. So your best options are either working with Python 2 (if that's possible) or provide a PR for Python 3 support.
Thanks for the quick answer. I tried to port the C extension following this guide (http://python3porting.com/cextensions.html) and could compile and install via pip, but when I import inbloom in Python 3 I end up stuck with the error "Segmentation fault", with no reference of the line causing the exception. Maybe I will try a pure Python Bloom Filter, and maybe make it compatible with your Java implementation, for portability.
Can you send us the ported diff, I'll try to debug it and see what happened.
@gabrielspmoreira I have submitted a PR to support Python3. It works in my local env. You can have a try if you want ^_^