Skip to content

Windows Optional Dependencies

Yannick Goumaz edited this page Jun 20, 2022 · 64 revisions

Extra msys64 packages

Some extra msys64 packages may be useful:

  • swig is needed to compile the Python and Java API wrappers.
  • mingw-w64-x86_64-libssh and mingw-w64-x86_64-libzip are needed to compile the Robotis OP2 robot window.
  • mingw-w64-x86_64-boost is needed to compile the ROS controller.
  • mingw-w64-x86_64-opencv is needed to compile the OpenCV howto demo.
  • cmake is needed to compile the Thymio II dashel library and associated controller.
  • mingw-w64-i686-gcc is needed to recompile the 32 bit version of Controller.dll (used by SoftBank naoqisim controller).

These packages may be installed individually with the pacman -S <package_name> command line. Alternatively, you can install all of them from the following script:

./scripts/install/msys64_installer.sh --all

Test and Debugging packages

Some extra msys64 packages are useful to contribute to the development:

  • mingw-w64-x86_64-clang and mingw-w64-x86_64-cppcheck are needed to check the coding style.
  • mingw-w64-x86_64-gdb is needed for debugging.

To install all these packages in addition to the previous ones, launch the script with the '--dev' argument instead:

./scripts/install/msys64_installer.sh --dev

Python

This is needed only if you want to run Python robot controllers such as the SUMO interface, or Python-based scripts such as the Webots web service or the OSM importer. You must install the 64-bit version of Python 3.8 and optionally Python 3.7, 3.9 and/or 3.10 from https://www.python.org. We recommend to install Python for all users in C:\Program Files\Python38 and optionally in C:\Program Files\Python37, C:\Program Files\Python39 and/or C:\Python310. Then, you should update your ~/.bash_profile file by uncommenting the appropriate line(s) to set the PYTHON37_HOME, PYTHON38_HOME, PYTHON39_HOME and/or PYTHON310_HOME. Don't forget to reload with source ~/.bash_profile.

Pip is installed in C:\Program Files\Python38\Scripts (respectively in C:\Program Files\Python37\Scripts and C:\Python27\Scripts) and should be used to install Python modules. Updating it is recommended from a MSYS2 console running in Administrator mode:

msys2_admin

python -m pip install --upgrade pip

Webots web service

This is needed only to run Webots as a web service (simulation_server.py in the cloud).

Install Python 3.8 and the following modules:

python -m pip install websocket-client
python -m pip install tornado
python -m pip install nvidia-ml-py3
python -m pip install psutil
python -m pip install wmi
python -m pip install pypiwin32
python -m pip install requests

Install subversion (needed by simulation_server.py to checkout GitHub repositories):

pacman -Syuu subversion

Automobile tools

This is needed only if you want to use the automobile tools (including the OpenStreetMap importer)

Install Python and follow the instructions here: https://www.cyberbotics.com/doc/automobile/openstreetmap-importer#windows

InnoSetup

This is needed only if you want to create a Webots binary setup package for distribution on Windows.

Install InnoSetup version 6.2.0 or later from http://www.jrsoftware.org/isdl.php or from this script:

./scripts/install/inno_setup_installer.sh

Atom

This is needed only if you don't already have a good source code editor installed on your computer. Also, it is very helpful to use Atom to hack Webots because the Webots development environment has a number of tools and goodies specific to Atom.

Get it from here.

Microsoft Visual C++

This is needed only if you want to compile robot controllers with Visual C++.

Install Chocolatey in PowerShell and then Microsoft Visual C++ Build Tools 2017 by typing choco install -y visualcpp-build-tools (note the -y option). This is needed in order to generate Microsoft Visual C++ .lib files and compile Webots robot controllers with Microsoft Visual C++. You should also update your ~/.bash_profile file to set the VISUAL_STUDIO_PATH appropriately.

Java

This is needed only if you want to compile and run Webots Java controllers.

Install the 64-bit version of the Java SE 17 Development Kit (JDK) from an administrator PowerShell with choco install -y openjdk17. Then, you should update your ~/.bash_profile file to set the JAVA_HOME appropriately.

MATLAB

This is needed only if you want to program robots using MATLAB.

Install the latest version of MATLAB and update your ~/.bash_profile file to set the MATLAB_HOME appropriately.

Update MSYS64 packages

This operation should be performed regularly to be up-to-date with the latest version of the MSYS64 packages.

Note: it may sometimes break Webots if an updated package is broken or incompatible with the previous one.

pacman -Syuu
cd $WEBOTS_HOME/scripts/install/
./msys64_installer.sh

Web interface with wren.js

To be able to compile the streaming-viewer, you need python 3.8, pyclibrary and Emscripten

pyclibrary

Once you have configured python 3.8 for msys2, enter the following command in a msys2 terminal:

python -m pip install pyclibrary

Emscripten

Run the following commands in a msys2 terminal:

# Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git

# Enter that directory
cd emsdk

# Download and install the latest SDK tools.
./emsdk install latest

# Make the "latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest

Then uncomment the line source $HOME/emsdk/emsdk_env.sh >/dev/null 2>&1 in bash_profile.windows that is in webots/script/install.

Run the following commands from Webots home folder:

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

If you encounter an error like [WinError 2] The system cannot find the file specified: '\\\\?\\C:/', replace the first line of fix_potentially_long_windows_pathname from emsdk.py by:

def fix_potentially_long_windows_pathname(pathname):
  if MSYS or not WINDOWS:
Clone this wiki locally