diff --git a/doc/programming/index.rst b/doc/programming/index.rst index a7424422..03916e22 100644 --- a/doc/programming/index.rst +++ b/doc/programming/index.rst @@ -76,24 +76,16 @@ directory; it contains error and warning messages, and can be deleted at any tim After verifying that the simulator works, you may also want to re-compile the code samples to ensure that you have a working development environment. We provide a cross-platform `CMake -`_ setup that can be used to build sample +`__ setup that can be used to build sample applications independently of the MuJoCo library itself. On macOS, the DMG disk image contains ``MuJoCo.app``, which you can double-click to launch the ``simulate`` GUI. You can -also drag ``MuJoCo.app`` into the ``/Application`` on your system, as you would to install any other app. While -``MuJoCo.app`` may look like a file, it is in fact an `Application Bundle `_, which is a directory that contains executable binaries for all of MuJoCo's sample applications, along with -an embedded `framework -`_, -which is a subdirectory containing the MuJoCo dynamic library and all of its public headers. In other words, -``MuJoCo.app`` contains all the same files that are shipped in the archive on Windows and Linux. To see this, right -click (or control-click) on ``MuJoCo.app`` and click "Show Package Contents". - -As mentioned above, ``mujoco.framework`` contains the library and headers that are necessary to build any application -that depends on MuJoCo. If you are using Xcode, you can import it as a framework dependency on your project. (This also +also drag ``MuJoCo.app`` into the ``/Application`` on your system, as you would to install any other app. As well as the +``MuJoCo.app`` `Application Bundle `__, the DMG includes the ``mujoco.framework`` subdirectory containing the MuJoCo dynamic library and all of +its public headers. If you are using Xcode, you can import it as a framework dependency on your project. (This also works for Swift projects without any modification). If you are building manually, you can use ``-F`` and -``-framework mujoco`` to specify the header search path and the library search path respectively. The macOS Makefile -provides an example for this. +``-framework mujoco`` to specify the header search path and the library search path respectively. .. _inBuild: diff --git a/doc/python.rst b/doc/python.rst index be1127fd..2454c075 100644 --- a/doc/python.rst +++ b/doc/python.rst @@ -522,8 +522,8 @@ Building from source 1. Make sure you have CMake and a C++17 compiler installed. 2. Download the `latest binary release `__ - from GitHub. On macOS, the download corresponds to a DMG file from which you - can drag ``MuJoCo.app`` into your ``/Applications`` folder. + from GitHub. On macOS, the download corresponds to a DMG file which you can mount by + double-clicking or running ``hdiutil attach ``. 3. Clone the entire ``mujoco`` repository from GitHub and ``cd`` into the python directory: @@ -545,7 +545,6 @@ Building from source .. code-block:: shell - cd python bash make_sdist.sh The ``make_sdist.sh`` script generates additional C++ header files that are @@ -556,19 +555,21 @@ Building from source 6. Use the generated source distribution to build and install the bindings. You'll need to specify the path to the MuJoCo library you downloaded earlier - in the ``MUJOCO_PATH`` environment variable. + in the ``MUJOCO_PATH`` environment variable, and the path to the MuJoCo + plugin directory in the ``MUJOCO_PLUGIN_PATH`` environment variable. .. note:: - For macOS, this can be the path to a directory that contains the - ``mujoco.framework``. In particular, you can set - ``MUJOCO_PATH=/Applications/MuJoCo.app`` if you installed MuJoCo as - suggested in step 1. + For macOS, the files need to be extracted from the DMG. + Once you mounted it as in step 2, the ``mujoco.framework`` directory can be found in ``/Volumes/MuJoCo``, + and the plugins directory can be found in ``/Volumes/MuJoCo/MuJoCo.app/Contents/MacOS/mujoco_plugin``. + Those two directories can be copied out somewhere convenient, or you can use + ``MUJOCO_PATH=/Volumes/MuJoCo MUJOCO_PLUGIN_PATH=/Volumes/MuJoCo/MuJoCo.app/Contents/MacOS/mujoco_plugin``. .. code-block:: shell cd dist - MUJOCO_PATH=/PATH/TO/MUJOCO - MUJOCO_PLUGIN_PATH=/PATH/TO/MUJOCO_PLUGIN + MUJOCO_PATH=/PATH/TO/MUJOCO \ + MUJOCO_PLUGIN_PATH=/PATH/TO/MUJOCO_PLUGIN \ pip install mujoco-x.y.z.tar.gz The Python bindings should now be installed! To check that they've been