-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[microTVM][CRT]Move Makefile to CMake to be cross-platform compatible #14013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| else: | ||
| shutil.copy2(src_path, dst_path) | ||
|
|
||
| # Populate Makefile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Populate Makefile | |
| # Populate CMake file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
alanmacd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why -j12? we didn't have this one before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.