From a5afe2fc321a27f56417aced2ebd2cee902162de Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 22 Jul 2026 18:35:33 +0900 Subject: [PATCH] [mujoco] update to 3.10.0 (#52555) Co-authored-by: Billy Robert O'Neal III --- ports/mujoco/fix-x86-atomic.patch | 22 +++++++++++++++++++++ ports/mujoco/fix_dependencies.patch | 30 ++++++++++++++--------------- ports/mujoco/portfile.cmake | 3 ++- ports/mujoco/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/m-/mujoco.json | 5 +++++ 6 files changed, 46 insertions(+), 18 deletions(-) create mode 100644 ports/mujoco/fix-x86-atomic.patch diff --git a/ports/mujoco/fix-x86-atomic.patch b/ports/mujoco/fix-x86-atomic.patch new file mode 100644 index 0000000000..be275b9ad5 --- /dev/null +++ b/ports/mujoco/fix-x86-atomic.patch @@ -0,0 +1,22 @@ +diff --git a/src/engine/engine_crossplatform.h b/src/engine/engine_crossplatform.h +index 2cf6dff..f89cbd1 100644 +--- a/src/engine/engine_crossplatform.h ++++ b/src/engine/engine_crossplatform.h +@@ -71,9 +71,14 @@ + + // Atomics helper for size_t. + #if defined(_MSC_VER) && !defined(__clang__) +- #include +- #define mj_atomic_add_size_t(ptr, val) \ +- (size_t)_InterlockedExchangeAdd64((__int64 volatile*)(ptr), (__int64)(val)) ++ #include ++ #if defined(_WIN64) ++ #define mj_atomic_add_size_t(ptr, val) \ ++ (size_t)_InterlockedExchangeAdd64((__int64 volatile*)(ptr), (__int64)(val)) ++ #else ++ #define mj_atomic_add_size_t(ptr, val) \ ++ (size_t)_InterlockedExchangeAdd((long volatile*)(ptr), (long)(val)) ++ #endif + #else + #define mj_atomic_add_size_t(ptr, val) \ + __atomic_fetch_add(ptr, val, __ATOMIC_RELAXED) diff --git a/ports/mujoco/fix_dependencies.patch b/ports/mujoco/fix_dependencies.patch index c0e36306ad..7b06ad40ef 100644 --- a/ports/mujoco/fix_dependencies.patch +++ b/ports/mujoco/fix_dependencies.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index e01c662..e3afbf8 100644 +index b35975a..3d0843c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -175,7 +175,7 @@ if(EMSCRIPTEN) +@@ -181,7 +181,7 @@ if(EMSCRIPTEN) endif() @@ -11,7 +11,7 @@ index e01c662..e3afbf8 100644 if(MUJOCO_ENABLE_AVX_INTRINSICS) target_compile_definitions(mujoco PUBLIC mjUSEPLATFORMSIMD) endif() -@@ -198,9 +198,9 @@ target_link_libraries( +@@ -204,9 +204,9 @@ target_link_libraries( mujoco PRIVATE ccd lodepng @@ -23,9 +23,9 @@ index e01c662..e3afbf8 100644 + tinyxml2::tinyxml2 ) - set_target_properties( + if(NOT EMSCRIPTEN) diff --git a/cmake/MujocoDependencies.cmake b/cmake/MujocoDependencies.cmake -index 664fc31..07ad2eb 100644 +index b48537f..88db605 100644 --- a/cmake/MujocoDependencies.cmake +++ b/cmake/MujocoDependencies.cmake @@ -88,7 +88,7 @@ set(BUILD_SHARED_LIBS @@ -114,19 +114,18 @@ index 664fc31..07ad2eb 100644 PACKAGE_NAME tinyxml2 LIBRARY_NAME -@@ -172,9 +195,10 @@ findorfetch( +@@ -172,8 +195,10 @@ findorfetch( tinyxml2 EXCLUDE_FROM_ALL ) +if(0) target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) -- +endif() + # update cmake_minimum_required version for compatibility with newer version of cmake if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM) - set(CMAKE_POLICY_VERSION_MINIMUM ${MUJOCO_CMAKE_MIN_REQ}) -@@ -182,7 +206,7 @@ if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM) +@@ -182,7 +207,7 @@ if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM) endif() findorfetch( USE_SYSTEM_PACKAGE @@ -135,7 +134,7 @@ index 664fc31..07ad2eb 100644 PACKAGE_NAME tinyobjloader LIBRARY_NAME -@@ -215,7 +239,7 @@ if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM) +@@ -215,7 +240,7 @@ if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM) endif() findorfetch( USE_SYSTEM_PACKAGE @@ -144,7 +143,7 @@ index 664fc31..07ad2eb 100644 PACKAGE_NAME ccd LIBRARY_NAME -@@ -233,12 +257,13 @@ if(CMAKE_POLICY_VERSION_MINIMUM_LOCALLY_DEFINED) +@@ -233,12 +258,13 @@ if(CMAKE_POLICY_VERSION_MINIMUM_LOCALLY_DEFINED) unset(CMAKE_POLICY_VERSION_MINIMUM) unset(CMAKE_POLICY_VERSION_MINIMUM_LOCALLY_DEFINED) endif() @@ -160,7 +159,7 @@ index 664fc31..07ad2eb 100644 if(MSVC) # C4005 is the MSVC equivalent of -Wmacro-redefined. target_compile_options(ccd PRIVATE /wd4005) -@@ -254,12 +279,7 @@ else() +@@ -254,12 +280,7 @@ else() set(_BUILD_TESTS_WAS_DEFINED FALSE) endif() set(BUILD_TESTS OFF) @@ -174,7 +173,7 @@ index 664fc31..07ad2eb 100644 if(_BUILD_TESTS_WAS_DEFINED) set(BUILD_TESTS "${_OLD_BUILD_TESTS}") else() -@@ -281,7 +301,7 @@ if(MUJOCO_BUILD_TESTS OR MUJOCO_BUILD_STUDIO OR MUJOCO_USE_FILAMENT) +@@ -284,7 +305,7 @@ if(MUJOCO_BUILD_TESTS OR MUJOCO_BUILD_STUDIO OR MUJOCO_USE_FILAMENT) set(ABSL_BUILD_TESTING OFF) findorfetch( USE_SYSTEM_PACKAGE @@ -184,15 +183,16 @@ index 664fc31..07ad2eb 100644 absl LIBRARY_NAME diff --git a/plugin/obj_decoder/CMakeLists.txt b/plugin/obj_decoder/CMakeLists.txt -index 689dfc5..9f86232 100644 +index 689dfc5..4488a7e 100644 --- a/plugin/obj_decoder/CMakeLists.txt +++ b/plugin/obj_decoder/CMakeLists.txt -@@ -17,4 +17,4 @@ target_sources(mujoco PRIVATE +@@ -17,4 +17,5 @@ target_sources(mujoco PRIVATE obj_decoder.cc ) -target_link_libraries(mujoco PRIVATE tinyobjloader) +target_link_libraries(mujoco PRIVATE tinyobjloader::tinyobjloader) ++ diff --git a/simulate/cmake/SimulateDependencies.cmake b/simulate/cmake/SimulateDependencies.cmake index 7885f5f..1da1be2 100644 --- a/simulate/cmake/SimulateDependencies.cmake diff --git a/ports/mujoco/portfile.cmake b/ports/mujoco/portfile.cmake index 15dc65df33..f995cb1f43 100644 --- a/ports/mujoco/portfile.cmake +++ b/ports/mujoco/portfile.cmake @@ -2,9 +2,10 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO deepmind/mujoco REF ${VERSION} - SHA512 4479142e29919d326760983a55bd16fcfa351457af70190b560552d2aad19d79bfcf68f7f542278ba41ff08b1ec48da2b845cbf9e1565ca7381780167fa6cfdd + SHA512 dafc848fbda134156f32b1c7668ab95d458e587d10f699ff6f233a03b3cb9e5ae4ceb76df5cc9f7b34d007f4a7419a66f56389e85c4c2cbb2e79a525a63ba557 PATCHES fix_dependencies.patch + fix-x86-atomic.patch # https://github.com/google-deepmind/mujoco/pull/3358 disable-werror.patch ) diff --git a/ports/mujoco/vcpkg.json b/ports/mujoco/vcpkg.json index da46acf28e..68e280a489 100644 --- a/ports/mujoco/vcpkg.json +++ b/ports/mujoco/vcpkg.json @@ -1,6 +1,6 @@ { "name": "mujoco", - "version": "3.9.0", + "version": "3.10.0", "description": "Multi-Joint dynamics with Contact.", "homepage": "https://mujoco.org", "license": "Apache-2.0", diff --git a/versions/baseline.json b/versions/baseline.json index 5d7b05ce11..c40f9912a0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6857,7 +6857,7 @@ "port-version": 0 }, "mujoco": { - "baseline": "3.9.0", + "baseline": "3.10.0", "port-version": 0 }, "mujs": { diff --git a/versions/m-/mujoco.json b/versions/m-/mujoco.json index 63d1b51d90..e9b148f6fe 100644 --- a/versions/m-/mujoco.json +++ b/versions/m-/mujoco.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "304299286e7e258e36d85509459b473945b69e08", + "version": "3.10.0", + "port-version": 0 + }, { "git-tree": "a631ce7edfc1c929dd145de4ada3937154d12e76", "version": "3.9.0",