-
-
Notifications
You must be signed in to change notification settings - Fork 887
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
Add mujoco
package
#2624
Comments
Here's my initial attempt. This is the first time I've tried this - I'm following these instructions, but it seems that they're missing a bunch of steps, so I've tried to improvise, which may mean I'm not doing things optimally or correctly: cd /home/joe/Downloads
git clone https://github.com/pyodide/pyodide
cd pyodide
docker build -t pyodide .
docker run --rm -it -v /home/joe/Downloads:/stuff -w /stuff pyodide:latest bash
cd pyodide
make
python -m pyodide_build mkpkg mujoco
cd ./packages/mujoco
wget -qO- https://github.com/deepmind/mujoco/releases/download/2.2.0/mujoco-2.2.0-linux-x86_64.tar.gz | tar -xvz -C /stuff
# Add `env["MUJOCO_PATH"] = "/stuff/mujoco-2.2.0"` to `compile` function in /stuff/pyodide/pyodide-build/pyodide_build/pywasmcross.py
python -m pyodide_build buildpkg meta.yaml The And here's the not-very-helpful error that I get from Click to expand
|
Would be nice to improve this if we ever get around to it. If you get ideas, PRs to improve the docs are welcome (though we ought to work on it ourselves).
Did you try using our
This can go in the build:
script: |
wget -qO- https://github.com/deepmind/mujoco/releases/download/2.2.0/mujoco-2.2.0-linux-x86_64.tar.gz | tar -xvz -C stuff
export MUJOCO_PATH=$(pwd)/stuff But most likely MUJOCO should be made into a separate library.
I find CMake completely baffling too. Maybe @ryanking13 or @henryiii can help. |
Wondering how to get cmake error to be more helpful. I've tried this: build:
script: |
export CMAKE_ARGS="-Wdev" Since
I also tried adding a file |
The error is this one:
It looks like the directory should have been made here: https://github.com/deepmind/mujoco/blob/e94a46c20fc7d64db6bd18edc1789007cab45641/python/setup.py#L228 You can set various trace options to get errors from CMake, but CMake isn't even starting, it's being given an non-existent source directory so it's immediately failing. |
Hmm, this is the source directory: That doesn't exist. I notice this is a custom-rolled CMake adaptor, and is missing modern packaging tooling like pyproject.toml, and has specific instructions that include making an SDist first - https://github.com/deepmind/mujoco/tree/main/python. Are you following those instructions? It's quite possible it requires going through SDist first, and can't build directly from source. |
Thanks for taking a look! My new
That still gives the same cmake error for some reason:
Full logs: Click to expand
I'm wondering if the I think the meta problem here is that I don't understand how the whole Pyodide build process works. I've added some more info to the docs here based on stuff I learned while trying to get this working, but I think it could do with a high-level overview of the build process, and some added reasoning/understanding at each step instead of just the concrete commands/instructions. That would help newbies like me a lot in understanding what might be going wrong in cases like this - even simple stuff like what the It could just be that a task like this is a bit beyond my "zone of proximal development". |
You need to build packages/libmujoco/meta.yamlpackage:
name: libmujoco
version: 2.2.0
source:
url: https://github.com/deepmind/mujoco/archive/refs/tags/2.2.0.tar.gz
sha256: 1bb370365a10f3e76eee8a438c8eafcd0d2721e05c1c9bf602cded8223f819cf
build:
sharedlibrary: true
script: |
mkdir build
cd build
emcmake cmake ..
emmake make
test:
imports:
- mujoco
about:
home: https://github.com/deepmind/mujoco
PyPI: https://pypi.org/project/mujoco
summary: MuJoCo Physics Simulator
license: Apache License 2.0 This fails with: "Could NOT find required library LibM". I'm not sure why it's not finding the math library. libm is definitely available, for instance numpy finds it and successfully links it. I think we have to leave this question to someone else who understands CMake. Anyways, for the Python package I have the following. Not sure if it will work. packages/mujoco/meta.yamlpackage:
name: mujoco
version: 2.2.0
source:
url: https://github.com/deepmind/mujoco/archive/refs/tags/2.2.0.tar.gz
# sha256: 1bb370365a10f3e76eee8a438c8eafcd0d2721e05c1c9bf602cded8223f819cf
extras:
- [setup.py, setup.py]
build:
script: |
export MUJOCO_PATH=$(pwd)/mujoco-2.2.0
cd python
python3 -m venv .venv
source .venv/bin/activate
bash make_sdist.sh
test:
imports:
- mujoco
about:
home: https://github.com/deepmind/mujoco
PyPI: https://pypi.org/project/mujoco
summary: MuJoCo Physics Simulator
license: Apache License 2.0 packages/mujoco/setup.pyfrom importlib.machinery import SourceFileLoader
# Just import the real setup.py in the python folder
SourceFileLoader("setup", "python/setup.py").load_module() |
Sorry to bother but any progress on this? |
No. But we can help debug the issue if you try to build the package yourselves and report what goes wrong. |
🐍 Package Request
install_requires=['absl-py', 'glfw', 'numpy', 'pyopengl']
DeepMind recently bought the MuJoCo company and open-sourced it. They also released official (pybind11) Python bindings. It's an extremely powerful engine, aimed specifically at scientific/robotics applications. Most other engines are focused on entertainment/games. Getting this to work in the browser would be beyond awesome.
I'm guessing the opengl stuff would be hard to add (unless someone has already worked on getting opengl-->webgl working), and if that's true, then ideally we can just skip it. Not sure how "entangled" it is with the codebase.
The text was updated successfully, but these errors were encountered: