google-deepmind / google-deepmind/mujoco

[C API] Option for static linking

Open
#2,618 4 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.