Help needed to enable lensfun on Windows build

Following the documentation in Rawpedia I installed MSYS2 on my Windows 10 system and built my own native version of RT, but I’m not having any luck enabling lensfun. I’ve searched for old threads on this, but they either involved another OS or the user had a previous version of lensfun installed and got themselves cross-threaded with the newer version that comes with the RT source code.

Have others had this issue and resolved it recently? Any tips welcome!

My RT version info:

Commit: 8c477ffb8
Commit date: 2021-04-30
Compiler: gcc 10.2.0
Processor: undefined
System: Windows
Bit depth: 64 bits
Gtkmm: V3.24.3
Lensfun: V0.3.2.0
Build type: release
Build flags:  -std=c++11 -march=native -Werror=unused-label -Werror=delete-incomplete -fno-math-errno -Wno-attributes -Wall -Wuninitialized -Wcast-qual -Wno-deprecated-declarations -Wno-unused-result -Wunused-macros -fopenmp -Werror=unknown-pragmas -O3 -DNDEBUG -ftree-vectorize
Link flags:  -march=native
OpenMP support: ON
MMAP support: ON
Build OS: MINGW64_NT-10.0-19042 3.2.0-340.x86_64 x86_64
Build date: Sat, 01 May 2021 01:50:45 +0000 UTC
Build epoch: 1619833845
Build UUID: 41d1bd05-7d60-4e3f-8da

Did you consider this Windows - RawPedia (rawtherapee.com)

Absolutely. Lensfun gets updated successfully when I run that command, but remains a no-show in RT.

Did you pass the -DLENSFUNDBDIR parameter during cmake configuration? Otherwise, run lensfun-update-data from the command line in MSYS2, copy the path to the library, open the options file in your C:/Users/yourname/AppData/Local/RawTherapee folder (maybe with 5-dev suffix), look for the lensfun key and paste the path there.

Does that work?

@tbransco
By default the -DLENSFUNDBDIR parameter locates the lensfun DB in ../share/lensfun, where .. is the directory where your rawtherapee.exe is located
this DB is named version_1 or version_2 depending of lensfun version.
So if you didn’t make a bundled build, I suppose this dir is empty.

Update of lensfun db:

  • first method
    – When doing a lensfun-update-data in a mingw64 shell, an updated DB " version_1" is created in
    C:\msys64\mingw64\var\lib\lensfun-updates
    – You should have to copy it in ..\share\lensfun where .. is the directory where your rawtherapee.exe is located.

  • second method
    – manually create ..\share\lensfun if it doesn’t exist
    – then download dbupdate.zip (2.6 MB) (thanks @ggbutcher)
    – extract the two files alongside rawtherapee.exe
    – double-click on the .bat .It will create or update the lensfun DB version_1 in ../share/lensfun.

Note 1: I will provide some more precision about that once this problem is solved.

Note 2: integrating this lensfun updating function in RT could ease the lensfun DB updating. Sources are available in GitHub.

1 Like

Yes, if one follows the Windows build instructions on RawPedia to the letter, as i did, that parameter is passed to cmake. I’ll come back to your suggestion for a solution if the other options that gaaned92 provides don’t pan out. Thanks.

Thanks for these detailed options, @gaaned92. In my case I had run the lensfun-update-data command during the build as suggested in RawPedia, and it created a version_1 folder at the precise location you described. Once I copied it to the ../share/lensfunfolder though, and fired up RT, the Camera and Lens dropdown menus in Profiled Lens Correction section of the Transform tab remained empty. I then tried your second method, with the same result.

1 Like

Thanks @tbransco for testing.

To be sure how to test, could you confirm that you don’t make bundled build and thus you run rawtherapee from a mingw64 shell?
Doing that, effectively, the lensfun DB is not loaded in rawtherapee whatever I try.

  • While waiting for a solution, you can try one of my windows builds you can download here: RTW64NightlyBuilds/ – Keybase.pub
    As the lensfun version identification is defective, to be sure what I use, I use a local lensfun build in my above rawtherapee builds. The present version I use is v0.3.95-639-gd772cc52 from the github repository.

Which lensfun version is inside Mingw64 cannot be related to any tag or commit in the github repository.

I have to understand why it works in one case and not the other.

Thanks again, @gaaned92. I do run my native build of RT from a mingw64 shell.