Skip to content

Windows installation

Olivier Michel edited this page Mar 30, 2022 · 74 revisions

It takes less than one hour on a fairly recent computer with a decent Internet connection to install all the dependencies and recompile Webots from the sources.

MSYS2 Development Environment and Git

MSYS2 is the primary development environment for Webots on Windows:

  • Install MSYS2 from https://msys2.github.io (select the 64 bit version and follow the instructions).
  • Don't forget to update the package database with pacman -Syu.
  • Install Git with pacman -S git.

Clone the Github Repository

From the MSYS2 shell create these sub-directories in your home directory and clone the repository.

Note: instead of cloning https://github.com/cyberbotics/webots.git, we recommend to create your own fork and clone it, so that you can commit your changes directly on it.

git config --global credential.helper store
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git config --global push.default simple
git clone --recurse-submodules -j8 https://github.com/cyberbotics/webots.git
cd webots

Create a SSH key (if not done already)

Follow the instructions at https://github.com/settings/keys to create a SSH key. This will allow you to push commits back to the GitHub upstream, using your SSH token as a password.

Git submodules

If you cloned Webots with the --recurse-submodules option, you can skip this step. Otherwise, you need to initialize the submodules used by Webots:

git submodule init
git submodule update

Setup your bash profile

Append scripts/install/bash_profile.windows at the end of your ~/.bash_profile and check and edit the result:

cat scripts/install/bash_profile.windows >> ~/.bash_profile

Restart MSYS2.

Install the MSYS2 Dependencies

scripts/install/msys64_installer.sh

Install Optional Dependencies [ optional ]

If needed, follow these instructions to install optional dependencies.

Build Webots

Compile Webots and automatically download the required resources in the dependencies folder:

make -jX

Note: X represents the number of threads for a speedy multi-threaded compilation. For example, type make -j12 on a CPU with four cores and hyper-threading.

make help displays additional targets for debugging, profiling, cleaning, etc.

Once compiled, type webots to launch it.

Update the MSYS2 packages

Regularly, you may need to update the MSYS2 packages as new versions of these packages become available. In order to proceed, type pacman -Syuu and if some Qt5 packages get upgraded, re-run the qt_windows_installer.sh script to ensure Webots will use them. This can be done by navigating to /scripts/install and typing ./qt_windows_installer.sh.

Running Extern Robot Controllers

Environment variables specified on the Running Extern Robot Controllers page differ from the environment variables you should use in the development environment:

Environment Variable Typical Value
WEBOTS_HOME C:\msys64\home\username\webots
Path (all controllers) add %WEBOTS_HOME%\lib\controller and %WEBOTS_HOME%\msys64\mingw64\bin
MSYS2_HOME (for Python controllers) C:\msys64
Clone this wiki locally