Windows build of R&Darktable....

I wonder if there’s someone feeling sane enough to help a completely noob building this.

Trigger warning: I’ve never done anything like this before.

I got this msys64 stuff and did all the preparation from here.

Building and running DT works fine. I then cleaned the msys64 folder from the DT stuff and tried R&DT.

What I did:

git clone https://github.com/aurelienpierre/R-Darktable.git
cd r-darktable
git checkout dev
git submodule init
git submodule update
./build.sh

What I got:

[ 65%] Linking C shared module libmap_settings.dll
[ 65%] Linking C shared module liblocation.dll
[ 65%] Linking C shared module libgamepad.dll
[ 65%] Building C object lib/darktable/plugins/CMakeFiles/highpass.dir/introspection_highpass.c.obj
[ 65%] Built target image_infos
Detaching debug infos for midi.
[ 65%] Generating introspection_lowpass.c
[ 65%] Built target global_toolbox
Detaching debug infos for map_settings.
Detaching debug infos for location.
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/ucrt64/lib/libSDL2main.a(SDL_windows_main.c.obj):(.text+0x152): undefined reference to `SDL_main'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [lib/darktable/plugins/lighttable/CMakeFiles/gamepad.dir/build.make:223: lib/darktable/plugins/lighttable/libgamepad.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:3655: lib/darktable/plugins/lighttable/CMakeFiles/gamepad.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 65%] Linking C shared module libmap_locations.dll
[ 65%] Generating introspection_shadhi.c
[ 65%] Built target midi
[ 65%] Built target map_settings
[ 65%] Built target location
[ 65%] Building C object lib/darktable/plugins/CMakeFiles/lowpass.dir/introspection_lowpass.c.obj
Detaching debug infos for map_locations.
[ 65%] Linking C shared module libgeotagging.dll
[ 65%] Building C object lib/darktable/plugins/CMakeFiles/shadhi.dir/introspection_shadhi.c.obj
[ 65%] Built target map_locations
Detaching debug infos for geotagging.
[ 65%] Linking C shared module librawprepare.dll
[ 66%] Linking C shared module libsoften.dll
[ 66%] Built target geotagging
Detaching debug infos for rawprepare.
Detaching debug infos for soften.
[ 66%] Linking C shared module libbloom.dll
[ 66%] Built target rawprepare
[ 66%] Built target soften
[ 66%] Linking C shared module libhighpass.dll
Detaching debug infos for bloom.
Detaching debug infos for highpass.
[ 66%] Built target bloom
[ 66%] Built target highpass
[ 66%] Linking C shared module liblowpass.dll
Detaching debug infos for lowpass.
[ 66%] Linking C shared module libshadhi.dll
[ 66%] Built target lowpass
Detaching debug infos for shadhi.
[ 66%] Built target shadhi
make: *** [Makefile:156: all] Error 2

I just found out that others used to have this SDL_main error too with DT, but building continued nevertheless. Is there anything obvious I’m doing wrong? Trying with master (just leaving out git checkout dev, because already in master as far as I understand) leads to the same result.

You need to file an issue in rdarktable GitHub for AP to fix this or do the PR in rdarktable. Kmilos fixed this issue on darktable because that SDL dependency changed something upstream (i don’t recall the details).

Correct me if wrong , but those build instructions are for UCRT builds , while r-darktable never moved 9ver from mingw64, AFAIK.

I never installed the UCRT libraries in my msys environment and i can build r-darktable and latest dt-master just fine.

Other than some culling and some minor changes not much has been done with R-
Darktable yet has it??

Mostly feature removal for now I think. I’m not really paying it much attention.

I tried the same in the mingw64 terminal. I installed all the stuff described in the DT instructions by leaving out the “ucrt64” in the commands. The result is the same. :man_shrugging:

I check for activity from time to time just out of curiosity…but I think AP took some time away as he should in the summer for some downtime and other pursuits

They shouldn’t be removed, but they should be replaced by what was there before (an older version of the document).

Not beginner friendly advice, i know. And i might even be wrong. But I’m away from a computer for a while to be more specific.

Found a snapshot of the manual on archive org from 01/2021.

    From MSYS2 terminal, install x64 developer tools and x86_64 toolchain and git from the MSYS2 prompt:
	$ pacman -S base-devel
	$ pacman -S mingw-w64-x86_64-{toolchain,cmake,nsis}
	$ pacman -S git

    Install required libraries and dependencies:
	$ pacman -S mingw-w64-x86_64-{exiv2,lcms2,lensfun,dbus-glib,openexr,sqlite3,libxslt,libsoup,libavif,libwebp,libsecret,lua,graphicsmagick,openjpeg2,gtk3,pugixml,libexif,osm-gps-map,libgphoto2,flickcurl,drmingw,gettext,python3,iso-codes,python3-jsonschema,python3-setuptools}

    Install optional libraries and dependencies:
  $ pacman -S mingw-w64-x86_64-gmic

But there also seem to be a few extra-steps. I will try this later.

build2021.txt (12.3 KB)

Update: No luck :man_shrugging: So, no R&DT for me for now.

These are the latest instructions… I’ll try this afternoon if I get time. At this point I don’t think there is too much in it…some things removed and some new filmic default settings…maybe a few other things and it’s not lightning speeds faster than DT at this point at least when I tested it a while. back

This needs to happen.

I think you can still build if you do NOT install these:

for NG input with midi or gamepad devices

pacman -S --needed mingw-w64-ucrt-x86_64-{portmidi,SDL2}

The problem has nothing to do with mign or UCRT from what I remember. Check the last few closed PR in the darktable to see the fix.

ATM the darkroom interface is certainly more responsive in darktable due to significant gain in the picelpipe cache. Also some pipeline issues related to previews have been fixed.

1 Like

I didn’t mean to ignore you. I just wanted to be sure that the fault isn’t on my side. I still wonder if the SDL stuff is the reason for the building process to stop, since others were still able to build with this error. Of course it needs to be fixed nonetheless.

Don’t know if I can remove these. Trying it gives me errors about breaking dependencies.

I tried these first. I also linked them in my first post.

I just built it without any issues and using the UCRT method and build setup…

Did it on Win 11

Only had to change the build line in the command line to R-Darktable… any chance you forgot??

Cloned it
GIt pull to confirm upto date
Git submodule init
Git submodule update
then
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/R-Darktable …
cmake --build .
cmake --build . --target package

Installed the exe into ProgramFiles\R-Darktable and ran it with a --configdir set to \RDT-config so it has its own config dir separate from DT… seems to run fine…

Would these fixes handle something like this…

I was just opening an image to test my build of R-Darktable before posting…Used this playraw image

Its a Fuji…it has a really strong color issue on the chest… Max settings of the CA module seem to help to remove it but the interesting thing is the difference in the preview… up to 60 you see it the second you scroll closer to 100 it goes away and this is as expected what the import shows…

With Basic development in R-DT


WIth CA maxed out guided by green

Zoomed at 60 No CA enabled


Zoomed at 68… ie one more scroll wheel click

60% With CA

68% with CA

Definitely seems to shift visually as to the preview at > 60% for this image… I will go and check how it behaves in the latest DT…

EDIT
Latest master in DT seems to do the same thing with this image on my hardware…OPENCL on or off… Any further discussion would Hijack the thread so I was just curious no need for any further discussion from my end

Try to have the module expanded. Same problem?

No issue I don’t think with the module in fact most of it is display artifact…see the attached video clip…one scroll wheel turn towards higher magnification removes most of it and then the residual color can be muted by the CA module but then not that scrolling back out the display reverts but a bit muted by the CA adjustment. The exported file looks like the magnified one but if people don’t routinely zoom in I guess they could be fooled… I tried Open cl on and off and all of the various scaling methods in preferences…no pattern emerged from that… could just be an anomaly…

Exactly your steps.

[567/879] Linking C shared module lib\darktable\plugins\lighttable\libmidi.dll
[568/879] Linking C shared module lib\darktable\plugins\lighttable\liblocation.dll
[569/879] Linking C shared module lib\darktable\plugins\lighttable\libglobal_toolbox.dll
[570/879] Building C object lib/darktable/plugins/CMakeFiles/soften.dir/introspection_soften.c.obj
[571/879] Linking C shared module lib\darktable\plugins\lighttable\libgamepad.dll
FAILED: lib/darktable/plugins/lighttable/libgamepad.dll
cmd.exe /C "cd . && C:\msys64\ucrt64\bin\cc.exe -Wall -Wno-format -Wshadow -Wtype-limits -Wvla -Wold-style-declaration -Wno-unknown-pragmas -Wno-error=varargs -Wno-format-truncation -Wno-error=address-of-packed-member -std=c99 -fopenmp -march=native -msse2 -g -mfpmath=sse -O3 -DNDEBUG -O3 -ffast-math -fno-finite-math-only -fexpensive-optimizations  -Wl,--enable-runtime-pseudo-reloc   -Wl,--undefined=WinMain -shared -o lib\darktable\plugins\lighttable\libgamepad.dll -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\gamepad.rsp  && cmd.exe /C "cd /D C:\msys64\home\monodominator\R-Darktable\build\lib\darktable\plugins\lighttable && C:\msys64\ucrt64\bin\cmake.exe -E make_directory .debug && objcopy --only-keep-debug C:/msys64/home/monodominator/R-Darktable/build/lib/darktable/plugins/lighttable/libgamepad.dll C:/msys64/home/monodominator/R-Darktable/build/lib/darktable/plugins/lighttable/libgamepad.dll.dbg && objcopy --strip-debug C:/msys64/home/monodominator/R-Darktable/build/lib/darktable/plugins/lighttable/libgamepad.dll && objcopy --add-gnu-debuglink=libgamepad.dll.dbg C:/msys64/home/monodominator/R-Darktable/build/lib/darktable/plugins/lighttable/libgamepad.dll""
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/ucrt64/lib/libSDL2main.a(SDL_windows_main.c.obj):(.text+0x152): undefined reference to `SDL_main'
collect2.exe: error: ld returned 1 exit status
[572/879] Generating introspection_tonemap.cc
[573/879] Generating introspection_shadhi.c
[574/879] Linking C shared module lib\darktable\plugins\lighttable\libmap_locations.dll
[575/879] Building C object lib/darktable/plugins/lighttable/CMakeFiles/geotagging.dir/geotagging.c.obj
[576/879] Generating introspection_gamma.c
[577/879] Building C object lib/darktable/plugins/CMakeFiles/bloom.dir/introspection_bloom.c.obj
[578/879] Building C object lib/darktable/plugins/CMakeFiles/highpass.dir/introspection_highpass.c.obj
[579/879] Generating introspection_colorreconstruction.c
[580/879] Generating introspection_colisa.c
[581/879] Linking C shared module lib\darktable\plugins\libsoften.dll
[582/879] Building C object lib/darktable/plugins/CMakeFiles/lowpass.dir/introspection_lowpass.c.obj
[583/879] Generating introspection_tonecurve.c
[584/879] Building C object lib/darktable/plugins/CMakeFiles/rawprepare.dir/introspection_rawprepare.c.obj
ninja: build stopped: subcommand failed.

Maybe my SDL stuff is newer, since it looks that this bug came up about 2 weeks ago?

When installing mine… I say that as I recently upgraded everything from scratch…but likely more like a month ago…I had a couple of errors that were holding me up… @wpferguson pointed me in the right direction… I will try to find that old post and his advice…it was around setting environment variables I believe…

EDIT: It was this for me…once I had it corrected there were no errors and things proceed fine… it may not be the fix for you but you could check…

Seems good as I understand Bill.

$ env | grep XDG
XDG_DATA_DIRS=/ucrt64/share/:/usr/local/share/:/usr/share/

So be it :man_shrugging:

I thank you all for your time to look into it. For my part I think it’s not worth it to dig any deeper since I don’t have much motivation to fiddle around more than necessary myself. I @ AP in Todds Query any Windows users… issue at R&DT github about that SDL stuff. Maybe I will try again when this is fixed.