Fix plugin loading in simulate UI#3089
Open
Ashutosh0x wants to merge 2 commits intogoogle-deepmind:mainfrom
Open
Fix plugin loading in simulate UI#3089Ashutosh0x wants to merge 2 commits intogoogle-deepmind:mainfrom
Ashutosh0x wants to merge 2 commits intogoogle-deepmind:mainfrom
Conversation
Plugins like SDF, elasticity, and sensor were not being correctly copied to the 'mujoco_plugin' subdirectory where the 'simulate' executable looks for them. This change adds install and output directory directives to the plugin CMakeLists.txt files, ensuring they are placed in the correct location both in the build tree and after installation. Fixes google-deepmind#3013
This ensures that plugins are installed to a 'mujoco_plugin' subdirectory relative to the 'simulate' executable (which is in 'bin') on Linux and macOS, matching the expectation of the plugin loader logic in 'simulate/main.cc'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request fixes an issue where MuJoCo plugins (SDF, elasticity, sensor, etc.) were not being loaded by the simulate executable when building from source or installing.
The Problem
The simulate executable looks for plugins in a mujoco_plugin subdirectory. However, the plugin CMakeLists.txt files were missing install directives and did not set the RUNTIME_OUTPUT_DIRECTORY / LIBRARY_OUTPUT_DIRECTORY, so the plugins were placed in the default bin or lib folders where simulate couldn't find them.
The Fix
Added set_target_properties to set the build-time output directory to bin/mujoco_plugin and added install commands to ensure they are also copied there during installation.
Fixes #3013