I was trying to install Mujoco as a library to be used in my own Cpp programs, but I don¡t know if I should build it, although it does not have any CMakeLists file. I do not have much experience using precompiled libraries, so there might be the problem. Don't have much experience with Mujoco, but since I wanted to create a ROS2 interface with Mujoco, I think that going to the Mujoco library and learn how to use it is a good starting point.
Asked
Active
Viewed 333 times
1 Answers
0
You are right in that we currently do not provide a CMakeLists.txt
for MuJoCo. We are in the process of modifying our internal CMake setup to have it work for non-Google users. This will be made available as part of our open source release.
In the meantime, the CMakeLists.txt
for our Python bindings should give you an idea for how to build a CMake project against the precompiled MuJoCo library.

Saran Tunyasuvunakool
- 1,064
- 1
- 9
- 23
-
If I want to use it in Cpp, should I just take the folder that is downloaded from the official page and put it either in my /usr/lib or /usr/local/lib folders? Again, I have no experience with manually installing shared libraries, so I might be making some mistakes, although I'm currently reading on it. – pdaranda661 Apr 01 '22 at 22:57
-
In the CMakeLists for Python that I linked to above, we defined CMake variables (`MUJOCO_LIBRARY` and `MUJOCO_INCLUDE`) that are used as hints to `find_library`. I _believe_ that if you put the MuJoCo library in /usr/local/lib (or any directory that's in your system's default library search paths list) then you should not need the hint. – Saran Tunyasuvunakool Apr 02 '22 at 20:57