prashnts / pybloomfiltermmap3

Fast Python Bloom Filter using Mmap
https://github.com/prashnts/pybloomfiltermmap3
MIT License
130 stars 24 forks source link

Build failure with Python 3.11: longintrepr.h: No such file or directory #50

Closed dfuhry closed 1 year ago

dfuhry commented 2 years ago

Output for "pip install pybloomfiltermmap3" step in Docker container using Python 3.11:

  Building wheel for pybloomfiltermmap3 (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'pybloomfilter' extension
      creating build
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/src
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.11 -c src/MurmurHash3.c -o build/temp.linux-x86_64-cpython-311/src/MurmurHash3.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.11 -c src/bloomfilter.c -o build/temp.linux-x86_64-cpython-311/src/bloomfilter.o
      src/bloomfilter.c:11:14: warning: ‘always_inline’ function might not be inlinable [-Wattributes]
         11 | BloomFilter *bloomfilter_Create_Malloc(size_t max_num_elem, double error_rate,
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.11 -c src/md5.c -o build/temp.linux-x86_64-cpython-311/src/md5.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.11 -c src/mmapbitarray.c -o build/temp.linux-x86_64-cpython-311/src/mmapbitarray.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.11 -c src/primetester.c -o build/temp.linux-x86_64-cpython-311/src/primetester.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.11 -c src/pybloomfilter.c -o build/temp.linux-x86_64-cpython-311/src/pybloomfilter.o
      src/pybloomfilter.c:196:12: fatal error: longintrepr.h: No such file or directory
        196 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pybloomfiltermmap3
  Running setup.py clean for pybloomfiltermmap3

The Dockerfile I've used is attached. (I had to give it a ".txt" extension for Github to accept the file to be attached.) Dockerfile.txt

prashnts commented 1 year ago

Hi @dfuhry! If this is still valid for you, could you try with the latest version 0.5.7?

I have tested that your dockerfile does work now.

Screenshot 2023-02-16 at 21 41 04
phelpsdb commented 1 year ago

I can confirm v0.5.7 also worked for installing pybloomfiltermmap3 on macos (M1). Thank you for the fix.