MarbleHE / HECO

Optimizing compiler for Fully Homomorphic Encryption (FHE)
Apache License 2.0
67 stars 18 forks source link

Building HECO - errors in repository files #51

Closed n242 closed 1 year ago

n242 commented 1 year ago

Hello, Could it be that the latest version in main is not updated? Since I've tried building HECO (after installing successfully all the necessary dependencies) and got compilation errors in HECO files, I fixed them only to get dozens of errors.

Build command: cmake --build . --target fhe-tool System information: Windows 10, Visual Studio 17 2022" -A x64, python 3.10.6, SEAL 4.0.0, c++17, cmake 3.26.0-msvc3,

(NOTE: FIX THEN ANOTHER ERROR LOG AT THE END)

The initial error log before fixing the files is:

MSBuild version 17.6.3+07e294721 for .NET Framework

Checking Build System Building LowerASTtoSSA.cpp.inc... Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/pr oject/MPC-HECO/src/Passes/ast2hir/CMakeLists.txt Building LowerBGVToEmitC.cpp.inc... Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/pr oject/MPC-HECO/src/Passes/bgv2emitc/CMakeLists.txt Building AST.cpp.inc... E:/myFolder/uni/masters/2nd_semestru/mpc/project/MPC-HECO/include/ heco/IR/AST/AST.td(79,70): error GD3F9BD08: Variable not defined: 'NoSideEffect' [E:\myFolder\uni\masters\2nd_semestru\mpc\project\M PC-HECO\build\include\heco\IR\AST\MLIRASTIncGen.vcxproj] Op<AST_Dialect, mnemonic, !listconcat(traits, [NoTermina tor, NoSideEffect])> {

   ^

E:\programs\Microsoft Visual Studio\2022\MSBuild\Microsoft\VC\v170 \Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build f or 'E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\buil d\CMakeFiles\6a7a3ad6bcfc65143adfa1cb24433f40\AST.cpp.inc.rule;E:\ myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMake Files\6a7a3ad6bcfc65143adfa1cb24433f40\AST.h.inc.rule;E:\myFolder\ uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\6a7 a3ad6bcfc65143adfa1cb24433f40\ASTDialect.cpp.inc.rule;E:\myFolder\ uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\6a7 a3ad6bcfc65143adfa1cb24433f40\ASTDialect.h.inc.rule;E:\myFolder\un i\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\6a7a3 ad6bcfc65143adfa1cb24433f40\ASTTypes.cpp.inc.rule;E:\myFolder\uni\ masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\6a7a3ad 6bcfc65143adfa1cb24433f40\ASTTypes.h.inc.rule;E:\myFolder\uni\mast ers\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\1f9081cc038 413f8f3810b5dd8cd7d90\MLIRASTIncGen.rule;E:\myFolder\uni\masters\2 nd_semestru\mpc\project\MPC-HECO\include\heco\IR\AST\CMakeLists.tx t' exited with code 1. [E:\myFolder\uni\masters\2nd_semestru\mpc\p roject\MPC-HECO\build\include\heco\IR\AST\MLIRASTIncGen.vcxproj] Building BGV.cpp.inc... E:/myFolder/uni/masters/2nd_semestru/mpc/project/MPC-HECO/include/ heco/IR/BGV/BGV.td(183,56): error GD3F9BD08: Variable not defined: 'NoSideEffect' [E:\myFolder\uni\masters\2nd_semestru\mpc\project\ MPC-HECO\build\include\heco\IR\BGV\MLIRBGVIncGen.vcxproj] Op<BGV_Dialect, mnemonic, !listconcat(traits, [NoSideEff ect])> { ^ E:\programs\Microsoft Visual Studio\2022\MSBuild\Microsoft\VC\v170 \Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build f or 'E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\buil d\CMakeFiles\01ea4537eede8f0dcd4e92bf3f077017\BGV.cpp.inc.rule;E:\ myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMake Files\01ea4537eede8f0dcd4e92bf3f077017\BGV.h.inc.rule;E:\myFolder\ uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\01e a4537eede8f0dcd4e92bf3f077017\BGVDialect.cpp.inc.rule;E:\myFolder\ uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\01e a4537eede8f0dcd4e92bf3f077017\BGVDialect.h.inc.rule;E:\myFolder\un i\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\01ea4 537eede8f0dcd4e92bf3f077017\BGVTypes.cpp.inc.rule;E:\myFolder\uni\ masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\01ea453 7eede8f0dcd4e92bf3f077017\BGVTypes.h.inc.rule;E:\myFolder\uni\mast ers\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\1ac8efa7e4c b1de68e0b331477a6dee1\MLIRBGVIncGen.rule;E:\myFolder\uni\masters\2 nd_semestru\mpc\project\MPC-HECO\include\heco\IR\BGV\CMakeLists.tx t' exited with code 1. [E:\myFolder\uni\masters\2nd_semestru\mpc\p roject\MPC-HECO\build\include\heco\IR\BGV\MLIRBGVIncGen.vcxproj] Building FHE.cpp.inc... E:/myFolder/uni/masters/2nd_semestru/mpc/project/MPC-HECO/include/ heco/IR/FHE/FHE.td(113,56): error GD3F9BD08: Variable not defined: 'NoSideEffect' [E:\myFolder\uni\masters\2nd_semestru\mpc\project\ MPC-HECO\build\include\heco\IR\FHE\MLIRFHEIncGen.vcxproj] Op<FHE_Dialect, mnemonic, !listconcat(traits, [NoSideEff ect])> { ^ E:\programs\Microsoft Visual Studio\2022\MSBuild\Microsoft\VC\v170 \Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build f or 'E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\buil d\CMakeFiles\e468c8c4cdbb186cb76c31d8565023c4\FHE.cpp.inc.rule;E:\ myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMake Files\e468c8c4cdbb186cb76c31d8565023c4\FHE.h.inc.rule;E:\myFolder\ uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\e46 8c8c4cdbb186cb76c31d8565023c4\FHEDialect.cpp.inc.rule;E:\myFolder\ uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\e46 8c8c4cdbb186cb76c31d8565023c4\FHEDialect.h.inc.rule;E:\myFolder\un i\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\e468c 8c4cdbb186cb76c31d8565023c4\FHETypes.cpp.inc.rule;E:\myFolder\uni\ masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\e468c8c 4cdbb186cb76c31d8565023c4\FHETypes.h.inc.rule;E:\myFolder\uni\mast ers\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\ba84f29a516 0a3c7cfb8c4f0cf0beffb\MLIRFHEIncGen.rule;E:\myFolder\uni\masters\2 nd_semestru\mpc\project\MPC-HECO\include\heco\IR\FHE\CMakeLists.tx t' exited with code 1. [E:\myFolder\uni\masters\2nd_semestru\mpc\p roject\MPC-HECO\build\include\heco\IR\FHE\MLIRFHEIncGen.vcxproj] Building Poly.cpp.inc... E:/myFolder/uni/masters/2nd_semestru/mpc/project/MPC-HECO/include/ heco/IR/Poly/Poly.td(94,57): error GD3F9BD08: Variable not defined : 'NoSideEffect' [E:\myFolder\uni\masters\2nd_semestru\mpc\project \MPC-HECO\build\include\heco\IR\Poly\MLIRPolyIncGen.vcxproj] Op<Poly_Dialect, mnemonic, !listconcat(traits, [NoSideEf fect])> { ^ E:\programs\Microsoft Visual Studio\2022\MSBuild\Microsoft\VC\v170 \Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build f or 'E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\buil d\CMakeFiles\e0ddedf1159f9df4ee43ad39ffd703a6\Poly.cpp.inc.rule;E: \myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMak eFiles\e0ddedf1159f9df4ee43ad39ffd703a6\Poly.h.inc.rule;E:\myFolde r\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\e 0ddedf1159f9df4ee43ad39ffd703a6\PolyDialect.cpp.inc.rule;E:\myFold er\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\ e0ddedf1159f9df4ee43ad39ffd703a6\PolyDialect.h.inc.rule;E:\myFolde r\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\e 0ddedf1159f9df4ee43ad39ffd703a6\PolyTypes.cpp.inc.rule;E:\myFolder \uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\e0 ddedf1159f9df4ee43ad39ffd703a6\PolyTypes.h.inc.rule;E:\myFolder\un i\masters\2nd_semestru\mpc\project\MPC-HECO\build\CMakeFiles\ff50a cfb62e704ede97a8906d13fa96b\MLIRPolyIncGen.rule;E:\myFolder\uni\ma sters\2nd_semestru\mpc\project\MPC-HECO\include\heco\IR\Poly\CMake Lists.txt' exited with code 1. [E:\myFolder\uni\masters\2nd_semest ru\mpc\project\MPC-HECO\build\include\heco\IR\Poly\MLIRPolyIncGen. vcxproj] Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/pr oject/MPC-HECO/CMakeLists.txt Building LowerBGVToLLVM.cpp.inc... Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/pr oject/MPC-HECO/src/Passes/bgv2llvm/CMakeLists.txt Building LowerFHEToBGV.cpp.inc... Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/pr oject/MPC-HECO/src/Passes/fhe2bgv/CMakeLists.txt

After editing files: AST.td, BGV.td, FHE.td, Poly.td s.t replaced: "NoSideEffect" with "NoMemoryEffect" and "operands" with "operand" I got the following error log (it was too long so attached in file):

cmake --build . --target fhe-tool MSBuild version 17.6.3+07e294721 for .NET Framework

Building AST.cpp.inc... Building AST.h.inc... Building ASTDialect.cpp.inc... Building ASTDialect.h.inc... Building ASTTypes.cpp.inc... Building ASTTypes.h.inc... Building BGV.cpp.inc... Building BGV.h.inc... Building BGVDialect.cpp.inc... Building BGVDialect.h.inc... Building BGVTypes.cpp.inc... Building BGVTypes.h.inc... Building FHE.cpp.inc... Building FHE.h.inc... Building FHEDialect.cpp.inc... Building FHEDialect.h.inc... Building FHETypes.cpp.inc... Building FHETypes.h.inc... Building Poly.cpp.inc... Building Poly.h.inc... Building PolyDialect.cpp.inc... Building PolyDialect.h.inc... Building PolyTypes.cpp.inc... Building PolyTypes.h.inc... Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/project/MPC-HECO/CMakeLists.txt Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/project/MPC-HECO/src/IR/AST/CMake Lists.txt cl : command line warning D9025: overriding '/EHs' with '/EHs-' [E:\myFolder\uni\masters\2nd_sem estru\mpc\project\MPC-HECO\build\src\IR\AST\obj.HECOASTDialect.vcxproj] ASTDialect.cpp cl : command line warning D9025: overriding '/EHc' with '/EHc-' [E:\myFolder\uni\masters\2nd_sem estru\mpc\project\MPC-HECO\build\src\IR\AST\obj.HECOASTDialect.vcxproj] obj.HECOASTDialect.vcxproj -> E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\s rc\IR\AST\obj.HECOASTDialect.dir\Debug\obj.HECOASTDialect.lib Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/project/MPC-HECO/src/IR/AST/CMake Lists.txt HECOASTDialect.vcxproj -> E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\lib\H ECOASTDialect.lib Building Custom Rule E:/myFolder/uni/masters/2nd_semestru/mpc/project/MPC-HECO/src/IR/BGV/CMake Lists.txt cl : command line warning D9025: overriding '/EHs' with '/EHs-' [E:\myFolder\uni\masters\2nd_sem estru\mpc\project\MPC-HECO\build\src\IR\BGV\obj.HECOBGVDialect.vcxproj] cl : command line warning D9025: overriding '/EHc' with '/EHc-' [E:\myFolder\uni\masters\2nd_sem estru\mpc\project\MPC-HECO\build\src\IR\BGV\obj.HECOBGVDialect.vcxproj] BGVDialect.cpp E:\myFolder\uni\masters\2nd_semestru\mpc\project\llvm-new\llvm-project\mlir\include\mlir/IR/Built inAttributes.h(359,7): warning C4996: 'std::complex::complex': warning STL4037: Th e effect of instantiating the template std::complex for any type other than float, double, or lon g double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppr ess this warning. [E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\build\src\IR\BGV\obj .HECOBGVDialect.vcxproj] E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\src\IR\BGV\BGVDialect.cpp(25,43): error C2039: 'Optional': is not a member of 'llvm' [E:\myFolder\uni\masters\2nd_semestru\mpc\project\M PC-HECO\build\src\IR\BGV\obj.HECOBGVDialect.vcxproj] E:\myFolder\uni\masters\2nd_semestru\mpc\project\llvm-new\llvm-project\llvm\include\llvm/ADT/Type Switch.h(22,11): message : see declaration of 'llvm' [E:\myFolder\uni\masters\2nd_semestru\mpc\pr oject\MPC-HECO\build\src\IR\BGV\obj.HECOBGVDialect.vcxproj] E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC-HECO\src\IR\BGV\BGVDialect.cpp(25,51): error C2061: syntax error: identifier 'Optional' [E:\myFolder\uni\masters\2nd_semestru\mpc\project\MPC -HECO\build\src\IR\BGV\obj.HECOBGVDialect.vcxproj]

THE FULL ERROR LOG IS IN THE FILE:

error-log2.txt

Any help will be appreciated!

AlexanderViand commented 1 year ago

Hi! You're right, main is quite a mess right now, sorry for the inconvenience!

You can check out artifact (which was prepared for the Usenix Artifact Evaluation) and is a known-good configuration: https://github.com/MarbleHE/HECO/tree/artifact

After you follow the "Installation" instructions in the main README, you can look at the evaluation README for instructions on how to try out HECO.

n242 commented 1 year ago

Appreciate your help. I'll try the artifact branch, but with which version of MLIR is it compatible to? Since in main branch it looked like some of the problems were due to version incompatibility of MLIR. Thank you!

AlexanderViand-Intel commented 1 year ago

The artifact was frozen with an LLVM version from approx. two weeks ago, but there's proper submodules/etc in there that specify the exact version, also for SEAL, our other big dependency :)