Darktable windows build help needed

(weyland) #1

I wanted to restart some test on lightroom.c import module (to import some more metadata: Pull request #1675).
I’ve followed the build.txt document, option A.
Unfortunately the last version of lensfun breaks the process (see redmine bug #12200) for deprecated functions.
Is there a way to use a former version of lensfun ? How ?
Or maybe to avoid lensfun usage ?

Help with compiling and Lensfun

Currently Virtualbox is broken in Debian. As soon as I am able to try I will have a look.

(weyland) #3

Thanks Houz, I’m looking forward to reading you,


I experience the same problem. Find the log attached. build error.txt (21.8 KB)


I think Alexey went ahead too quickly… The current lensfun version in MSYS2 is 0.39.5, which is an alpha version of lensfun, probably should have waited a bit.

Anyhow, you can roll back to an earlier version of a package anytime with:
pacman -U /var/cache/pacman/pkg/packagename-old_version.pkg.tar.xz

And if you want also can set in /etc/pacman.conf to ignore the updates for a specific package

I guess that solves your immediate problem, but on the other side we should also think about how to replace the (to-be) deprecated lensfun calls.


Fixing the cmake part is easy, replace version_1 with version_2. But the lens.c part is harder.

(weyland) #7

Thanks @Peterbud,
The previous lensfun version I’ve found is 0.3.2-4.
After having downloaded it and run the command:
$ pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-lensfun-0.3.2-4-any.pkg.tar.xz
the first cmake has passed.
But on $ cmake --build . --target install I get this error:

CMake Error at src/cmake_install.cmake:149 (file):
file INSTALL cannot find

I’ll replay the previous cmake(s) and the full procedure if necessary to see if I can find the cause.
About your second suggestion, I’ve to put in pacman.conf:
IgnorePkg =mingw-w64-x86_64-lensfun
Is that correct ?


What you did is correct.

For the specific error with graphicsmagick I have submitted a PR 3 month ago, but has been never merged (I really don’t know why).

You can check and apply it I believe :



Because the relevant part for compiling was committed already.


This sucks. I wanted to do a new dt release this weekend, but having a broken lensfun means that we won’t have a Windows build.

(weyland) #11

I’ve updated the darktable (with the last merge), overwritten lightroom.c modified and compiled again.
I’ve got a working dt ! :slight_smile: Thanks for your help !
The normal lightroom import features work but I don’t see the effects of my changes yet.
I’ll work on this and probably come back here to get some more support.
I see 2 main difficulties for the time being:

  • where have I to restart the cmake process once I’ve modified the source file (lightroom.c) and maybe avoid to redo everything ?
  • how to make the log work ? At least to see the existing log messages. That would be the best way for me to try to understand what does happen (or not).
    Edit: I see some logs in the log file, but none which could correspond to those in lightroom.c. Is there something like -d lua to activate them ?


When just changing source files you shouldn’t run cmake again. Just call make. That’s the whole point of having a build system.

What do you use in the code for logging? During development I’d just use printf(). In order to see the result you should run darktable from the mingw64 shell you compiled it in. The cmd.exe coming with Windows is crap.

(weyland) #13

Sorry for this late answer, I’ve been off for a while.

I thought that dt_control_log() was the routine to call and the file C:\Users\[username]\AppData\Local\Microsoft\Windows\INetCache\darktable\darktable-log.txt the place to look at messages.

I’ll make a try with this. Thanks.

(weyland) #14

Thank you for your support. I’ve been able to test and fix the lightroom.c issues.

For those who start like myself: to see the traces (without leaving dt) I had to add this line:
setvbuf(stdout, NULL, _IONBF, 0);
to avoid buffering.

(Ingo Weyrich) #15
setbuf(stdout, NULL);

may do that as well

Edit: for reference: https://github.com/Beep6581/RawTherapee/commit/eab748343199252692622e1a4f3f3b3e356cc182