|
| 1 | +workspace(name = "TRTorch") |
| 2 | + |
| 3 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 4 | +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") |
| 5 | + |
| 6 | +git_repository( |
| 7 | + name = "rules_python", |
| 8 | + remote = "https://github.com/bazelbuild/rules_python.git", |
| 9 | + commit = "4fcc24fd8a850bdab2ef2e078b1de337eea751a6", |
| 10 | + shallow_since = "1589292086 -0400" |
| 11 | +) |
| 12 | + |
| 13 | +load("@rules_python//python:repositories.bzl", "py_repositories") |
| 14 | +py_repositories() |
| 15 | + |
| 16 | +load("@rules_python//python:pip.bzl", "pip_repositories", "pip3_import") |
| 17 | +pip_repositories() |
| 18 | + |
| 19 | +http_archive( |
| 20 | + name = "rules_pkg", |
| 21 | + url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz", |
| 22 | + sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a", |
| 23 | +) |
| 24 | + |
| 25 | +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") |
| 26 | +rules_pkg_dependencies() |
| 27 | + |
| 28 | +git_repository( |
| 29 | + name = "googletest", |
| 30 | + remote = "https://github.com/google/googletest", |
| 31 | + commit = "703bd9caab50b139428cea1aaff9974ebee5742e", |
| 32 | + shallow_since = "1570114335 -0400" |
| 33 | +) |
| 34 | + |
| 35 | +# CUDA should be installed on the system locally |
| 36 | +new_local_repository( |
| 37 | + name = "cuda", |
| 38 | + path = "/usr/local/cuda-11.0/", |
| 39 | + build_file = "@//third_party/cuda:BUILD", |
| 40 | +) |
| 41 | + |
| 42 | +new_local_repository( |
| 43 | + name = "cublas", |
| 44 | + path = "/usr", |
| 45 | + build_file = "@//third_party/cublas:BUILD", |
| 46 | +) |
| 47 | + |
| 48 | +#################################################################################### |
| 49 | +# Locally installed dependencies (use in cases of custom dependencies or aarch64) |
| 50 | +#################################################################################### |
| 51 | + |
| 52 | +new_local_repository( |
| 53 | + name = "libtorch", |
| 54 | + path = "/opt/conda/lib/python3.6/site-packages/torch", |
| 55 | + build_file = "third_party/libtorch/BUILD" |
| 56 | +) |
| 57 | + |
| 58 | +new_local_repository( |
| 59 | + name = "libtorch_pre_cxx11_abi", |
| 60 | + path = "/opt/conda/lib/python3.6/site-packages/torch", |
| 61 | + build_file = "third_party/libtorch/BUILD" |
| 62 | +) |
| 63 | + |
| 64 | +new_local_repository( |
| 65 | + name = "cudnn", |
| 66 | + path = "/usr/", |
| 67 | + build_file = "@//third_party/cudnn/local:BUILD" |
| 68 | +) |
| 69 | + |
| 70 | +new_local_repository( |
| 71 | + name = "tensorrt", |
| 72 | + path = "/usr/", |
| 73 | + build_file = "@//third_party/tensorrt/local:BUILD" |
| 74 | +) |
| 75 | + |
| 76 | +######################################################################### |
| 77 | +# Testing Dependencies (optional - comment out on aarch64) |
| 78 | +######################################################################### |
| 79 | +pip3_import( |
| 80 | + name = "trtorch_py_deps", |
| 81 | + requirements = "//py:requirements.txt" |
| 82 | +) |
| 83 | + |
| 84 | +load("@trtorch_py_deps//:requirements.bzl", "pip_install") |
| 85 | +pip_install() |
| 86 | + |
| 87 | +pip3_import( |
| 88 | + name = "py_test_deps", |
| 89 | + requirements = "//tests/py:requirements.txt" |
| 90 | +) |
| 91 | + |
| 92 | +load("@py_test_deps//:requirements.bzl", "pip_install") |
| 93 | +pip_install() |
| 94 | + |
0 commit comments