Skip to content

Commit

Permalink
180 dev branchs ci fails (#182)
Browse files Browse the repository at this point in the history
* Fixed compiler bugs

* Disabled a compiler flag

---------

Co-authored-by: Dmitriy Suponitskiy <[email protected]>
  • Loading branch information
dsuponitskiy and dsuponitskiy-duality authored Oct 24, 2024
1 parent 79d5dac commit 84a11f6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
16 changes: 8 additions & 8 deletions src/lib/binfhe_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down
9 changes: 3 additions & 6 deletions src/lib/pke/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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>
Expand Down

0 comments on commit 84a11f6

Please sign in to comment.