1+ module(
2+ name = "torch_tensorrt",
3+ repo_name = "org_pytorch_tensorrt",
4+ version = "${BUILD_VERSION}"
5+ )
6+
7+ bazel_dep(name = "googletest", version = "1.14.0")
8+ bazel_dep(name = "platforms", version = "0.0.10")
9+ bazel_dep(name = "rules_cc", version = "0.0.9")
10+ bazel_dep(name = "rules_python", version = "0.34.0")
11+
12+ python = use_extension("@rules_python//python/extensions:python.bzl", "python")
13+ python.toolchain(
14+ ignore_root_user_error = True,
15+ python_version = "3.11",
16+ )
17+
18+ bazel_dep(name = "rules_pkg", version = "1.0.1")
19+ git_override(
20+ module_name = "rules_pkg",
21+ commit = "17c57f4",
22+ remote = "https://github.com/narendasan/rules_pkg",
23+ )
24+
25+ local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
26+
27+
28+ new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
29+
30+ # CUDA should be installed on the system locally
31+ new_local_repository(
32+ name = "cuda",
33+ build_file = "@//third_party/cuda:BUILD",
34+ path = "/usr/local/cuda",
35+ )
36+
37+ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
38+
39+ ####################################################################################
40+ # Locally installed dependencies (use in cases of custom dependencies or aarch64)
41+ ####################################################################################
42+
43+ # NOTE: In the case you are using just the pre-cxx11-abi path or just the cxx11 abi path
44+ # with your local libtorch, just point deps at the same path to satisfy bazel.
45+
46+ # NOTE: NVIDIA's aarch64 PyTorch (python) wheel file uses the CXX11 ABI unlike PyTorch's standard
47+ # x86_64 python distribution. If using NVIDIA's version just point to the root of the package
48+ # for both versions here and do not use --config=pre-cxx11-abi
49+
50+ new_local_repository(
51+ name = "libtorch",
52+ path = "/opt/python3/site-packages/torch/",
53+ build_file = "third_party/libtorch/BUILD"
54+ )
55+
56+ new_local_repository(
57+ name = "libtorch_pre_cxx11_abi",
58+ path = "/opt/python3/site-packages/torch/",
59+ build_file = "third_party/libtorch/BUILD"
60+ )
61+
62+ new_local_repository(
63+ name = "tensorrt",
64+ path = "/usr/",
65+ build_file = "@//third_party/tensorrt/local:BUILD"
66+ )
67+
68+ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
69+
70+ pip.parse(
71+ download_only = True,
72+ hub_name = "pypi",
73+ python_version = ${PYTHON_VERSION},
74+ requirements_lock = "//:requirements_dev.txt",
75+ )
76+
77+ use_repo(pip, "pypi")
0 commit comments