Building darktable master+branch for Windows

I used to build windows versions, but only of the master branch. Then something changed, and I couldn’t make that work anymore. Is there a newer set of instructions on building windows versions plus coverage of how to add someone’s branch?

EDIT: Tested my script and it worked. Now working on adding Jens-Hanno Schwalm branch.

I think you should move this to a new topic. Have you deleted all the files in your build directory and tried to compile?? For me the standard method works fine…I use the script and then create a package and then install…

Edit: @afre Bill agreed via PM that it would be good to move this to a new post…he just doesn’t know how and I really have never tried to move one of mine so not sure how to either??

Done. Next time make a new thread and delete the old post, and agree to move the reply over too. Splitting threads is mod/staff territory.

Thanks, Alan.

No problem: feel free to change the title and/or add tags. Hope you find and share the solution.

Ran my old script. Thought it worked okay, but then noticed this message at bottom:

CPack Error: Error when generating package: darktable
make: *** [Makefile:146: package] Error 1

I have this:


Haven’t tried to install it. Also, this is without the Jens-Hanno Schwalm branch. Don’t know what and where to add.

My build sequence:


cd ..

Bill Martz@DESKTOP-U6S1FBL MINGW64 /**home**

git clone

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home

cd darktable

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home/**darktable**

git submodule init

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home/**darktable**

git submodule update

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home/**darktable**

mkdir build

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home/**darktable**

cd build

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home/darktable/**build**

cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/darktable ../.

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home/darktable/**build**

cmake --build .

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home/darktable/**build**

cmake --build . --target package

Bill Martz@DESKTOP-U6S1FBL MINGW64 /home/darktable/**build**

Remember to code-quote with ```. :wink:

I don’t think that worked right.


This is just text

That will render as:

This is just text

Or add 4 spaces at the beginning of each line.

1 Like

Did you delete your whole build directory?? You shouldn’t need to keep cloning so not sure if that is something you keep doing…

Just do the pull and the submodule stuff and then you should be able to build…

Worst case you can delete your whole darktable directory and then re clone and start from scratch…

Maybe you have tried some of this??

Also is there any issue with that space in your username not being parsed correctly…

I deleted the contents of


Why it builds in Bill Martz I don’t know.

That is where it opens…not in home but in the user folder in home. That is where you are running commands from in msys2 when you build…

I don’t understand the code; it was just copied from the instructions I found online.

I built many times using that code, and dt seemed to work fine when I installed it.

When you say “do the pull” I don’t know what you are referring to. This?

git submodule init

Do I need to install the latest version of MSYS2?

git pull is a command to get the latest changes from the shared repository (e.g., github) into your local copy. So you don’t have to clone everything every day.
This is how I build my darktable from the master branch (once I have it checked out and the submodules initialised):

cd ~/darktable

git clean -d -f -x

git pull --rebase
git submodule update

rm -rf /home/kofa/darktable-master
./ --prefix /home/kofa/darktable-master --build-type Release --install
rm -rf ~/.cache/darktable/cached_kernels*

I switch to directory holding the cloned repo (this is the so-called local workspace)
I clean the local workspace (removing temporary files produced during the previous build);
I update (pull) darktable as well as the submodules;
I remove currently installed version from /home/kofa/darktable-master
I build the new version and install it to /home/kofa/darktable-master
I remove the cached kernels, so when I start darktable, I cannot run into old versions of OpenCL code.

Here’s all the error messages I found:

– Looking for aligned_alloc
– Looking for aligned_alloc - not found
– Looking for posix_memalign
– Looking for posix_memalign - not found
CMake Warning at src/CMakeLists.txt:337 (find_package):
Could not find a configuration file for package “OpenEXR” that is
compatible with requested version “3.0”.

The following configuration files were considered but not accepted:

C:/msys64/mingw64/lib/cmake/OpenEXR/OpenEXRConfig.cmake, version: 2.5.7

Several messages like this:
[ 1%] Building da locale
311 translated messages, 1166 fuzzy translations, 1578 untranslated messages.
4616 translated messages.
3056 translated messages.
1923 translated messages, 524 fuzzy translations, 608 untranslated messages.
Then, at end:
CPack: - Install component: DTApplication
CMake Error at C:/msys64/home/darktable/build/bin/cmake_install.cmake:1025 (file):
file INSTALL cannot find
“C:/msys64/mingw64/bin/…/lib/GraphicsMagick-1.3.36/modules-Q16/coders”: No
Call Stack (most recent call first):
C:/msys64/home/darktable/build/cmake_install.cmake:43 (include)

CPack Error: Error when generating package: darktable
make: *** [Makefile:146: package] Error 1

When I start mingw64 the code window opens at this location:


So then I would switch to this darktable directory?


I see no output to diagnose in this post?

As an addition: Some things got prepared to switch to using different runtimes / libraries in building the Windows version. I don’t know if that is merged yet or not. That also means that the documentation ‘is about to change’ or ‘has just changed’.

All I know is I’ve updated my mingw64 setup a couple of days ago and did a fresh build of R-Darktable (3.9 based I guess) which worked fine.

oh… I had that one time. I just created the empty directory and tried again and it worked. (GraphicsMagick I really don’t care about).