-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMODULE.bazel
More file actions
81 lines (68 loc) · 2.53 KB
/
MODULE.bazel
File metadata and controls
81 lines (68 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
## MODULE.bazel
module(
name = "c3"
)
# If you don't want to support building on macOS, you may remove the next line.
# Note that it must appear prior to loading "rules_cc", per the documentation:
# https://github.com/bazelbuild/apple_support?tab=readme-ov-file#bazel-7-setup
bazel_dep(name = "apple_support", version = "2.3.0")
# Add the Bazel rules we need.
bazel_dep(name = "rules_java", version = "9.6.1")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "rules_python", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "lcm", version = "1.5.2")
bazel_dep(name = "gflags", version = "2.2.2.bcr.1")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
drake_dep_repositories = use_extension(
"@drake//tools/workspace:default.bzl",
"drake_dep_repositories",
)
use_repo(
drake_dep_repositories,
"eigen",
"fmt",
"pybind11",
"gurobi",
)
# Use gurobi_cxx, which Drake deprecated
gurobi_extension = use_extension("@c3//tools/workspace/gurobi:repository.bzl", "gurobi_extension")
use_repo(gurobi_extension, "my_gurobi")
# Replace Drake's Gurobi repository with ours.
override_repo(
drake_dep_repositories,
gurobi = "my_gurobi",
)
# Here we introduce Drake as a module dependency, but note that Drake is not
# published to any Bazel registry. Below, we'll override it with a github
# source archive.
bazel_dep(name = "drake")
# You can also use DRAKE_COMMIT to choose a Drake release; e.g.:
DRAKE_COMMIT = "v1.51.1"
DRAKE_CHECKSUM = "40cb4d0e3d378ba67c21aca8cc1396399774b333b12d0030f5fbe4ddff1dc786"
# Before changing the COMMIT, temporarily uncomment the next line so that Bazel
# displays the suggested new value for the CHECKSUM.
# DRAKE_CHECKSUM = "0" * 64
# This declares the `@drake` module as a source code archive from github.
# See README.md for instructions to use a local path, instead.
archive_override(
module_name = "drake",
urls = [x.format(DRAKE_COMMIT) for x in [
"https://github.com/RobotLocomotion/drake/archive/{}.tar.gz",
]],
sha256 = DRAKE_CHECKSUM,
strip_prefix = "drake-{}".format(DRAKE_COMMIT.lstrip("v")),
)
# Use the host system /usr/bin/python3.
python_repository = use_repo_rule(
"@drake//tools/workspace/python:repository.bzl",
"python_repository",
)
python_repository(
name = "python",
linux_interpreter_path = "/usr/bin/python3",
requirements_flavor = "build",
)
register_toolchains("@python//:all")