Skip to content

Conversation

@mehrdadh
Copy link
Member

This PR converts CRT Makefile to a CMakelist file to be cross platform compatible.

@tvm-bot
Copy link
Collaborator

tvm-bot commented Feb 16, 2023

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

@mehrdadh mehrdadh requested a review from areusch February 16, 2023 21:31
@mehrdadh
Copy link
Member Author

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)
Copy link
Contributor

@alanmacd alanmacd Feb 16, 2023

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
    ...

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Populate Makefile
# Populate CMake file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mehrdadh mehrdadh requested a review from alanmacd February 17, 2023 00:43
Copy link
Contributor

@alanmacd alanmacd left a 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)
Copy link
Contributor

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

Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member Author

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.

@mehrdadh mehrdadh requested a review from areusch February 17, 2023 18:32
@mehrdadh mehrdadh merged commit 347d79c into apache:main Feb 21, 2023
@mehrdadh mehrdadh deleted the crt/makefile_to_cmake branch February 21, 2023 18:45
yongwww pushed a commit to yongwww/tvm that referenced this pull request Feb 27, 2023
…apache#14013)

This PR converts CRT Makefile to a CMakelist file to be cross platform compatible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants