From 5f16cfabbf7ad890943003dddea4c1e980a5312c Mon Sep 17 00:00:00 2001 From: youben11 Date: Mon, 30 Aug 2021 13:29:54 +0100 Subject: [PATCH] fix(Runtime): link missing libraries We currently use LD_PRELOAD with the python extension to make the JIT execution find the appropriate symbols, however, not linking with some libraries caused other tools such as make to complain of not finding symbols from libpthread and others --- compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp | 6 ++++-- compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp | 6 ++++-- compiler/lib/Runtime/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp b/compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp index 43f6fe591..87805d462 100644 --- a/compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp +++ b/compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp @@ -110,9 +110,11 @@ bool verifyEncryptedIntegerInputsConsistency(::mlir::OpState &op, // Disable this check for the moment // Check the witdh of the encrypted integer and the integer of the tabulated // lambda are equals - // if (ct.getWidth() != l_cst.getElementType().cast().getWidth()) { + // if (ct.getWidth() != l_cst.getElementType().cast().getWidth()) + // { // op.emitOpError() - // << " should have equals width beetwen the encrypted integer result and " + // << " should have equals width beetwen the encrypted integer result + // and " // "integers of the `tabulated_lambda` argument"; // return mlir::failure(); // } diff --git a/compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp b/compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp index cdf516bc8..073749940 100644 --- a/compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp +++ b/compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp @@ -126,8 +126,10 @@ mlir::LogicalResult verifyApplyLookupTable(ApplyLookupTable &op) { // Disable this check for the moment // Check the witdh of the encrypted integer and the integer of the tabulated // lambda are equals - // if (result.getP() < l_cst.getElementType().cast().getWidth()) { - // op.emitOpError() << "should have the width of the constants less or equals " + // if (result.getP() < l_cst.getElementType().cast().getWidth()) + // { + // op.emitOpError() << "should have the width of the constants less or + // equals " // "than the precision of the encrypted integer"; // return mlir::failure(); // } diff --git a/compiler/lib/Runtime/CMakeLists.txt b/compiler/lib/Runtime/CMakeLists.txt index 973a9a48c..0019be33d 100644 --- a/compiler/lib/Runtime/CMakeLists.txt +++ b/compiler/lib/Runtime/CMakeLists.txt @@ -3,4 +3,4 @@ add_library(ZamalangRuntime SHARED wrappers.c ) -target_link_libraries(ZamalangRuntime Concrete) \ No newline at end of file +target_link_libraries(ZamalangRuntime Concrete pthread m dl) \ No newline at end of file