mehrdadh commented on a change in pull request #9274:
URL: https://github.com/apache/tvm/pull/9274#discussion_r733903602
##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -36,13 +36,17 @@
import serial.tools.list_ports
from tvm.micro.project_api import server
+_LOG = logging.getLogger("MicroTVM API Server")
Review comment:
revert it.
##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -335,7 +344,25 @@ def _find_modified_include_path(self, project_dir,
file_path, include_path):
# It's probably a standard C/C++ header
return include_path
+ def _get_platform_version(self, arduino_cli_path: str) -> float:
+ version_output = subprocess.check_output([arduino_cli_path,
"version"], encoding="utf-8")
+ version_output = (
+ version_output.replace("\n", "").replace("\r", "").replace(":",
"").lower().split(" ")
+ )
+ full_version = version_output[version_output.index("version") +
1].split(".")
+ version = float(f"{full_version[0]}.{full_version[1]}")
+
+ return version
+
def generate_project(self, model_library_format_path, standalone_crt_dir,
project_dir, options):
+ # Check Arduino version
+ version = self._get_platform_version(options["arduino_cli_cmd"])
+ if version != ARDUINO_CLI_VERSION:
+ message = f"Arduino CLI version found is not supported: found
{version}, expected {ARDUINO_CLI_VERSION}."
+ if options.get("warning_as_error") is not None and
options["warning_as_error"]:
+ raise ValueError(message)
Review comment:
done.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]