openfheorg / openfhe-python

Official Python wrapper for OpenFHE. Current release is v0.8.8 (released on June 25, 2024).
https://openfheorg.github.io/openfhe-python/html/index.html
BSD 2-Clause "Simplified" License
60 stars 18 forks source link

installation error #96

Closed pavan-ranganath closed 5 months ago

pavan-ranganath commented 6 months ago

cmake is successfull

When I try to make the project, I met these problem,how can I solve it?

pavanr@central-server:~/Downloads/openfhe-python/build$ cmake .. -DPYTHON_EXECUTABLE_PATH=/usr/bin/python3 -Dpybind11_DIR=/home/pavanr/.local/lib/python3.8/site-packages/pybind11/share/cmake/pybind11 -DOpenFHE_DIR=/usr/local/include/openfhe
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3.6")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: /home/pavanr/.local/lib/python3.8/site-packages/pybind11/include (found version "2.11.1")
-- Python site packages directory: /usr/lib/python3/dist-packages
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pavanr/Downloads/openfhe-python/build
pavanr@central-server:~/Downloads/openfhe-python/build$ make
Scanning dependencies of target openfhe
[ 16%] Building CXX object CMakeFiles/openfhe.dir/src/lib/bindings.cpp.o
In file included from /home/pavanr/Downloads/openfhe-python/src/lib/bindings.cpp:1:
/home/pavanr/.local/lib/python3.8/site-packages/pybind11/include/pybind11/pybind11.h: In instantiation of ‘void pybind11::cpp_function::initialize(Func&&, Return (*)(Args ...), const Extra& ...) [with Func = pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...), const Extra& ...) [with Return = void; Class = lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >; Arg = {std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<unsigned int, std::allocator<unsigned int> >, unsigned int, unsigned int, bool}; Extra = {pybind11::name, pybind11::is_method, pybind11::sibling, const char*, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v}]::<lambda(lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >*, std::vector<unsigned int>, std::vector<unsigned int>, unsigned int, unsigned int, bool)>; Return = void; Args = {lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >*, std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<unsigned int, std::allocator<unsigned int> >, unsigned int, unsigned int, bool}; Extra = {pybind11::name, pybind11::is_method, pybind11::sibling, const char*, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v}]’:
/home/pavanr/.local/lib/python3.8/site-packages/pybind11/include/pybind11/pybind11.h:110:9:   required from ‘pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...), const Extra& ...) [with Return = void; Class = lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >; Arg = {std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<unsigned int, std::allocator<unsigned int> >, unsigned int, unsigned int, bool}; Extra = {pybind11::name, pybind11::is_method, pybind11::sibling, const char*, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v}]’
/home/pavanr/.local/lib/python3.8/site-packages/pybind11/include/pybind11/pybind11.h:1575:22:   required from ‘pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(const char*, Func&&, const Extra& ...) [with Func = void (lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >::*)(std::vector<unsigned int>, std::vector<unsigned int>, unsigned int, unsigned int, bool); Extra = {const char*, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v}; type_ = lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >; options = {std::shared_ptr<lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > > >}]’
/home/pavanr/Downloads/openfhe-python/src/lib/bindings.cpp:587:45:   required from here
/home/pavanr/.local/lib/python3.8/site-packages/pybind11/include/pybind11/pybind11.h:219:40: error: static assertion failed: The number of argument annotations does not match the number of function arguments
  219 |             expected_num_args<Extra...>(
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  220 |                 sizeof...(Args), cast_in::args_pos >= 0, cast_in::has_kwargs),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pavanr/.local/lib/python3.8/site-packages/pybind11/include/pybind11/attr.h:14,
                 from /home/pavanr/.local/lib/python3.8/site-packages/pybind11/include/pybind11/detail/class.h:12,
                 from /home/pavanr/.local/lib/python3.8/site-packages/pybind11/include/pybind11/pybind11.h:13,
                 from /home/pavanr/Downloads/openfhe-python/src/lib/bindings.cpp:1:
/home/pavanr/.local/lib/python3.8/site-packages/pybind11/include/pybind11/cast.h:1453:57: error: ‘std::enable_if_t<std::is_void<_Yp>::value, pybind11::detail::void_type> pybind11::detail::argument_loader<Args>::call(Func&&) && [with Return = void; Guard = pybind11::detail::void_type; Func = pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...), const Extra& ...) [with Return = void; Class = lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >; Arg = {std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<unsigned int, std::allocator<unsigned int> >, unsigned int, unsigned int, bool}; Extra = {pybind11::name, pybind11::is_method, pybind11::sibling, const char*, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v}]::<lambda(lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >*, std::vector<unsigned int>, std::vector<unsigned int>, unsigned int, unsigned int, bool)>&; Args = {lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >*, std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<unsigned int, std::allocator<unsigned int> >, unsigned int, unsigned int, bool}; std::enable_if_t<std::is_void<_Yp>::value, pybind11::detail::void_type> = pybind11::detail::void_type]’, declared using local type ‘pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...), const Extra& ...) [with Return = void; Class = lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >; Arg = {std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<unsigned int, std::allocator<unsigned int> >, unsigned int, unsigned int, bool}; Extra = {pybind11::name, pybind11::is_method, pybind11::sibling, const char*, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v}]::<lambda(lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >*, std::vector<unsigned int>, std::vector<unsigned int>, unsigned int, unsigned int, bool)>’, is used but never defined [-fpermissive]
 1453 |     enable_if_t<std::is_void<Return>::value, void_type> call(Func &&f) && {
      |                                                         ^~~~
make[2]: *** [CMakeFiles/openfhe.dir/build.make:63: CMakeFiles/openfhe.dir/src/lib/bindings.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/openfhe.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Additional information

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:    20.04
Codename:   focal
bpradeep508 commented 6 months ago

i am also facing same problem

devharsh commented 6 months ago

make error on macos

[ 16%] Building CXX object CMakeFiles/openfhe.dir/src/lib/bindings.cpp.o
In file included from /Users/devharsh/Downloads/openfhe-python/src/lib/bindings.cpp:1:
/usr/local/include/pybind11/pybind11.h:218:9: error: static assertion failed due to requirement 'expected_num_args<pybind11::name, pybind11::is_method, pybind11::sibling, const char *, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v>(sizeof...(Args), argument_loader<lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned long long>>>> *, std::vector<unsigned int, std::allocator<unsigned int>>, std::vector<unsigned int, std::allocator<unsigned int>>, unsigned int, unsigned int, bool>::args_pos >= 0, argument_loader<lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned long long>>>> *, std::vector<unsigned int, std::allocator<unsigned int>>, std::vector<unsigned int, std::allocator<unsigned int>>, unsigned int, unsigned int, bool>::has_kwargs)': The number of argument annotations does not match the number of function arguments
        static_assert(
        ^
/usr/local/include/pybind11/pybind11.h:110:9: note: in instantiation of function template specialization 'pybind11::cpp_function::initialize<(lambda at /usr/local/include/pybind11/pybind11.h:111:13), void, lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned long long>>>> *, std::vector<unsigned int>, std::vector<unsigned int>, unsigned int, unsigned int, bool, pybind11::name, pybind11::is_method, pybind11::sibling, const char *, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v>' requested here
        initialize(
        ^
/usr/local/include/pybind11/pybind11.h:1575:22: note: in instantiation of function template specialization 'pybind11::cpp_function::cpp_function<void, lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned long long>>>>, std::vector<unsigned int>, std::vector<unsigned int>, unsigned int, unsigned int, bool, pybind11::name, pybind11::is_method, pybind11::sibling, const char *, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v>' requested here
        cpp_function cf(method_adaptor<type>(std::forward<Func>(f)),
                     ^
/Users/devharsh/Downloads/openfhe-python/src/lib/bindings.cpp:582:10: note: in instantiation of function template specialization 'pybind11::class_<lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned long long>>>>, std::shared_ptr<lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned long long>>>>>>::def<void (lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned long long>>>>::*)(std::vector<unsigned int>, std::vector<unsigned int>, unsigned int, unsigned int, bool), const char *, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v, pybind11::arg_v>' requested here
        .def("EvalBootstrapSetup", &CryptoContextImpl<DCRTPoly>::EvalBootstrapSetup,
         ^
1 error generated.
make[2]: *** [CMakeFiles/openfhe.dir/src/lib/bindings.cpp.o] Error 1
make[1]: *** [CMakeFiles/openfhe.dir/all] Error 2
make: *** [all] Error 2
Sleepy026 commented 6 months ago

Git checkout 4ebb28ea7bdd894a73bc5b73e59fcfbc78253308 in the openFHE lib, and build the whole openFHE lib again. They made some changes that broke this lib.

bpradeep508 commented 6 months ago

still same problem

Sleepy026 commented 6 months ago

try this: Git checkout f6f1b9c ( OpenFHE ) Git checkout 4e39933 ( OpenFHE-Python )

bpradeep508 commented 6 months ago

Thanks, its working fine now

pavan-ranganath commented 6 months ago

Its working now

Thank you

IanQS commented 5 months ago

So I just tested this on a new fresh build (fresh pull of openfhe-dev and openfhe-python). I ran into the same issue, but managed to fix it via #98

I've tested it locally and the build is successful. Stay tuned and I'll post an updated comment, which should allow you to now build off the updated openfhe-dev

yspolyakov commented 5 months ago

The fix has been merged to main (release version updated to v0.8.4)