Переглянути джерело

180 dev branchs ci fails (#182)

* Fixed compiler bugs

* Disabled a compiler flag

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
dsuponitskiy 1 рік тому
батько
коміт
84a11f6b83
3 змінених файлів з 15 додано та 15 видалено
  1. 4 1
      CMakeLists.txt
  2. 8 8
      src/lib/binfhe_bindings.cpp
  3. 3 6
      src/lib/pke/serialization.cpp

+ 4 - 1
CMakeLists.txt

@@ -17,7 +17,10 @@ endif()
 find_package(OpenFHE 1.2.1 REQUIRED)
 find_package(pybind11 REQUIRED)
 
-set( CMAKE_CXX_FLAGS ${OpenFHE_CXX_FLAGS} )
+# "CMAKE_INTERPROCEDURAL_OPTIMIZATION ON" (ON is the default value) causes link failure. see
+# https://github.com/openfheorg/openfhe-python/actions/runs/11492843373/job/31987579944
+set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
+
 set( OpenFHE_Py_SOURCES src/lib)
 set( OpenFHE_Py_INCLUDES src/include)
 

+ 8 - 8
src/lib/binfhe_bindings.cpp

@@ -32,9 +32,9 @@
 #include "binfhecontext_docs.h"
 #include "binfhecontext_wrapper.h"
 #include "openfhe.h"
-#include "openfhe/cereal/archives/binary.hpp"
-#include "openfhe/cereal/archives/portable_binary.hpp"
-#include "openfhe/core/utils/serial.h"
+#include "cereal/archives/binary.hpp"
+#include "cereal/archives/portable_binary.hpp"
+#include "core/utils/serial.h"
 #include <iostream>
 #include <pybind11/operators.h>
 #include <pybind11/pybind11.h>
@@ -184,15 +184,15 @@ void bind_binfhe_context(py::module &m) {
            py::arg("sk"), py::arg("ct"), py::arg("p") = 4)
       .def("EvalBinGate",
            static_cast<LWECiphertext (BinFHEContext::*)(
-               BINGATE, ConstLWECiphertext &, ConstLWECiphertext &) const>(
+               BINGATE, ConstLWECiphertext &, ConstLWECiphertext &, bool) const>(
                &BinFHEContext::EvalBinGate),
            binfhe_EvalBinGate_docs, py::arg("gate"), py::arg("ct1"),
-           py::arg("ct2"))
+           py::arg("ct2"), py::arg("extended") = false)
       .def("EvalBinGate",
            static_cast<LWECiphertext (BinFHEContext::*)(
-               BINGATE, const std::vector<LWECiphertext> &) const>(
+               BINGATE, const std::vector<LWECiphertext> &, bool) const>(
                &BinFHEContext::EvalBinGate),
-           py::arg("gate"), py::arg("ctvector"))
+           py::arg("gate"), py::arg("ctvector"), py::arg("extended") = false)
       .def("EvalNOT", &BinFHEContext::EvalNOT, binfhe_EvalNOT_docs,
            py::arg("ct"))
       .def("Getn", &GetnWrapper)
@@ -212,7 +212,7 @@ void bind_binfhe_context(py::module &m) {
       .def("EvalNOT", &BinFHEContext::EvalNOT)
       .def("EvalConstant", &BinFHEContext::EvalConstant)
       .def("ClearBTKeys", &BinFHEContext::ClearBTKeys)
-      .def("Bootstrap", &BinFHEContext::Bootstrap, py::arg("ct"))
+      .def("Bootstrap", &BinFHEContext::Bootstrap, py::arg("ct"), py::arg("extended") = false)
       .def("SerializedVersion", &BinFHEContext::SerializedVersion,
            binfhe_SerializedVersion_docs)
       .def("SerializedObjectName", &BinFHEContext::SerializedObjectName,

+ 3 - 6
src/lib/pke/serialization.cpp

@@ -47,8 +47,7 @@ template <typename ST>
 bool SerializeEvalMultKeyWrapper(const std::string &filename, const ST &sertype, std::string id)
 {
     std::ofstream outfile(filename, std::ios::out | std::ios::binary);
-    bool res;
-    res = CryptoContextImpl<DCRTPoly>::SerializeEvalMultKey<ST>(outfile, sertype, id);
+    bool res = CryptoContextImpl<DCRTPoly>::SerializeEvalMultKey<ST>(outfile, sertype, id);
     outfile.close();
     return res;
 }
@@ -57,8 +56,7 @@ template <typename ST>
 bool SerializeEvalAutomorphismKeyWrapper(const std::string& filename, const ST& sertype, std::string id)
 {
     std::ofstream outfile(filename, std::ios::out | std::ios::binary);
-    bool res;
-    res = CryptoContextImpl<DCRTPoly>::SerializeEvalAutomorphismKey<ST>(outfile, sertype, id);
+    bool res = CryptoContextImpl<DCRTPoly>::SerializeEvalAutomorphismKey<ST>(outfile, sertype, id);
     outfile.close();
     return res;
 }
@@ -71,8 +69,7 @@ bool DeserializeEvalMultKeyWrapper(const std::string &filename, const ST &sertyp
     {
         std::cerr << "I cannot read serialization from " << filename << std::endl;
     }
-    bool res;
-    res = CryptoContextImpl<DCRTPoly>::DeserializeEvalMultKey<ST>(emkeys, sertype);
+    bool res = CryptoContextImpl<DCRTPoly>::DeserializeEvalMultKey<ST>(emkeys, sertype);
     return res; }
 
 template <typename T, typename ST>