This page details instructions for compiling RawTherapee on Windows systems. There are also separate pages with instructions for compiling on Linux and macOS. This guide details the what and how parts of compilation. For the why and explanations of these commands, for a list of dependencies, CMake options and other information, please refer to the detailed Linux article.

For instructions on cloning the source, choosing branches, configuring CMake and doing the actual compilation, see these sections in the Linux guide. The information below is in addition to that.

RawTherapee requires GTK+ 3.22.24 or newer, as this is the first version to support native windows, without which the RawTherapee window could exhibit strange behavior, such as maximizing under the taskbar in Windows 10.

The last version of RawTherapee to support GTK2 and compatible with Windows XP is 5.0-r1-gtk2 released on 2017-02-02.

1 MSYS2 Installation

1.1 Install MSYS2 base system

Begin by installing and updating MSYS2 carefully following the instructions from the MSYS2 website. Update the base MSYS2 system until no further updates are available using:

$ pacman -Syu

At the end of this installation, you get three shells:

  • MSYS2 shell: used to developp the core system and manage the MSYS2 application( mainly updating MSYS2 packages)
  • MINGW64 shell: it provides environment to build 64B applications.
  • MINGW32 shell: it provides environment to build 32B applications.

MSYS2 Shell.jpg

note: in following text, <MSYS2> is the MSYS2 installation folder.

1.2 Install tools and libraries

The MSYS2 package manager is pacman. You can refer to the pacman manual for details.

In the MSYS2 shell:

First, install a few miscellaneous tools:

$ pacman -S tar gzip nano make diffutils intltool git

Then install the necessary development tools:

# win32
$ pacman -S mingw-w64-i686-gcc mingw-w64-i686-gdb mingw-w64-i686-make mingw-w64-i686-pkg-config mingw-w64-i686-cmake
# win64
$ pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-make mingw-w64-x86_64-pkg-config mingw-w64-x86_64-cmake

and the required libraries:

# win32
$ pacman -S  mingw-w64-i686-gtkmm3 mingw-w64-i686-lcms2 mingw-w64-i686-fftw mingw-w64-i686-lensfun 
# win64
$ pacman -S  mingw-w64-x86_64-gtkmm3 mingw-w64-x86_64-lcms2 mingw-w64-x86_64-fftw mingw-w64-x86_64-lensfun

1.3 Downgrading to applicable versions of packages

this paragraph is to be ignored at the moment.

As MSYS2 provides rolling releases of packages, it can happen that new versions of some packages are incompatible either with present build process or contain some bugs.

This is a list of all packages which have to be downgraded to:

The list is empty

If not present in <MSYS2>\var\cache\pacman\pkg, these files can be downloaded from:

Then in the MSYS2 shell, for each file:

Pacman -U <path-to-files>/mingw-w64-x86_64-...

Add following to the file <MSYS2>\etc\pacman.conf to prevent pacman from updating the packages.

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
IgnorePkg = <packageToIgnore>

If some packages are interdependant, you have to downgrade them on the same command line:

Pacman -U <path-to>/<mingw-w64-x86_64-package1> <path-to>/<mingw-w64-x86_64-package2> ...

If you want to build 32B applications, do the above, replacing x86_64 by i386.

1.4 Updating MSYS2 base system and application packages

in MSYS2 shell:

$ pacman -Syuu

1.5 Updating Lensfun data base

In Mingw32 or Mingw64 shell:

$ lensfun-update-data

2 Download and build libiptcdata

Use either "MinGW32 Shell" if you want to build a 32-bit version, or "MinGW64 Shell" if you want to build a 64-bit version.

The libiptcdata library is not provided by MSYS2, therefore it should be downloaded and configured using:

$ curl -LO
$ tar xzf libiptcdata-1.0.4.tar.gz
$ cd libiptcdata-1.0.4

# win32
$ ./configure --prefix=/mingw32
# win64
$ ./configure --prefix=/mingw64

Stay in the same directory The Makefile located in this directory needs to be opened using a text editor to remove iptc and docs from the lists named SUBDIRS and DIST_SUBDIRS, as building or installing will fail otherwise. You can use any text editor for instance Notepad++.

#editing with nano
$ nano -m Makefile

# search (command ctrl/W)
DIST_SUBDIRS = m4 libiptcdata po iptc docs win python
# and replace with
DIST_SUBDIRS = m4 libiptcdata po win python

# search
SUBDIRS = m4 libiptcdata po iptc docs win $(MAYBE_PYTHONLIB)
# and replace with
SUBDIRS = m4 libiptcdata po win $(MAYBE_PYTHONLIB)
# save
# quit

Finally build and install the library:

$ make
$ make install
$ cd

3 Clone and build RawTherapee

Use either "MinGW32 Shell" if you want to build a 32-bit version, or "MinGW64 Shell" if you want to build a 64-bit version.

3.1 Clone RawTherapee's Git repository.

The build process will fail if there is a space character anywhere in your build folder path. For example if your Windows username is "Zank Frappa" then your home path will be C:\Users\Zank Frappa\ and if you clone RawTherapee inside there then the build will fail during compilation. Simply clone to a folder where neither it nor its parent folders have a space in their name, for example C:\code\repo-rt
$ git clone /c/code/repo-rt
$ cd /c/code/repo-rt

When you clone the repository you will automatically find yourself in the dev branch. To switch to the dev branch manually, do the following:

$ git checkout dev

3.2 Create a separate directory for the build

$ mkdir build
$ cd build

Note that if you switch branches then you must delete and recreate the build folder so that compilation starts from scratch in an empty folder, otherwise compilation is likely to fail. However if you are just updating without changing branches then you do not have to start with an empty build folder - you can just go into the existing one, and compilation will be faster because not everything will need to be recompiled.

3.3 Run CMake and Make

$ cmake -G "MSYS Makefiles" -DLENSFUNDBDIR=share/lensfun -DCMAKE_BUILD_TYPE="release" -DPROC_TARGET_NUMBER="2" -DCACHE_NAME_SUFFIX="5-dev" ..
$ make install

The option -DPROC_TARGET_NUMBER="2" will generate a build optimized to your machine architecture (i.e. -march=native) You can find an explanation of the various CMake options in the Linux article, including an explanation of the various "BUILD_TYPE" options.

If you are building for 32-bit Windows and are using the release or relwithdebinfo "BUILD_TYPE", you will need to add the -mstackrealign compiler flag before the last two dots .. of the CMake command above:

-DCMAKE_C_FLAGS="-mstackrealign" -DCMAKE_CXX_FLAGS="-mstackrealign"

3.4 Starting RawTherapee

RawTherapee can now be started from the MINGW64 command line:

# for debug builds
$ cd debug
# for release builds
$ cd release
# for relwithdebinfo builds
$ cd relwithdebinfo
$ ./rawtherapee.exe

3.5 Option: Pre-load a script to populate the CMake cache

As described in the CMake manual

-C <initial-cache>

    Pre-load a script to populate the cache.

    When cmake is first run in an empty build tree, it creates a CMakeCache.txt file and populates it with customizable settings for the project. This option may be used to specify a file from which to load cache entries before the first pass through the project’s cmake listfiles. The loaded entries take priority over the project’s default values. The given file should be a CMake script containing SET commands that use the CACHE option, not a cache-format file.

To simplify the invocation of CMake and be able to easily define Windows specific options, a win.cmake template script is provided with the sources. Copy it out of RawTherapee source to avoid overwriting by update for instance in mywin.cmake. Edit it to define or modify options. To preload the cache, in the CMake command line:

$ cmake -G "MSYS Makefiles" -DLENSFUNDBDIR=share/lensfun -DCMAKE_BUILD_TYPE="release" -DPROC_TARGET_NUMBER="2" -DCACHE_NAME_SUFFIX="5-dev" -C <path/to/mywin.cmake> ..

4 Making a bundled build

It is applicable if you want to run RawTherapee outside the MINGW shell or distribute it.

You can copy either with the Windows file manager or, recommended, with robocopy inside the <mingw32|mingw64> shell script using - instead of / for the options.

4.1 Definition of folders

  • <prefix> is <MSYS2>\<mingw32|mingw64>,
  • <MSYS2> is the MSYS2 installation folder,
  • and . is the RawTherapee installation folder.

4.2 Copy RawTherapee executable and generated files

Copy the content of c:\code\repo-rt\build\<debug|release|relwithdebinfo> into ..

4.3 Copy the dependencies

Copy the necessary DLLs and exe from <prefix>\bin into .. The current list of required DLLs and EXE is:

libgcc_s_seh-1.dll (or libgcc_s_dw2-1.dll for W32)

Copy the following list of Adwaita theme files and directories from <prefix>\share\icons\Adwaita\ to .\share\icons\Adwaita\:


Copy following files :

<prefix>\lib\gdk-pixbuf-2.0 -> .\lib\gdk-pixbuf-2.0
<prefix>\share\glib-2.0\schemas\gschemas.compiled -> .\share\glib-2.0\schemas
<prefix>\share\lensfun\version_1\* -> .\share\lensfun

Create in .\share\gtk-3.0 a file settings.ini containing :

[Settings] gtk-button-images=1

5 Creating a distributable package

If you plan to distribute RawTherapee packages for the Windows platform, as a first step you need to make sure that RawTherapee will be built for the "generic" processor target. To do so, use -DPROC_TARGET_NUMBER="1" in the CMake command.

During compilation, a script named WindowsInnoSetup.iss is created in the RawTherapee installation folder. This script is used by Inno Setup [1], a program which is used to generate installers for Windows programs. It is advised to download the Unicode version [2] to avoid problems with some languages.

To help users write useful bug reports, package maintainers are encouraged to produce builds which include both a "release" and a "debug" executable, and to bundle them together with the GDB debugger executable.

In other words, put the rawtherapee.exe (release) file together with the rawtherapee-debug.exe (debug) file and the gdb.exe file together into the same installer or the same archive. An alternative is to produce "relwithdebinfo" builds - these are much faster than "debug" but not as optimized as "release" builds, yet they provide just about as much useful information as "debug" builds.

When making "relwithdebinfo" or "debug" builds you must provide the GDB debugger executable. Windows binaries of the debugger gdb.exe can be downloaded from here in 32- and 64-bit versions and will be copied into Rawtherapee installation folder.

Now that everything is set up, to create the package right-click on the WindowsInnoSetup.iss script and choose Compile from the context menu. It will automatically generate the installer and place it in the parent folder.

To make your new package compatible with the RawTherapee website's upload panel, create a zip archive in which you will place both the newly created installer and the corresponding AboutThisBuild.txt file which can be found at the same place. Name the resulting zip archive following this template: RawTherapee_<version>_WinVista_<32|64>_<buildtype>.zip

If you are building and distributing nightly builds, follow this template: RawTherapee_<branch>_<version>_WinVista_<32|64>_<buildtype>.zip

  • "WinVista" means it can run on any version of Windows from Vista upwards, including 10.
  • The "version" will either look like 5.2 if you checkout the 5.2 tag, or 5.2-g1a2b3c4d if you checkout the dev branch after 5.2 was tagged.
  • If you are shipping more than one build type in an installer, don't include <buildtype> in the name.