Search code examples
drake

Bazel build fail for drake schunk driver


I am trying to build the Schunk drivers from the RobotLocomotion/drake-schunk-driver git repository. When I run bazel build //..., the build fails and I get errors for missing dependencies like gflags and glib.

Is there a list of the required dependencies somewhere?

I am using drake v1.8.0 on Ubuntu Focal and installed it via the apt method if that is relevant.


Solution

  • As noted in the question, the repository, https://github.com/RobotLocomotion/drake-schunk-driver, uses Bazel as its primary build (even via CMake, I believe), following the drake_bazel_external workflow (compiling using Bazel from source).

    The above error most likely occurs due to an older / incorrect version of Bazel being installed, and/or other missing Bazel source prerequisites.

    Confirm your apt-installed Drake version using dpkg -s drake-dev, then ensure you install the source prereqs for that tagged version.

    Per the OP question for Ubuntu Focal and Drake v1.8.0, this would look like as follows:
    https://drake.mit.edu/from_source.html#mandatory-platform-specific-instructions
    https://drake.mit.edu/ubuntu.html

    git clone -o upstream https://github.com/RobotLocomotion/drake -b v1.8.0
    cd drake
    sudo ./setup/ubuntu/install_prereqs.sh
    

    EDIT: Submitted PR https://github.com/RobotLocomotion/drake-schunk-driver/pull/9


    Additional Note
    At time of writing (2022-10), the apt package for Drake does not appear to install Bazel.
    To inspect w/ installed apt package, look at Depends section from output of dpkg -s drake-dev.
    To inspect w/o installation, you can download the latest nightly debian per https://drake.mit.edu/apt.html#nightly-releases, inspect the control data, and see that the control data does not include bazel as a dependency.
    (This could be considered a good thing b/c it might require yet another apt repository.)