Skip to content

Add validation script for MuJoCo shared library under tools/ #2558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions dist/tools/test_dist_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
import ctypes

def test_mujoco_library():
"""
Validates whether the MuJoCo shared library exists and can be loaded.
Update the 'lib_path' according to your operating system.
"""
# 👉 Change this path based on your OS
lib_path = "dist/bin/libmujoco.so" # For Linux
# lib_path = "dist/bin/mujoco.dll" # For Windows
# lib_path = "dist/bin/libmujoco.dylib" # For macOS

if not os.path.exists(lib_path):
raise FileNotFoundError(f"Shared library not found at: {lib_path}")

try:
ctypes.CDLL(lib_path)
print(f"✅ MuJoCo library loaded successfully from: {lib_path}")
except OSError as e:
print("❌ Failed to load MuJoCo library")
raise e

if __name__ == "__main__":
test_mujoco_library()