mirror of https://github.com/llvm/torch-mlir
370d6ac9a2
This patch makes the Protobuf package mandatory in addition to forcing a config mode search. The (default) module mode search looks for the CMake-provided FindProtobuf.cmake file, but this file does not list Abseil as a dependency, causing linker issues like the one below: ``` ld: Undefined symbols: absl::lts_20230802::log_internal::LogMessageFatal::LogMessageFatal(char const*, int, std::__1::basic_string_view<char, std::__1::char_traits<char>>), referenced from: google::protobuf::RepeatedPtrField<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::TypeHandler>(int) const (.cold.1) in OnnxImporter.cpp.o ``` By forcing a config mode search, CMake looks for the file that is installed as part of the protobuf package and which does contain the Abseil dependency. This workaround is also mentioned in a GitHub issue for Protobuf: https://github.com/protocolbuffers/protobuf/issues/12292#issuecomment-1529680040. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
OnnxImporter.cpp | ||
OnnxImporter.h | ||
README.md | ||
import-onnx-main.cpp |
README.md
ONNX C Importer
This project provides a C implementation of the onnx_importer.py
, which is
the canonical source. It is provided as sample code for anyone who wishes to
integrate it into their system. By design, it only depends on the ONNX API
and the MLIR C API via the mlir-c
headers. As such, it should be easy to
build into any system that already has those things by adding the sources.