manupa-arm commented on a change in pull request #7333:
URL: https://github.com/apache/tvm/pull/7333#discussion_r574693544



##########
File path: python/tvm/micro/build.py
##########
@@ -55,15 +57,62 @@ def path(self):
 CRT_RUNTIME_LIB_NAMES = ["utvm_rpc_server", "utvm_rpc_common", "common"]
 
 
-TVM_ROOT_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", 
"..", ".."))
+STANDALONE_CRT_DIR = None
 
 
-CRT_ROOT_DIR = os.path.join(TVM_ROOT_DIR, "src", "runtime", "crt")
+class CrtNotFoundError(Exception):
+    """Raised when the standalone CRT dirtree cannot be found."""
 
 
-RUNTIME_LIB_SRC_DIRS = [os.path.join(CRT_ROOT_DIR, n) for n in 
CRT_RUNTIME_LIB_NAMES] + [
-    os.path.join(TVM_ROOT_DIR, "3rdparty/libcrc/src")
-]
+def get_standalone_crt_dir() -> str:
+    """Find the standalone_crt directory.
+
+    Though the C runtime source lives in the tvm tree, it is intended to be 
distributed with any
+    binary build of TVM. This source tree is intended to be integrated into 
user projects to run
+    models targeted with --runtime=c.
+
+    Returns
+    -------
+    str :
+        The path to the standalone_crt
+    """
+    global STANDALONE_CRT_DIR
+    if STANDALONE_CRT_DIR is None:

Review comment:
       Ack




----------------------------------------------------------------
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:
[email protected]


Reply via email to