google-deepmind / google-deepmind/mujoco
[C API] Option for static linking
- Dominant language
- C++
- Stars
- 15.2k
- Forks
- 1.8k
- Avg merge
- 10d 16h
- Merged PRs (30d)
- 25
Description
### The feature, motivation and pitch
I would like to propose a flag inside CMakeLists.txt that would allow us to statically link MuJoCo (i. e., produce a libmujoco.a). ~~It doesn't sound like this would be beneficial at first, but upon testing I'm getting roughtly **+34 % steps more steps per second** compared to the dynamically linked library (~57000 -> ~76500)~~.
### Alternatives
_No response_
### Additional context
The performence gains were measured on the Ryzen 5 5600X CPU and in a thin Rust wrapper around the MuJoCo's C API.
Contributor guide
Research direction
Start by inspecting CMakeLists.txt and the existing MuJoCo C API build targets. Determine how an option for static linking should produce libmujoco.a without disrupting the current build, then verify that the static library can be used through the C API and that the existing build remains functional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake, cpp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100