You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/11/23 18:21:43 UTC

[GitHub] [incubator-tvm] tom-gall opened a new issue #6954: uTVM fails to build runtime for Arm Target

tom-gall opened a new issue #6954:
URL: https://github.com/apache/incubator-tvm/issues/6954


   given:
   
   TARGET = tvm.target.target.micro("stm32f746xx")
   
   with tvm.transform.PassContext(
       opt_level=3, config={"tir.disable_vectorize": True}, disabled_pass=["FuseOps"]
   ):
       graph, c_mod, c_params = relay.build(mod, target=TARGET, params=params)
   
   workspace = tvm.micro.Workspace()
   
   compiler = tvm.micro.DefaultCompiler(target=TARGET)
   opts = tvm.micro.default_options(os.path.join(tvm.micro.CRT_ROOT_DIR, "stm32f746xx"))
   
   micro_binary = tvm.micro.build_static_runtime(
       workspace,
       compiler,
       c_mod,
       lib_opts=opts["bin_opts"],
       bin_opts=opts["bin_opts"],
   )
   
   Creating the runtime will fail with 
   
   arm-none-eabi-g++: error: missing argument to '-march='
   
   It's not exactly surprising since  
   RuntimeError: error while running command "arm-none-eabi-g++ -g -march=cortex-m7 -std=c++11 -Wall -Werror -I /home/tgall/tvm/tvm/include -I /home/tgall/tvm/tvm/3rdparty/dlpack/include -I /home/tgall/tvm/tvm/3rdparty/libcrc/include -I /home/tgall/tvm/tvm/3rdparty/dmlc-core/include -I /home/tgall/tvm/tvm/src/runtime/crt/include -I /home/tgall/tvm/tvm/src/runtime/crt/stm32f746xx -c -o /tmp/tmpv6j60fia/build/utvm_rpc_server/rpc_server.o /home/tgall/tvm/tvm/src/runtime/crt/utvm_rpc_server/rpc_server.cc":
   arm-none-eabi-g++: error: unrecognized -march target: cortex-m7
   
   So what is the fix?  
   
   cortex-m7 is an -mcpu setting.
   
   Instead 
   -march=armv7-m when targeting and m4
   and -march=armv7e-m when targeting an m7 (like the discovery)   
   
   Patch incoming. 
   
   @areusch 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org