This is an automated email from the ASF dual-hosted git repository. lukhut pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push: new a6d644b4c3 [Build] Improving debug and build-dir options (#16524) a6d644b4c3 is described below commit a6d644b4c3aa7803124ff82fbb699bc0dc1c723d Author: neildhickey <neil.hic...@arm.com> AuthorDate: Mon Feb 12 09:13:20 2024 +0000 [Build] Improving debug and build-dir options (#16524) Adding debug option to task_build to allow debug version of TVM to be built easily. Adding --build-dir option to bash.sh to allow which directory holds the built tvm to be patches through to docker. --- docker/bash.sh | 9 +++++++++ tests/scripts/task_build.py | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docker/bash.sh b/docker/bash.sh index a5dec23f91..a3d57bfd42 100755 --- a/docker/bash.sh +++ b/docker/bash.sh @@ -94,6 +94,10 @@ Usage: docker/bash.sh [-i|--interactive] [--net=host] [-t|--tty] Print the docker command to be run, but do not execute it. +--build-dir BUILD_DIR + + The build directory of TVM. This is appended to LD_LIBRARY_PATH + --env Pass an environment variable through to the container. @@ -267,6 +271,11 @@ while (( $# )); do shift ;; + --build-dir) + DOCKER_ENV+=( --env LD_LIBRARY_PATH=${REPO_MOUNT_POINT}/${2}) + shift 2 + ;; + --) shift COMMAND=( "$@" ) diff --git a/tests/scripts/task_build.py b/tests/scripts/task_build.py index 21560b4b14..5fbc22aa29 100755 --- a/tests/scripts/task_build.py +++ b/tests/scripts/task_build.py @@ -37,6 +37,7 @@ if __name__ == "__main__": parser.add_argument("--sccache-region", required=False, help="sccache region") parser.add_argument("--build-dir", default="build", help="build folder") parser.add_argument("--cmake-target", help="optional build target") + parser.add_argument("--debug", required=False, action="store_true", help="build in debug mode") args = parser.parse_args() env = {"VTA_HW_PATH": str(Path(os.getcwd()) / "3rdparty" / "vta-hw")} @@ -82,7 +83,10 @@ if __name__ == "__main__": if build_platform == "i386": sh.run("cmake ..", cwd=build_dir) else: - sh.run("cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ..", cwd=build_dir) + if args.debug: + sh.run("cmake -GNinja -DCMAKE_BUILD_TYPE=Debug ..", cwd=build_dir) + else: + sh.run("cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ..", cwd=build_dir) target = "" if args.cmake_target: