提交 8065fd81 编写于 作者: S storypku 提交者: liuxu

Bazel: libtorch_{cpu,gpu} in one

上级 03bbe0cc
......@@ -157,7 +157,10 @@ function main() {
bazel_build $@
# Disable simulator build temporarily
# build_simulator
success "Done building ${SHORTHAND_TARGETS} . Enjoy!"
if [ -z "${SHORTHAND_TARGETS}" ]; then
SHORTHAND_TARGETS="apollo"
fi
success "Done building ${SHORTHAND_TARGETS}. Enjoy!"
}
main "$@"
......@@ -5,10 +5,16 @@
def clean_dep(dep):
return str(Label(dep))
def repo():
# local_integ
def repo_cpu():
native.new_local_repository(
name = "libtorch_cpu",
build_file = clean_dep("//third_party/libtorch:libtorch_cpu.BUILD"),
path = "/usr/local/libtorch_cpu/include",
)
def repo_gpu():
native.new_local_repository(
name = "libtorch_gpu",
build_file = clean_dep("//third_party/libtorch_gpu:libtorch_gpu.BUILD"),
build_file = clean_dep("//third_party/libtorch:libtorch_gpu.BUILD"),
path = "/usr/local/libtorch_gpu/include",
)
"""Loads the libtorch_cpu library"""
# Sanitize a dependency so that it works correctly from code that includes
# Apollo as a submodule.
def clean_dep(dep):
return str(Label(dep))
def repo():
# local_integ
native.new_local_repository(
name = "libtorch_cpu",
build_file = clean_dep("//third_party/libtorch_cpu:libtorch_cpu.BUILD"),
path = "/usr/local/libtorch_cpu/include",
)
package(
default_visibility = ["//visibility:public"],
)
......@@ -20,8 +20,7 @@ load("//third_party/glog:workspace.bzl", glog = "repo")
load("//third_party/gtest:workspace.bzl", gtest = "repo")
load("//third_party/ipopt:workspace.bzl", ipopt = "repo")
load("//third_party/local_integ:workspace.bzl", local_integ = "repo")
load("//third_party/libtorch_gpu:workspace.bzl", libtorch_gpu = "repo")
load("//third_party/libtorch_cpu:workspace.bzl", libtorch_cpu = "repo")
load("//third_party/libtorch:workspace.bzl", libtorch_cpu = "repo_cpu", libtorch_gpu = "repo_gpu")
load("//third_party/lz4:workspace.bzl", lz4 = "repo")
load("//third_party/npp:workspace.bzl", npp = "repo")
load("//third_party/opencv:workspace.bzl", opencv = "repo")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册