Building MuJoCo-rs
Compile the library using a pre-downloaded MuJoCo shared library in the repository.
- Check
Cargo.tomlfor the current MuJoCo version (look for+mj-X.Y.Zin the package version). Then find the matchingmujoco-X.Y.Z/directory at the repository root.
- Build the library (replace
X.Y.Zwith the version found in step 1):
export MUJOCO_DYNAMIC_LINK_DIR=$(realpath mujoco-X.Y.Z/lib) && export LD_LIBRARY_PATH=$(realpath mujoco-X.Y.Z/lib/) && cargo build --lib
- Verify that the exit code is 0 (success) - check the terminal output for errors.
[!NOTE]
- If
.sofiles are not found, readbuild.rsanddocs/guide/source/installation.rstto understand the linking options.
- Read
Cargo.toml[features]section to discover available features.
- To build with specific features:
cargo build --lib --no-default-features --features "feature1 feature2".
- To build in release mode add
--release.
-
MUJOCO_DYNAMIC_LINK_DIRmust be an absolute path (hencerealpath).