[Bug] Unable to compile Apache TVM runtime for MIPS platform
- Dominant language
- Python
- Stars
- 13.7k
- Forks
- 4k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 111
Description
I am trying to build Apache TVM library for MIPs platform using steps explained on [this page](https://tvm.apache.org/docs/how_to/deploy/index.html#cross-compile-for-risc-v) for RISC.
Following are the steps I followed:
$ sudo apt-get update
$ sudo apt-get install g++-9-multilib-mips-linux-gnu
$ sudo apt-get install gcc-9-mips-linux-gnu
$ git clone --recursive https://github.com/apache/tvm tvm
$ cd tvm
$ mkdir build
$ cp cmake/config.cmake build
$ cd build
$ cmake .. -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_C_COMPILER=/usr/bin/mips-linux-gnu-gcc-9 -DCMAKE_CXX_COMPILER=/usr/bin/mips-linux-gnu-g++-9 -DCMAKE_FIND_ROOT_PATH=/usr/mips-linux-gnu -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DMACHINE_NAME=mips-linux-gnu
$ make -j8 runtime
But I ended up getting following errors / FATAL warnings:
In file included from /home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/io.h:443,
from /home/my_user/workspace/tvm/include/tvm/runtime/module.h:29,
from /home/my_user/workspace/tvm/include/tvm/runtime/packed_func.h:34,
from /home/my_user/workspace/tvm/include/tvm/runtime/disco/session.h:77,
from /home/my_user/workspace/tvm/include/tvm/runtime/disco/disco_worker.h:28,
from /home/my_user/workspace/tvm/src/runtime/disco/process_session.cc:20:
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h: In instantiation of ‘static bool dmlc::serializer::IfThenElse::Read(dmlc::Stream*, T*) [with Then = dmlc::serializer::SaveLoadClassHandler; Else = dmlc::serializer::UndefinedSerializerFor; T = tvm::runtime::RPCCode]’:
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:66:22: recursively required from ‘static bool dmlc::serializer::IfThenElse::Read(dmlc::Stream*, T*) [with Then = dmlc::serializer::NativePODHandler; Else = dmlc::serializer::IfThenElse, dmlc::serializer::UndefinedSerializerFor, tvm::runtime::RPCCode>; T = tvm::runtime::RPCCode]’
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:66:22: required from ‘static bool dmlc::serializer::IfThenElse::Read(dmlc::Stream*, T*) [with Then = dmlc::serializer::ArithmeticHandler; Else = dmlc::serializer::IfThenElse, dmlc::serializer::IfThenElse, dmlc::serializer::UndefinedSerializerFor, tvm::runtime::RPCCode>, tvm::runtime::RPCCode>; T = tvm::runtime::RPCCode]’
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:294:11: required from ‘static bool dmlc::serializer::Handler::Read(dmlc::Stream*, T*) [with T = tvm::runtime::RPCCode]’
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/io.h:453:38: required from ‘bool dmlc::Stream::Read(T*) [with T = tvm::runtime::RPCCode]’
/home/my_user/workspace/tvm/src/runtime/disco/./message_queue.h:98:21: required from here
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:66:22: error: ‘Read’ is not a member of ‘dmlc::serializer::UndefinedSerializerFor’
66 | return Else::Read(strm, data);
| ~~~~~~~~~~^~~~~~~~~~~~
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h: In instantiation of ‘static void dmlc::serializer::IfThenElse::Write(dmlc::Stream*, const T&) [with Then = dmlc::serializer::SaveLoadClassHandler; Else = dmlc::serializer::UndefinedSerializerFor; T = tvm::runtime::RPCCode]’:
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:63:16: recursively required from ‘static void dmlc::serializer::IfThenElse::Write(dmlc::Stream*, const T&) [with Then = dmlc::serializer::NativePODHandler; Else = dmlc::serializer::IfThenElse, dmlc::serializer::UndefinedSerializerFor, tvm::runtime::RPCCode>; T = tvm::runtime::RPCCode]’
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:63:16: required from ‘static void dmlc::serializer::IfThenElse::Write(dmlc::Stream*, const T&) [with Then = dmlc::serializer::ArithmeticHandler; Else = dmlc::serializer::IfThenElse, dmlc::serializer::IfThenElse, dmlc::serializer::UndefinedSerializerFor, tvm::runtime::RPCCode>, tvm::runtime::RPCCode>; T = tvm::runtime::RPCCode]’
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:275:16: required from ‘static void dmlc::serializer::Handler::Write(dmlc::Stream*, const T&) [with T = tvm::runtime::RPCCode]’
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/io.h:449:32: required from ‘void dmlc::Stream::Write(const T&) [with T = tvm::runtime::RPCCode]’
/home/my_user/workspace/tvm/src/runtime/disco/../minrpc/rpc_reference.h:545:5: required from ‘static void tvm::runtime::RPCReference::ReturnPackedSeq(const TVMValue*, const int*, int, TChannel*) [with TChannel = tvm::runtime::DiscoStreamMessageQueue]’
/home/my_user/workspace/tvm/src/runtime/disco/./message_queue.h:39:84: required from here
/home/my_user/workspace/tvm/3rdparty/dmlc-core/include/dmlc/serializer.h:63:16: error: ‘Write’ is not a member of ‘dmlc::serializer::UndefinedSerializerFor’
63 | Else::Write(strm, data);
| ~~~~~~~~~~~^~~~~~~~~~~~
In file included from /home/my_user/workspace/tvm/src/runtime/disco/././protocol.h:35,
from /home/my_user/workspace/tvm/src/runtime/disco/./message_queue.h:26,
from /home/my_user/workspace/tvm/src/runtime/disco/process_session.cc:34:
/home/my_user/workspace/tvm/src/runtime/disco/././../../support/base64.h: In member function ‘virtual size_t tvm::support::Base64OutStream::Read(void*, size_t)’:
/home/my_user/workspace/tvm/src/runtime/disco/././../../support/base64.h:253:19: warning: control reaches end of non-void function [-Wreturn-type]
253 | LOG(FATAL) << "Base64OutStream do not support read";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/my_user/workspace/tvm/src/runtime/disco/././../../support/base64.h: In member function ‘virtual size_t tvm::support::Base64InStream::Write(const void*, size_t)’:
/home/my_user/workspace/tvm/src/runtime/disco/././../../support/base64.h:210:19: warning: control reaches end of non-void function [-Wreturn-type]
210 | LOG(FATAL) << "Base64InStream do not support write";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
What I am missing here?
PS: [here](https://gist.github.com/RajS999/1ee9200a96f3d56e7e47c18a23887c77) is full cmake output and [here](https://gist.github.com/RajS999/a9789d077f82332fc8dda10161371d1a) is full make output.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing `make -j8 runtime` with the CMake settings from the report and inspect `cmake/config.cmake`. Trace the `RPCCode` serialization failure from `src/runtime/disco/process_session.cc` through `dmlc/serializer.h`, while checking the warnings in `src/support/base64.h`. Done means the MIPS runtime build completes without these errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100