openfheorg / openfhe-python

Official Python wrapper for OpenFHE. Current release is v0.8.9 (released on September 10, 2024).
https://openfheorg.github.io/openfhe-python/html/index.html
BSD 2-Clause "Simplified" License
73 stars 21 forks source link

Serialization not working in macOS #69

Closed harshkasyap closed 6 months ago

harshkasyap commented 12 months ago

While running openfhe-python/examples/pke/simple-integers-serial.py

RuntimeError: Trying to save an unregistered polymorphic type (lbcrypto::CryptoContextImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint>>>). Make sure your type is registered with CEREAL_REGISTER_TYPE and that the archive you are using was included (and registered with CEREAL_REGISTER_ARCHIVE) prior to calling CEREAL_REGISTER_TYPE. If your type is already registered and you still see this error, you may need to use CEREAL_REGISTER_DYNAMIC_INIT.

Environment: Prepared a Conda environment on Apple M2 Pro, and able to run other examples.

However, it worked for me, in Linux environment.

geethasitaraman commented 5 months ago

@yspolyakov I get the same error when running the c++ version of this app((openfhe-development). I am running it on a Mac M2 pro.

./simple-integers-serial
This program requres the subdirectory `demoData' to exist, otherwise you will get an error writing serializations.

The cryptocontext has been generated.
libc++abi: terminating due to uncaught exception of type cereal::Exception: Trying to save an unregistered polymorphic type (lbcrypto::CryptoParametersBFVRNS).
Make sure your type is registered with CEREAL_REGISTER_TYPE and that the archive you are using was included (and registered with CEREAL_REGISTER_ARCHIVE) prior to calling CEREAL_REGISTER_TYPE.
If your type is already registered and you still see this error, you may need to use CEREAL_REGISTER_DYNAMIC_INIT.
zsh: abort      ./simple-integers-serial

I tried adding the change you made to the cmakelists.txt on the root and rebuild it but no luck


if (APPLE)
    set(CMAKE_CXX_VISIBILITY_PRESET default)
endif()

@jkav77 fyi