google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.26k stars 827 forks source link

Bazel build #2225

Open bd-jahn opened 1 week ago

bd-jahn commented 1 week ago

Summary

This PR introduces a Bazel build system that compiles the C library, Python bindings, and mjx library. While the original CMake build system supports multiple architectures and configurations, this Bazel build is currently configured only for Ubuntu 22.04 on x86_64.

This setup is not yet fully comprehensive. Some functionalities are still lacking, such as a hermetic toolchain, support for multiple OS and architecture builds, and compatibility with various rendering backends. However, this PR aims to initiate a discussion on the best direction for further improvements.

Testing

Build and test using the default Clang compiler:

Run bazel build //... and bazel test //....

Build and test using the GCC compiler:

Run bazel build --config=linux_gcc_x86_64 //... and bazel test --config=linux_gcc_x86_64 //....

Security

This build process fetches third-party dependencies through Bazel's http_archive rule, ensuring each dependency includes its license file.

google-cla[bot] commented 1 week ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

bd-jahn commented 1 week ago

I see that some of my changes to the include paths broke the CMake build system. I'll fix this issue.