Skip to content

Files

Latest commit

6306a0c · Aug 12, 2025

History

History

drake_bazel_external

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 25, 2025
Jun 25, 2024
Apr 11, 2025
Apr 11, 2025
Apr 6, 2023
Jun 24, 2025
Jun 30, 2025
Sep 20, 2024
Jan 10, 2025
Apr 6, 2023
Sep 26, 2024
Jan 27, 2025
Aug 12, 2025
Apr 11, 2025

README.md

Bazel Project with Drake as an External

This pulls in Drake and builds it from source via Bazel's module mechanism.

For an introduction to Bazel, refer to Getting Started with Bazel.

Instructions

First, run the install_prereqs script to download the Drake source to drake/ (from the current directory). This also runs Drake's setup script to install the required Ubuntu packages:

setup/install_prereqs

Then, to build and test all apps:

bazel test //...

As an example to run a binary directly:

bazel run //apps:simple_logging_example

You may also run the binary directly per the bazel-bin/... path that the above command prints out; however, be aware that your working directories may cause differences. This is important when using tools like drake::FindResource / pydrake.common.FindResource. You may generally want to stick to using bazel run when able.

Using a local checkout of Drake

To use Drake sources on disk instead of downloaded from github, pass the flag --override_module=drake=/home/user/stuff/drake to bazel on the command line or add a line such as the following to user.bazelrc in the current directory:

build --override_module=drake=/home/user/stuff/drake

Python Versions

By default, Python 3 is the Python interpreter that Drake will use when built with Bazel. To see which Python versions are supported, see the supported configurations.