Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Added glfw build instructions
  • Loading branch information
vmanoj1996 authored Dec 10, 2023
1 parent 6f54e19 commit 43b5478
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,34 @@ Steps for building/rebuilding the C-MEX S-Function code. These instructions are
- ***Code generation*** - The MuJoCo Plant block supports code generation (Simulink Coder) and monitor and tune for host target. Refer to mj_monitorTune.slx for more info.
- ***Performance improvement*** - In case you want to reduce the mask initialization overhead, you can directly use the underlying S-Function. Select the MuJoCo Plant block and Ctrl+U to look under the subsystem mask. Make sure to call the initialization functions (whenever the MJCF XML model changes).

## Bugs/Workarounds
### GLFW

In case MATLAB crashes while running getting started model and you see the following lines in stack trace,

`#10 0x00007fdaf8619f40 in glfwCreateWindow () at /lib/x86_64-linux-gnu/libglfw.so.3`

`#11 0x00007fdaf8675c4d in MujocoGUI::initInThread(offscreenSize*, bool)`,

Updating glfw could fix the issue.

Building glfw from source ([glfw main - commit id](https://github.com/glfw/glfw/tree/46cebb5081820418f2a20f3e90b07f9b1bd44b42)) and installing fixed this issue for me,
- sudo apt remove libglfw3 libglfw3-dev # Remove existing glfw
- mkdir ~/glfwupdated
- cd ~/gflwupdated
- git clone git@github.com:glfw/glfw.git
- sudo apt install cmake-qt-gui
- cmake-gui
- Set the source directory to the root of cloned repo
- mkdir build in the cloned repo
- Set the build directory
- In Cmake Gui settings - Select "BUILD_SHARED_LIBS" as well
- Configure and then generate
- Open a terminal in the build directory and run $make in terminal
- Once build goes through without any error, run $make install in terminal
- sudo ldconfig (to refresh linker cache)
- Follow the build instructions for mujoco-simulink-blockset

## License

The license is available in the license.txt file within this repository.
Expand Down

0 comments on commit 43b5478

Please sign in to comment.