Building from source#

Here we describe how to build ViZDoom from source. If you want to install pre-build ViZDoom wheels for Python, see Python quick start.

Dependencies#

To build ViZDoom (regardless of the method), you need to install some dependencies in your system first.

Linux#

To build ViZDoom on Linux, the following dependencies are required:

  • CMake 3.12+

  • Make

  • GCC 6.0+

  • Boost libraries 1.54.0+

  • Python 3.7+ for Python binding (optional)

Also some of additionally ZDoom dependencies are needed.

apt-based distros (Ubuntu, Debian, Linux Mint, etc.)#

To get all dependencies on apt-based Linux (Ubuntu, Debian, Linux Mint, etc.) execute the following commands in the shell (might require root access).

# All possible ViZDoom dependencies,
# most are optional and required only to support alternative sound and music backends in the engine
# other can replace libraries that are included in the ViZDoom repository
apt install build-essential cmake git libsdl2-dev libboost-all-dev libopenal-dev \
zlib1g-dev libjpeg-dev tar libbz2-dev libgtk2.0-dev libfluidsynth-dev libgme-dev \
timidity libwildmidi-dev unzip

# Only essential ViZDoom dependencies
apt install build-essential cmake git libboost-all-dev libsdl2-dev libopenal-dev

# Python 3 dependencies (alternatively Anaconda 3 installed)
apt install python3-dev python3-pip
# or install Anaconda 3 and add it to PATH

dnf/yum-based distros (Fedora, RHEL, CentOS, Alma/Rocky Linux, etc.)#

To get all dependencies on dnf/yum-based Linux (Fedora, RHEL, CentOS, Alma/Rocky Linux, etc.) execute the following commands in the shell (might require root access).

# Essential ZDoom dependencies
dnf install cmake git boost-devel SDL2-devel openal-soft-devel

# Python 3 dependencies (alternatively Anaconda 3 installed)
dnf install python3-devel python3-pip

Anaconda/Miniconda#

If you do not have a root access, you can use a conda (e.g. miniconda) environment to install dependencies to your environment only:

conda install -c conda-forge boost cmake gtk2 sdl2

Note that to install ViZDoom in a conda environment you have to pull, build and install ViZDoom manually with

git clone https://github.com/mwydmuch/ViZDoom.git
cd ViZDoom
python setup.py build && python setup.py install

MacOS#

To build ViZDoom on MacOS, the following dependencies are required:

  • CMake 3.12+

  • Clang 5.0+

  • Boost libraries 1.54.0+

  • Python 3.7+ for Python binding (optional)

Also some of additionally ZDoom dependencies are needed.

To get all the dependencies install homebrew first, than execute the following commands in the shell:

brew install cmake boost sdl2 openal-soft

Windows#

  • CMake 3.12+

  • Visual Studio 2012+

  • Boost libraries 1.54.0+

  • Python 3.7+ for Python binding (optional)

Additionally, ZDoom dependencies are needed. Most of them (except Boost) are gathered in this repository: ViZDoomWinDepBin. You can download Boost from here.

Building manylinux wheels#

To build manylinux wheels you need to install docker and cibuildwheel. Then on Linux and MacOS run in ViZDoom root directory:

cibuildwheel --platform linux

The binary ViZDoom wheels will be placed in wheelhouse directory. In case of building using cibuildwheel, the dependencies are installed automatically inside the docker container, so you do not need to install them manually in your system.