From 6525a299a61407d3ac3d6a52fd714d086c611a43 Mon Sep 17 00:00:00 2001 From: NiccoloN Date: Mon, 2 Mar 2026 16:34:27 +0100 Subject: [PATCH] add protobuf installation as requirement remove cmake patch for abseil/protobuf --- CMakeLists.txt | 12 ++---------- README.md | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9db14ef..6322be0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,15 +61,7 @@ endfunction() set(ONNX_MLIR_DIR "${CMAKE_CURRENT_SOURCE_DIR}/onnx-mlir") -# 1) Disable the absl dependency -raptor_apply_patch( - "${ONNX_MLIR_DIR}/CMakeLists.txt" - "find_package(absl REQUIRED)" - "#find_package(absl REQUIRED)" - "Disable find_package(absl)" -) - -# 2) Register PIM compiler options alongside NNPA +# Register PIM compiler options alongside NNPA raptor_apply_patch( "${ONNX_MLIR_DIR}/src/Accelerators/Accelerator.hpp" "#include \"src/Accelerators/NNPA/Compiler/NNPACompilerOptions.hpp\"" @@ -77,7 +69,7 @@ raptor_apply_patch( "Add PIM compiler options include" ) -# 3) Short-circuit output emission for the PIM accelerator +# Short-circuit output emission for the PIM accelerator raptor_apply_patch( "${ONNX_MLIR_DIR}/src/Compiler/CompilerUtils.cpp" "switch (emissionTarget) {\n case EmitObj: {" diff --git a/README.md b/README.md index 8c1008a..86098e0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,25 @@ ## Build +### Protobuf + +Use the following commands to install protobuf: +``` +git clone https://github.com/protocolbuffers/protobuf +cd protobuf +mkdir build +cd build +cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release +ninja +sudo ninja install +``` + +You can now remove the protobuf repo directory with: +``` +cd ../.. +rm -rf protobuf +``` + ### Mlir Follow the first part of instructions [here](onnx-mlir/docs/BuildOnLinuxOSX.md) to build mlir.