Skip to content

Commit

Permalink
Add and use DISABLE_AZTEC_VM
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton committed Jun 7, 2024
1 parent 79a0e03 commit 978f772
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions barretenberg/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ endif(DOXYGEN_FOUND)

option(DISABLE_ASM "Disable custom assembly" OFF)
option(DISABLE_ADX "Disable ADX assembly variant" OFF)
option(DISABLE_AZTEC_VM "Don't build Aztec VM (acceptable if iterating on core proving)" ON)
option(MULTITHREADING "Enable multi-threading" ON)
option(OMP_MULTITHREADING "Enable OMP multi-threading" OFF)
option(FUZZING "Build ONLY fuzzing harnesses" OFF)
Expand Down Expand Up @@ -144,6 +145,12 @@ include(cmake/module.cmake)
include(cmake/msgpack.cmake)
include(cmake/backward-cpp.cmake)

if (NOT WASM)
set(DISABLE_AZTEC_VM ON)
endif()
if(DISABLE_AZTEC_VM)
add_definitions(-DDISABLE_AZTEC_VM=1)
endif()
add_subdirectory(src)
if (ENABLE_ASAN AND NOT(FUZZING))
find_program(LLVM_SYMBOLIZER_PATH NAMES llvm-symbolizer-16)
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ set(BARRETENBERG_TARGET_OBJECTS
$<TARGET_OBJECTS:translator_vm_recursion_objects>
$<TARGET_OBJECTS:ultra_honk_objects>)

if(NOT WASM)
if(NOT DISABLE_AZTEC_VM)
# enable AVM
list(APPEND BARRETENBERG_TARGET_OBJECTS $<TARGET_OBJECTS:vm_objects>)
endif()
Expand Down
4 changes: 4 additions & 0 deletions barretenberg/cpp/src/barretenberg/bb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ void vk_as_fields(const std::string& vk_path, const std::string& output_path)
}
}

#ifndef DISABLE_AZTEC_VM
/**
* @brief Writes an avm proof and corresponding (incomplete) verification key to files.
*
Expand Down Expand Up @@ -586,6 +587,7 @@ bool avm_verify(const std::filesystem::path& proof_path, const std::filesystem::
vinfo("verified: ", verified);
return verified;
}
#endif

/**
* @brief Creates a proof for an ACIR circuit
Expand Down Expand Up @@ -892,6 +894,7 @@ int main(int argc, char* argv[])
} else if (command == "vk_as_fields") {
std::string output_path = get_option(args, "-o", vk_path + "_fields.json");
vk_as_fields(vk_path, output_path);
#ifndef DISABLE_AZTEC_VM
} else if (command == "avm_prove") {
std::filesystem::path avm_bytecode_path = get_option(args, "--avm-bytecode", "./target/avm_bytecode.bin");
std::filesystem::path avm_calldata_path = get_option(args, "--avm-calldata", "./target/avm_calldata.bin");
Expand All @@ -903,6 +906,7 @@ int main(int argc, char* argv[])
avm_prove(avm_bytecode_path, avm_calldata_path, avm_public_inputs_path, avm_hints_path, output_path);
} else if (command == "avm_verify") {
return avm_verify(proof_path, vk_path) ? 0 : 1;
#endif
} else if (command == "prove_ultra_honk") {
std::string output_path = get_option(args, "-o", "./proofs/proof");
prove_honk<UltraFlavor>(bytecode_path, witness_path, output_path);
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/vm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if(NOT WASM)
barretenberg_module(vm honk sumcheck)
if(NOT DISABLE_AZTEC_VM)
barretenberg_module(vm honk sumcheck)
endif()

0 comments on commit 978f772

Please sign in to comment.