-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Intro
Hi!
I am a student (in a few days researcher) at University of Ljubljana, I use MuJoCo for my research on RL.
My setup
MuJoCo 3.3.7. Other info is irrelevant.
What's happening? What did you expect?
A few CMake files contain forceful set of the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION (LTO).
mujoco/cmake/MujocoOptions.cmake
Lines 107 to 109 in 36bed9a
if(NOT CMAKE_INTERPROCEDURAL_OPTIMIZATION AND (CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) endif() mujoco/sample/cmake/SampleOptions.cmake
Lines 107 to 109 in 36bed9a
if(NOT CMAKE_INTERPROCEDURAL_OPTIMIZATION AND (CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) endif() mujoco/simulate/cmake/SimulateOptions.cmake
Lines 107 to 109 in 36bed9a
if(NOT CMAKE_INTERPROCEDURAL_OPTIMIZATION AND (CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) endif()
This causes problems whenever the compiled (static) libraries may be used with a different linker, which is now the case for the Rust language on the default Linux target (they switched to rust-lld).
As a result of the forceful enable, the compiled library files contain additional information that is only compatible with the same linker. See the following issue: rust-lang/rust#146952.
Based on the commit message that added the forceful enable of LTO, the plan was to enable it by default, not permanently.
Several CI files also contain commands where this is explicitly disabled (
mujoco/.github/workflows/build.yml
Line 178 in 36bed9a
| -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF |
Steps for reproduction
- Compile with
CMAKE_INTERPROCEDURAL_OPTIMIZATIONdisabled from the console - CMAKE_INTERPROCEDURAL_OPTIMIZATION (LTO) is still enabled
Minimal model for reproduction
Irrelevant
Code required for reproduction
Irrelevant
Confirmations
- I searched the latest documentation thoroughly before posting.
- I searched previous Issues and Discussions, I am certain this has not been raised before.