Windows


Install on Windows

This documentation describes how to set up a workspace for trying to compile Gazebo on Windows. The support for the Gazebo Windows compilation has been completed since version 9.

Important note: These Windows instructions may not work for all users. The community is looking for a better alternative to use Gazebo on Windows. Please checkout the issue tracker to know about the different alternatives.

Important requirement: 30Gb free disk space

It is recommended to have at least 30 Gigabytes of disk space to host Gazebo sources together with all the dependencies and compilation artifacts.

Supported compilers

At this moment, compilation has been tested on Windows 8.1 and 10, supported when using Visual Studio 2017. Patches for other versions are welcome.

Installation

This installation procedure uses pre-compiled binaries in a local workspace. To make things easier, use a MinGW shell for your editing work (such as the Git Bash Shell), and only use the Windows cmd for configuring and building. You might also need to disable the Windows firewall.

  1. Make a directory to work in, e.g.:

    mkdir gz-ws
    cd gz-ws
    
  2. Download the following dependencies into that directory:

    1. libcurl HEAD
    2. libyaml
    3. dlfcn-win32
    4. jsoncpp
    5. protobuf 3.4.1
    6. zlib
    7. zziplib 0.13.62
    8. freeImage 3.x
    9. boost 1.67.0
    10. OGRE 1.10.12 rc1
    11. bzip2 1.0.6
    12. TBB 4.3
    13. Qt 5.7.0
    14. QWT 6.1.22
    15. ZeroMQ 4.2.3
  3. Unzip each of them in gz-ws.

  4. Install cmake, make sure to select the "Add CMake to system path for all users" option in the install dialog box

    Cmake

  5. Install Ruby 1.9 or greater. During the install process make sure add Ruby to your system paths.

    Ruby

  6. Clone Ignition CMake, Common, Fuel Tools, Math, Transport, Sdformat, and Gazebo:

    git clone https://github.com/ignitionrobotics/ign-cmake -b ign-cmake0
    git clone https://github.com/ignitionrobotics/ign-common -b ign-common1
    git clone https://github.com/ignitionrobotics/ign-fuel-tools -b ign-fuel-tools1
    git clone https://github.com/ignitionrobotics/ign-math -b ign-math4
    git clone https://github.com/ignitionrobotics/ign-msgs -b ign-msgs1
    git clone https://github.com/ignitionrobotics/ign-transport -b ign-transport4
    git clone https://github.com/osrf/sdformat -b sdf6
    git clone https://github.com/osrf/gazebo -b gazebo9
    
  7. Open a regular Windows shell (Start->Run->"cmd"->enter), and load your compiler setup by copying and pasting the following line:

    "C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
    

    or "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64

Note: Replace 2017 with 2019 in the path if running VS 2019

    "C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64

or "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64

  1. In a Windows shell, configure and build Ignition CMake

    cd ign-cmake
    # if you want debug, run configure Debug
    .\configure
    nmake
    nmake install
    

    You should now have an installation of Ignition CMake in gz-ws/ign-cmake/build/install/Release.

  2. In a Windows shell, configure and build Ignition Math

    cd ign-math
    # if you want debug, run configure Debug
    .\configure
    nmake
    nmake install
    

    You should now have an installation of Ignition Math in gz-ws/ign-math/build/install/Release.

  3. In a Windows shell, configure and build Ignition Common

    cd ign-common
    # if you want debug, run configure Debug
    .\configure
    nmake
    nmake install
    

    You should now have an installation of Ignition Common in gz-ws/ign-common/build/install/Release.

  4. In a Windows shell, configure and build Ignition Fuel Tools

    cd ign-fuel-tools
    # if you want debug, run configure Debug
    .\configure
    nmake
    nmake install
    

    You should now have an installation of Ignition Fuel Tools in gz-ws/ign-fuel-tools/build/install/Release.

  5. In the same Windows shell, configure and build Ignition Msgs

    cd ..\..\ign-msgs
    mkdir build
    cd build
    # if you want debug, run ..\configure Debug
    ..\configure
    nmake
    nmake install
    

    You should now have an installation of Ignition Msgs in gz-ws/ign-msgs/build/install/Release

  6. In the same Windows shell, configure and build Ignition Transport

    cd ..\..\ign-transport
    mkdir build
    cd build
    # if you want debug, run ..\configure Debug
    ..\configure
    nmake
    nmake install
    

    You should now have an installation of Ignition Transport in gz-ws/ign-transport/build/install/Release

  7. In the same Windows shell, configure and build Sdformat

    cd ..\..\sdformat
    mkdir build
    cd build
    # if you want debug, run ..\configure Debug
    ..\configure
    nmake
    nmake install
    

    You should now have an installation of Sdformat in gz-ws/sdformat/build/install/Release or gz-ws/sdformat/build/install/Debug.

  8. In the same Windows shell, configure and build Gazebo:

    cd ..\..\gazebo
    mkdir build
    cd build
    # if you want debug, run ..\configure Debug
    ..\configure
    nmake gzclient
    nmake gzserver
    nmake install
    

    Once this all works you should now have an installation of Gazebo in gz-ws/gazebo/build/install/Release or gz-ws/gazebo/build/install/Debug.

Running

gzserver

  1. Adjust all paths to load dll

    1. if in Debug

      cd gz-ws\gazebo\build ..\win_addpath.bat Debug

    2. if in Release

      cd gz-ws\gazebo\build ..\win_addpath.bat Release

  2. Create an ogre plugins.cfg file

    1. cd gz-ws\gazebo\build\gazebo
    2. If in Debug: Copy in the following into plugins.cfg and replace MYUSERNAME with your actual username

      # Define plugin folder
      PluginFolder=C:\Users\MYUSERNAME\gz-ws\ogre-sdk-1.10.12-vc15-x64\build\install\Debug\bin\Debug
      
      # Define plugins
      Plugin=RenderSystem_GL_d
      Plugin=Plugin_ParticleFX_d
      Plugin=Plugin_BSPSceneManager_d
      Plugin=Plugin_PCZSceneManager_d
      Plugin=Plugin_OctreeZone_d
      Plugin=Plugin_OctreeSceneManager_d
      
    3. If in Release: Copy in the following into plugins.cfg

      # Define plugin folder
      PluginFolder=C:\Users\MYUSERNAME\gz-ws\ogre-sdk-1.10.12-vc15-x64\build\install\Release\bin\Release
      
      # Define plugins
      Plugin=RenderSystem_GL
      Plugin=Plugin_ParticleFX
      Plugin=Plugin_BSPSceneManager
      Plugin=Plugin_PCZSceneManager
      Plugin=Plugin_OctreeZone
      Plugin=Plugin_OctreeSceneManager
      
    4. Copy this file into the gui directory

      copy plugins.cfg gui\
      
  3. Run gzserver

    gzserver.exe ..\..\worlds\empty.world
    

Debugging

Just in case that you need to debug problems on Gazebo

Running gzserver

If you run into issues, use --verbose to get more information.

Running gzclient

If you run into issues, use --verbose to get more information. A known issue is that it does not run on VirtualBox 3.4, with Ubuntu 15.04 Host. The current theory is that it does not support off-screen frame buffering. It has been confirmed to work on VMWare Player with windws 7 guest and Ubuntu 14.04 Host. More details will be added as testing continues.

Building Ogre Examples

  1. Download OIS

    http://sunet.dl.sourceforge.net/project/wgois/Source%20Release/1.3/ois-v1-3.zip

  2. Compile OIS in Visual Studio Use the project in Win32/ folder

  3. Place OIS headers and libs into

    ogre-...\Dependencies\include ogre-...\Dependencies\lib ogre-...\Dependencies\bin

  4. Patch configure.bat inside ogre-1.8 to use

    -DOGRE_BUILD_SAMPLES:BOOL=TRUE ..

  5. Compile as usual

    ..\configure.bat
    nmake
    
  6. Run the demo browser using:

    # copy OIS_*.dll into the bin directory ogre-...\build\bin\SampleBrowser.exe