Commit Graph

16 Commits

Author SHA1 Message Date
Yuval Tassa 6f487086a5 Add MUJOCO_ENABLE_LTO CMake option to make LTO configurable. Fixes #3374, #2904
PiperOrigin-RevId: 950629900
Change-Id: If4b3755f0e8653efbd9e6a4134140dd96b1f743d
2026-07-19 23:46:15 -07:00
Kevin Zakka 1aaced190a Copybara import of the project:
--
3439d8a5cd745dfd2776593916eead65cb456afc by Kevin Zakka <kevinarmandzakka@gmail.com>:

Respect an explicit CMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF

The default-LTO guard checked the value rather than whether it was DEFINED, so an
explicit -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF (used in CI to cut build time)
was silently flipped back ON. Check DEFINED instead; default-on for Release is
preserved when the caller makes no choice.

--
bd15d1b264e5ab9594669b58fa1e0388d0a16f6b by Kevin Zakka <kevinarmandzakka@gmail.com>:

Speed up CI

~10x faster on the POSIX jobs (~45m -> ~4-5m) and ~2x overall wall-clock.

- Build Studio/Filament and WASM only in their dedicated canary jobs, not in
  every matrix job (WASM uses emcc, which ignores the host compiler).
- Compiler matrix -> build_matrix.json with core/extended tiers: PRs build the
  core set, pushes to main run the full sweep.
- ccache across build jobs (studio cache keyed on the Filament pin); fix the
  Python-bindings build so ccache hits (CCACHE_BASEDIR).
- Disable IPO/LTO on POSIX (it was silently on); keep it on Windows where /GL-off
  exposes a latent test bug and build time is not the bottleneck.
- Run ctest in parallel on POSIX (~2x); uv for Python installs (~29s -> ~8s).
- Move MJX (compiler-independent) to a single dedicated job.
- Restrict GITHUB_TOKEN to contents: read; bump actions off deprecated Node20.

--
c0618ab7aef524b238e0a30f2f23c50c4ce0c9b1 by Kevin Zakka <kevinarmandzakka@gmail.com>:

Build the gcc jobs with LTO off too

Restores LTO-off for gcc (recovering the build-time win). That surfaces known
gcc-12 -Wrestrict false positives in libstdc++ <char_traits> at -O3; two clean,
behavior-preserving rewrites in the XML writer avoid them. Confirmed gcc-12 and
gcc-14 build clean with LTO off (PR #3325).

--
2c38da0f48f77635e58e4b7931b86d60f3c253c7 by Kevin Zakka <kevinarmandzakka@gmail.com>:

Respect explicit IPO=OFF in the Simulate and Sample options too

Apply the same DEFINED check as cmake/MujocoOptions.cmake to the simulate/ and
sample/ subprojects (which carry identical copies of the guard) to keep the three
in sync, as the internal import requires. Since the guard now honors =OFF, stop
forcing IPO=OFF on the tiny samples/simulate CI builds so they keep their default
LTO and don't expose the gcc -Werror false positives that -O3-without-LTO triggers.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/3315 from google-deepmind:speed-up-ci 2c38da0f48f77635e58e4b7931b86d60f3c253c7
PiperOrigin-RevId: 930008698
Change-Id: Ic41dc87881833c95f2ebfc0602de1ed438db3d4f
2026-06-10 12:27:14 -07:00
Saran Tunyasuvunakool 1465d8b6ce Initial implementation of MuJoCo Live.
This is a combination of minor tweaks to the existing Studio WASM application, CMake cleanup to make it buildable, and integration with GitHub Actions for deployment.

The new features added are drag-and-drop, model specification through `?model=` URL parameter, HTTP and HTTPS resource provider, and a user-visible loading message while the model is loading.

PiperOrigin-RevId: 904594610
Change-Id: I3a73b1ca0fcd6fc9ba192469942b2dab010a9308
2026-04-23 12:56:12 -07:00
Matija Kecman bd68f0c6cc Update CMake to use C++20
PiperOrigin-RevId: 817573868
Change-Id: I22c98515763623d7411fd12910cf88cdaa336e6e
2025-10-10 03:54:47 -07:00
Yuval Tassa 681f5767b2 Remove -Wno-extra-semi, add workaround for mjSORT confusing some IDEs
PiperOrigin-RevId: 808689636
Change-Id: Ia091fb597c171a33842e62690d06f32614fbe4eb
2025-09-18 12:28:09 -07:00
Yuval Tassa 4b8454b79c Add semicolons after mjSORT macro calls.
PiperOrigin-RevId: 808587320
Change-Id: I9fd290b9a2b615647135f1250e87af8ea9bb81f6
2025-09-18 08:13:46 -07:00
Yuval Tassa 44be878e7e Enable inter-procedural optimization by default in cmake
PiperOrigin-RevId: 647336693
Change-Id: I44acf48ed9825dd3e71b06f2aca581cdb17dce34
2024-06-27 09:05:49 -07:00
Saran Tunyasuvunakool 860f7b376a Fix GCC and MSVC build.
PiperOrigin-RevId: 564390190
Change-Id: Icba3eefb394b8d17798679dd9876f127fba5a599
2023-09-11 08:17:08 -07:00
Saran Tunyasuvunakool 78183e60e1 Refactor thread pool implementation.
- Make mjTask non-opaque and remove C++ Task class.
- Make C++ thread pool a subclass of a skeletal mjThreadPool C struct.
- Make the mjTask status enum more consistent with the rest of MuJoCo.
- Change mju_threadPoolEnqueue to take just the mjTask. Users must now prepare the mjTask by assigning the function pointer and argument into the struct.
- Rename files in thread/ to be more consistent with the rest of MuJoCo.
- Run threading tests in CMake.
- Allow use of C++20 designated initializers.

Otherwise the functionality remains identical.

PiperOrigin-RevId: 564374675
Change-Id: I37c9894566bc39faf217e5aa97a4e2713a70e467
2023-09-11 07:20:34 -07:00
Saran Tunyasuvunakool 329ed193ac Disallow variable-length arrays and turn on -Wpedantic in Clang and GCC.
PiperOrigin-RevId: 562832747
Change-Id: I0532624cee31e089a47426305d885687eb0fc5c5
2023-09-05 11:05:04 -07:00
Nimrod Gileadi 08027b4e43 Only use -Wgnu-empty-initializer on Clang and not GCC.
Broken by ee566eb880.

PiperOrigin-RevId: 517390165
Change-Id: Ibd8ec46647873050899cffe435e3f5c293279aae
2023-03-17 05:35:16 -07:00
Alessio Quaglino ee566eb880 Remove empty initializers to ensure MSVC compatibility.
Add -Wgnu-empty-initializer to Clang builds to catch this issue in the future. Initialising arrays with empty braces is not part of the C standard and fails on MSVC. This commit should catch the issue earlier by detecting it in Clang.

PiperOrigin-RevId: 517373961
Change-Id: I518006e84151e8d5b45a7fe00ba7675dfb031ca0
2023-03-17 04:02:24 -07:00
Saran Tunyasuvunakool 5e989d18c3 Enable compiler errors for implicit switch case fallthroughs.
Also unify warning options across Clang and GCC and fix minor issues that was surfaced by this.

PiperOrigin-RevId: 508619655
Change-Id: I59b777bf2dfea4422485670e2427c7d3f5cf6405
2023-02-10 03:49:00 -08:00
Alessio Quaglino dd632b7ccc Bump MuJoCo version to 2.3.2.
PiperOrigin-RevId: 507720557
Change-Id: I7a5b577094ac1a7f468a84c484f62f61dc6b409f
2023-02-07 02:35:17 -08:00
Nimrod Gileadi 0514010928 Disable deprecated-builtins warnings in clang.
Since upgrading to Clang 15, abseil fails to build, because of abseil/abseil-cpp#1201.

PiperOrigin-RevId: 486190797
Change-Id: Ibaa1c03b8d21ae4a83c3825c8d56363aa2f89505
2022-11-04 11:35:49 -07:00
Saran Tunyasuvunakool 1913a02b40 Initial open sourcing of MuJoCo.
PiperOrigin-RevId: 450374687
Change-Id: Ie3225a46ce095fc28ae8e63c326a640261f562bb
2022-05-23 01:08:49 -07:00