ibarrond / Pyfhel

PYthon For Homomorphic Encryption Libraries, perform encrypted computations such as sum, mult, scalar product or matrix multiplication in Python, with NumPy compatibility. Uses SEAL/PALISADE as backends, implemented using Cython.
https://pyfhel.readthedocs.io/
Apache License 2.0
489 stars 78 forks source link

SEAL can be found only for x86 on aarch64 #242

Open skriesch opened 5 months ago

skriesch commented 5 months ago

Description If you want to install with "pip install ." on an Raspberry Pi 4 (aarch64), you are receiving the following error message:

aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.11 -I/home/skriesch/homomorphic/lib/python3.11/site-packages/numpy/_core/include -IPyfhel -IPyfhel/Afhel -IPyfhel/SEAL/SEAL/seal -I/home/skriesch/homomorphic/include -I/usr/include/python3.11 -c Pyfhel/Afhel/Afseal.cpp -o build/temp.linux-aarch64-cpython-311/Pyfhel/Afhel/Afseal.o -std=c++17 -O3 -DHAVE_CONFIG_H
      In file included from Pyfhel/Afhel/../SEAL/SEAL/seal/defines.h:68,
                       from Pyfhel/Afhel/../SEAL/SEAL/seal/bigpoly.h:8,
                       from Pyfhel/Afhel/../SEAL/SEAL/seal/seal.h:3,
                       from Pyfhel/Afhel/Afseal.h:41,
                       from Pyfhel/Afhel/Afseal.cpp:37:
      Pyfhel/Afhel/../SEAL/SEAL/seal/gcc.h:20:10: fatal error: x86intrin.h: No such file or directory
         20 | #include <x86intrin.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.

Code To Reproduce Error 1) Clone the repo 2) Set the Python environment 3) Enter "pip install ." 4) SEAL can not be built for aarch64

Expected behavior SEAL will be built

Workaround Clone the MS SEAL Project and build for aarch64

Setup:

skriesch commented 4 months ago

I want to suggest a more maintainable solution of dependencies (like SEAL). Other projects are using makefiles with the feature to fetch special versions. Then you don't need "git clone" in your repository. Here is such an example for SEAL: https://github.com/OpenMined/TenSEAL/blob/main/cmake/seal.cmake

Is that a possible solution for you as a replacement of the old SEAL version from 2 years ago?

ibarrond commented 4 months ago

@skriesch I'll take a look!