[microTVM][CRT]Move Makefile to CMake to be cross-platform compatible#14013
[microTVM][CRT]Move Makefile to CMake to be cross-platform compatible#14013mehrdadh merged 5 commits intoapache:mainfrom
Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
|
cc @alanmacd for review. |
| add_executable(main) | ||
|
|
||
| set(CRT_LIB_BASE crt/src/runtime/crt) | ||
| set(CRT_LIBS microtvm_rpc_server microtvm_rpc_common aot_executor_module aot_executor graph_executor_module graph_executor common memory) |
There was a problem hiding this comment.
I would put one of these targets (libs) per line to make it more readable, e.g.:
set(CRT_LIBS
microtvm_rpc_server
microtvm_rpc_common
...
| @@ -135,10 +133,11 @@ def generate_project(self, model_library_format_path, standalone_crt_dir, projec | |||
| shutil.copy2(src_path, dst_path) | |||
|
|
|||
| # Populate Makefile | |||
There was a problem hiding this comment.
| # Populate Makefile | |
| # Populate CMake file |
| build_dir = PROJECT_DIR / "build" | ||
| build_dir.mkdir() | ||
| subprocess.check_call(["cmake", ".."], cwd=build_dir) | ||
| subprocess.check_call(["make", "-j12"], cwd=build_dir) |
There was a problem hiding this comment.
why -j12? we didn't have this one before
There was a problem hiding this comment.
totally missed that, fixed now!
| @@ -0,0 +1,59 @@ | |||
| # Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
since additional stuff is added beyond what's here, and nothing is really templatized, what do you think about calling this CMakeLists.txt.prelude or something?
There was a problem hiding this comment.
I'd say we keep it as .template to match with the rest. Also, it could be templated in future if we want to set <CRT_LIBS> instead of building all libraries.
…apache#14013) This PR converts CRT Makefile to a CMakelist file to be cross platform compatible.
This PR converts CRT Makefile to a CMakelist file to be cross platform compatible.