Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package for zkllvm #30

Open
zah opened this issue Jan 31, 2023 · 3 comments
Open

Add package for zkllvm #30

zah opened this issue Jan 31, 2023 · 3 comments
Assignees

Comments

@zah
Copy link
Member

zah commented Jan 31, 2023

https://github.com/nilfoundation/zkllvm

Our CI should compile and test some of the examples provides in the zkllvm repository.

@monyarm
Copy link
Contributor

monyarm commented Feb 2, 2023

So far, i've managed to make a package for it that builds till 57%, before encountering errors from the included libcrypto, currently attempting to figure out the cause, and a solution.

@zah
Copy link
Member Author

zah commented Feb 2, 2023

In comments like the one above, it may be useful to cite the actual error message you are hitting.

@monyarm
Copy link
Contributor

monyarm commented Feb 2, 2023

True:

zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/XRay/CMakeFiles/LLVMXRay.dir/Profile.cpp.o
zkllvm> /build/zkllvm/bin/assigner/src/main.cpp:148:9: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
zkllvm>         fscanf(fptr, "%lld\n", &number);
zkllvm>         ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/XRay/CMakeFiles/LLVMXRay.dir/RecordInitializer.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:389:60: error: too many template arguments for class template 'plonk_arithmetization_params'
zkllvm>     using ArithmetizationParams = nil::crypto3::zk::snark::plonk_arithmetization_params<WitnessColumns, PublicInputColumns, ConstantColumns, SelectorColumns>;
zkllvm>                                                            ^                                                                                 ~~~~~~~~~~~~~~~~
zkllvm> /build/zkllvm/libs/crypto3/zk/include/nil/crypto3/zk/snark/arithmetization/plonk/params.hpp:35:24: note: template is declared here
zkllvm>                 struct plonk_arithmetization_params {
zkllvm>                        ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/tools/llvm-rc/CMakeFiles/llvm-rc.dir/ResourceScriptParser.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:390:103: error: use of undeclared identifier 'ArithmetizationParams'
zkllvm>     using ConstraintSystemType = nil::crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>;
zkllvm>                                                                                                       ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/tools/llvm-rc/CMakeFiles/llvm-rc.dir/ResourceScriptStmt.cpp.o
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDBSymbolCustom.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:391:103: error: use of undeclared identifier 'ArithmetizationParams'
zkllvm>     using TableDescriptionType = nil::crypto3::zk::snark::plonk_table_description<BlueprintFieldType, ArithmetizationParams>;
zkllvm>                                                                                                       ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDBSymbolData.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:394:105: error: use of undeclared identifier 'ConstraintSystemType'
zkllvm>     using value_marshalling_type = nil::crypto3::marshalling::types::plonk_constraint_system<TTypeBase, ConstraintSystemType>;
zkllvm>                                                                                                         ^
zkllvm> In file included from /build/zkllvm/bin/assigner/src/main.cpp:52:
zkllvm> /build/zkllvm/libs/assigner/include/nil/blueprint/parser.hpp:364:13: warning: non-void function does not return a value in all control paths [-Wreturn-type]
zkllvm>             }
zkllvm>             ^
zkllvm> /build/zkllvm/libs/assigner/include/nil/blueprint/parser.hpp:435:33: note: in instantiation of member function 'nil::blueprint::parser<nil::crypto3::algebra::fields::pallas_base_field, nil::crypto3::zk::snark::plonk_arithmetization_params<15, 5, 5>>::handle_instruction' requested here
zkllvm>                     next_inst = handle_instruction(next_inst);
zkllvm>                                 ^
zkllvm> /build/zkllvm/bin/assigner/src/main.cpp:158:26: note: in instantiation of function template specialization 'nil::blueprint::parser<nil::crypto3::algebra::fields::pallas_base_field, nil::crypto3::zk::snark::plonk_arithmetization_params<15, 5, 5>>::evaluate<std::vector<nil::crypto3::algebra::fields::detail::element_fp<nil::crypto3::algebra::fields::params<nil::crypto3::algebra::fields::pallas_base_field>>>>' requested here
zkllvm>     if (!parser_instance.evaluate(*module, public_input)) {
zkllvm>                          ^
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:395:63: error: use of undeclared identifier 'ArithmetizationParams'
zkllvm>     using ColumnsRotationsType = std::array<std::vector<int>, ArithmetizationParams::total_columns>;
zkllvm>                                                               ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/DebugInfo/DWARF/CMakeFiles/LLVMDebugInfoDWARF.dir/DWARFDataExtractor.cpp.o
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/DWARFEmitter.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:396:95: error: use of undeclared identifier 'ArithmetizationParams'
zkllvm>     using ProfilingType = nil::crypto3::minimized_profiling_plonk_circuit<BlueprintFieldType, ArithmetizationParams>;
zkllvm>                                                                                               ^
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:398:5: error: use of undeclared identifier 'value_marshalling_type'; did you mean 'nil::marshalling::is_marshalling_type'?
zkllvm>     value_marshalling_type  marshalled_data;
zkllvm>     ^~~~~~~~~~~~~~~~~~~~~~
zkllvm>     nil::marshalling::is_marshalling_type
zkllvm> /build/zkllvm/libs/crypto3/marshalling/core/include/nil/marshalling/type_traits.hpp:170:16: note: 'nil::marshalling::is_marshalling_type' declared here
zkllvm>         struct is_marshalling_type {
zkllvm>                ^
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:398:5: error: unknown type name 'value_marshalling_type'
zkllvm>     value_marshalling_type  marshalled_data;
zkllvm>     ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/DWARFYAML.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:399:5: error: unknown type name 'TableDescriptionType'
zkllvm>     TableDescriptionType    table_description;
zkllvm>     ^
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:402:93: error: use of undeclared identifier 'ConstraintSystemType'
zkllvm>     auto constraint_system = nil::crypto3::marshalling::types::make_plonk_constraint_system<ConstraintSystemType, Endianness>(marshalled_data);
zkllvm>                                                                                             ^
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:405:90: error: use of undeclared identifier 'ArithmetizationParams'
zkllvm>     using TableAssignmentType = nil::crypto3::zk::snark::plonk_table<BlueprintFieldType, ArithmetizationParams, ColumnType>;
zkllvm>                                                                                          ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/DXContainerEmitter.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:413:5: error: unknown type name 'TableAssignmentType'
zkllvm>     TableAssignmentType assignment_table;
zkllvm>     ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/DXContainerYAML.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:414:145: error: use of undeclared identifier 'ArithmetizationParams'
zkllvm>     std::tie(table_description.usable_rows_amount, table_description.rows_amount, assignment_table) = load_assignment_table<BlueprintFieldType, ArithmetizationParams, ColumnType>(iassignment);
zkllvm>                                                                                                                                                 ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDBSymbolExe.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:415:30: error: use of undeclared identifier 'ProfilingType'
zkllvm>     auto columns_rotations = ProfilingType::columns_rotations(constraint_system, table_description);
zkllvm>                              ^
zkllvm> [ 55%] Building CXX object libs/circifier/llvm/lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDBSymbolFunc.cpp.o
zkllvm> [ 56%] Building CXX object libs/circifier/llvm/lib/ObjCopy/CMakeFiles/LLVMObjCopy.dir/COFF/COFFReader.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:419:97: error: use of undeclared identifier 'ArithmetizationParams'
zkllvm>     using placeholder_params =  nil::crypto3::zk::snark::placeholder_params<BlueprintFieldType, ArithmetizationParams, Hash, Hash, Lambda>;
zkllvm>                                                                                                 ^
zkllvm> [ 56%] Building CXX object libs/circifier/llvm/lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDBSymbolFuncDebugEnd.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:420:91: error: use of undeclared identifier 'placeholder_params'; did you mean 'nil::crypto3::zk::snark::placeholder_params'?
zkllvm>     using types = nil::crypto3::zk::snark::detail::placeholder_policy<BlueprintFieldType, placeholder_params>;
zkllvm>                                                                                           ^~~~~~~~~~~~~~~~~~
zkllvm>                                                                                           nil::crypto3::zk::snark::placeholder_params
zkllvm> /build/zkllvm/libs/crypto3/zk/include/nil/crypto3/zk/snark/systems/plonk/placeholder/params.hpp:42:24: note: 'nil::crypto3::zk::snark::placeholder_params' declared here
zkllvm>                 struct placeholder_params {
zkllvm>                        ^
zkllvm> [ 56%] Building CXX object libs/circifier/llvm/lib/DebugInfo/DWARF/CMakeFiles/LLVMDebugInfoDWARF.dir/DWARFDebugAbbrev.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:420:91: error: use of undeclared identifier 'placeholder_params'
zkllvm>     using types = nil::crypto3::zk::snark::detail::placeholder_policy<BlueprintFieldType, placeholder_params>;
zkllvm>                                                                                           ^
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:424:18: error: use of undeclared identifier 'placeholder_params'
zkllvm>         typename placeholder_params::merkle_hash_type,
zkllvm>                  ^
zkllvm> [ 56%] Building CXX object libs/circifier/llvm/lib/XRay/CMakeFiles/LLVMXRay.dir/RecordPrinter.cpp.o
zkllvm> /build/zkllvm/bin/prepare_external_gate_argument/src/main.cpp:427:36: error: use of undeclared identifier 'FRIScheme'
zkllvm>     using FRIParamsType = typename FRIScheme::params_type;
zkllvm>                                    ^
zkllvm> fatal error: too many errors emitted, stopping now [-ferror-limit=]
zkllvm> 20 errors generated.
zkllvm> [ 56%] Building CXX object libs/circifier/llvm/lib/ExecutionEngine/JITLink/CMakeFiles/LLVMJITLink.dir/JITLinkMemoryManager.cpp.o
zkllvm> make[2]: *** [bin/prepare_external_gate_argument/CMakeFiles/prepare_external_gate_argument.dir/build.make:76: bin/prepare_external_gate_argument/CMakeFiles/prepare_external_gate_argument.dir/src/main.cpp.o] Error 1
zkllvm> make[1]: *** [CMakeFiles/Makefile2:12824: bin/prepare_external_gate_argument/CMakeFiles/prepare_external_gate_argument.dir/all] Error 2
zkllvm> make[1]: *** Waiting for unfinished jobs....

@monyarm monyarm mentioned this issue Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants