Rawtherapee: Update RawPedia with lensfun info

Created on 13 Sep 2017  路  58Comments  路  Source: Beep6581/RawTherapee

  1. Add a section which explains what it is and how to use it. Any recommendations for what to write?
  2. Update the compilation pages:

    • [x] Linux

    • [x] macOS

    • [x] Windows

RawPedia

All 58 comments

Any recommendations for what to write?

Leave it on "auto-matching" and be happy with that. If your camera/lens combo
is supported but not autodetected, use manual matching (and consider using a
dynamic profile rule to turn this into a "custom auto-matching").

This is unless you have a high-quality LCP profile that you are happy with. In
that case, no need to switch.

Update the compilation pages:

  • Linux

For Ubuntu and derivatives (and Debian, I suppose):

$ sudo apt install liblensfun-dev

For windows 64 when using the lensfun MSYS2 version:
1- In" Install tools and libraries"/ "required libraries" add:
pacman -S mingw-w64-x86_64-lensfun

2- to the dll list, add:

liblensfun.dll
libtre-5.dll
libsystre-0.dll

3- to "The following files also need to be copied", add:
<prefix>\share\lensfun\version_1\* -> .\share\lensfun

I updated the instructions to build on Arch

@gaaned92 I updated the windows build instructions. Could be please check?

I'm going to update the Linux page, but I'll leave out a couple of distros as I'm not sure about them. I'll let you know when done

updated general table of dependencies and instructions for Fedora and Ubuntu. For other distros I need help :-)

@heckflosse I think it's ok. thanks

For Ubuntu and derivatives (and Debian, I suppose):

$ sudo apt install liblensfun-dev

On Debian 9.1 I used basically the same:

sudo apt-get install liblensfun-dev

On macintosh, dev compiles and bundles liblensfun (currently 3.2) fine with this command: sudo port install lensfun

I am now getting this error at launch, however.

terminating with uncaught exception of type Glib::ConvertError

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff9931ad42 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff99408457 pthread_kill + 90
2   libsystem_c.dylib               0x00007fff99280420 abort + 129
3   libc++abi.dylib                 0x00007fff97dd894a abort_message + 266
4   libc++abi.dylib                 0x00007fff97dfdc2f default_terminate_handler() + 267
5   libobjc.A.dylib                 0x00007fff9890d353 _objc_terminate() + 124
6   libc++abi.dylib                 0x00007fff97dfad49 std::__terminate(void (*)()) + 8
7   libc++abi.dylib                 0x00007fff97dfa7be __cxa_throw + 121
8   libglibmm-2.4.1.dylib           0x0000000109884898 Glib::ConvertError::throw_func(_GError*) + 56
9   libglibmm-2.4.1.dylib           0x000000010989aff2 Glib::Error::throw_exception(_GError*) + 354
10  libglibmm-2.4.1.dylib           0x00000001098aab95 Glib::operator<<(std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >&, Glib::ustring const&) + 149
11  rawtherapee-bin                 0x0000000108ee18dc Glib::ustring Glib::ustring::compose<char*, char*>(Glib::ustring const&, char* const&, char* const&) + 92
12  rawtherapee-bin                 0x0000000108ee183e rtengine::LFLens::getLens() const + 62
13  rawtherapee-bin                 0x0000000108af32ab LensProfilePanel::LensProfilePanel() + 3867
14  rawtherapee-bin                 0x0000000108be08fe ToolPanelCoordinator::ToolPanelCoordinator() + 20382
15  rawtherapee-bin                 0x00000001089d25f9 BatchToolPanelCoordinator::BatchToolPanelCoordinator(FilePanel*) + 25
16  rawtherapee-bin                 0x0000000108aa566a FilePanel::FilePanel() + 6874
17  rawtherapee-bin                 0x0000000108baa7db RTWindow::RTWindow() + 4107
18  rawtherapee-bin                 0x0000000108afaae8 (anonymous namespace)::create_rt_window() + 3384
19  rawtherapee-bin                 0x0000000108af911f main + 4655
20  libdyld.dylib                   0x00007fff991ec235 start + 1

@Benitoite Could you please test this patch?

diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc
index 87a7272e..b42be942 100644
--- a/rtengine/rtlensfun.cc
+++ b/rtengine/rtlensfun.cc
@@ -175,7 +175,7 @@ float LFCamera::getCropFactor() const
 Glib::ustring LFCamera::getDisplayString() const
 {
     if (data_) {
-        return Glib::ustring::compose("%1 %2", getMake(), getModel());
+        return getMake() + ' ' + getModel();
     } else {
         return "---";
     }
@@ -211,7 +211,7 @@ Glib::ustring LFLens::getMake() const
 Glib::ustring LFLens::getLens() const
 {
     if (data_) {
-        return Glib::ustring::compose("%1 %2", data_->Maker, data_->Model);
+        return Glib::ustring(data_->Maker) + ' ' + data_->Model;
     } else {
         return "---";
     }

Patch worked! @Floessie

@Benitoite great! But, @Floessie, why does it work? Or better, why was the previous code wrong?

I also wondered about @Floessie 's miracles

BTW, @Floessie will you commit this yourself?

Great!!!! Thank you!

I have compiled it for Linux, installing lensfun from source before checking out rawtherapee (if you need instruction i can provide them).

Works really well, but i'm unable to select ca aberration correction, seems like the button isn't selectable.

@falket CA correction is not supported at the moment -- and it's not on my TODO list at the moment. RT has "auto CA correction" for raws, which works really well in my experience.

@agriggio @heckflosse

But, @Floessie, why does it work? Or better, why was the previous code wrong?

I don't think it's wrong in the first place. But there's this line

Glib::operator<<(std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >&, Glib::ustring const&) + 149

which is telling me, there's a char to wchar_t conversion on the path (for whatever reason), and this usually means conversion through a locale, and this might fail, because of the special way, the lensfun strings are constructed. From the backtrace you can see, it choked on Glib::ustring::compose("%1 %2", data_->Maker, data_->Model); which takes the raw pointers. There might be a bug in Glib::ustring::compose() somewhere.

Simply appending (Glib::ustring|std)::strings won't invoke any locale conversion, and that solved it, as I suspected.

I also wondered about @Floessie 's miracles

Wait, I'm just the medico, you're the wizard. 馃榿

To be honest, it was just a wild guess based on the wchar_t line. No magic included, sorry.

Glad it helped,
Fl枚ssie

PS: @agriggio Alberto, please commit it, as I'll be only able to do so ten hours from now.

@Floessie excellent analysis, thanks a lot! :+1:

@agriggio Thank you for the explanation, i didn't know. Yes CA autocorrection works fine, but unfortunatly isn't working with xtrans sensors.

@heckflosse
For windows 64 build in rawpedia, please
1) modify cmake command:
$ cmake -G "MSYS Makefiles" -DLENSFUNDBDIR=share/lensfun -DCMAKE_BUILD_TYPE="release" -DPROC_TARGET_NUMBER="2" -DCACHE_NAME_SUFFIX="5-dev" ..
2)add explanation:
-DLENSFUNDBDIR=share/lensfun permits to locate lensfun data base in .\sharelensfun

@gaaned92 done

I compiled into an empty build folder, deleted the cache and options file and deleted amsterdam.pef.*, i.e. no PP3 files.

My lensfun DB is in /usr/share/lensfun/version_1/

@agriggio I have some questions:

  1. When RawTherapee is compiled using -DBUILD_BUNDLE="ON" and LENSFUNDBDIR is not manually set during cmake, should the build find and use the system lensfun library? It does not, my comboboxes are empty though I see this during cmake:
    "-- Performing Test LENSFUN_HAS_LOAD_DIRECTORY - Success".
  2. Does LENSFUNDBDIR need to be set to anything when using system lensfun? i.e. Is the LENSFUNDBDIR setting mandatory?
  3. The Linux article in RawPedia sets -DLENSFUNDBDIR to .\share\lensfun (probably a typo - should be forward slashes, no?) while the Windows article shows share/lensfun (no .\, and forward slashes - doesn't Windows use backslashes?). Which is right?
  4. How to get RT to find the system lensfun DB and to have the comboboxes populates with cameras and lenses without manually editing the options file?

I set -DLENSFUNDBDIR=".\share\lensfun" as shown in the Linux article, and get parsing errors during compilation https://gist.github.com/Beep6581/ca9a5ca67721afaa33d860655548766d

Maybe it was me who used \ instead of / for rawpedia :-(

No worries @heckflosse I'll fix it once I figure it out.

  1. Should the path in the LENSFUNDBDIR CMake option be relative or absolute when specifying a custom lensfun DB?

I set -DLENSFUNDBDIR="", the result is
DBDirectory=/home/morgan/programs/code-rawtherapee/build/release/./
Comboboxes empty. I have to set DBDirectory= to make the comboboxes populated.

@agriggio I'm releasing 5.3-rc1 now, but we will need to fix this for 5.3 final.

@Beep6581 @agriggio
in windows, as you build under Msys2 with bash, you use slashes. Building with
-DLENSFUNDBDIR=share/lensfun is ok to define .\sharelensfun as default directory.

if you don't set LENSFUNDBDIR, lensfun uses its default search algorithm to locate the database. if not found, it is a bug, but not necessarily on our side. please provide as much info as possible, thanks!

@agriggio
I've installed media-libs/lensfun-0.3.2 system-wide, /usr/share/lensfun/version_1/ contains all the xml files. I compile using

cmake -DWITH_LTO="OFF" -DCMAKE_BUILD_TYPE="${buildType}" -DPROC_TARGET_NUMBER="2" -DBUILD_BUNDLE="ON" -DCACHE_NAME_SUFFIX="" -DCMAKE_INSTALL_PREFIX="/home/morgan/programs/rawtherapee" .. && make -j3 install

CMake output:

-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_BUILD_TYPE: release
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'gtk+-3.0>=3.16'
--   Found gtk+-3.0, version 3.22.16
-- Checking for module 'glib-2.0>=2.44'
--   Found glib-2.0, version 2.52.3
-- Checking for module 'glibmm-2.4>=2.44'
--   Found glibmm-2.4, version 2.50.1
-- Checking for module 'gtkmm-3.0>=3.16'
--   Found gtkmm-3.0, version 3.22.1
-- Checking for module 'cairomm-1.0'
--   Found cairomm-1.0, version 1.12.0
-- Checking for module 'gio-2.0>=2.44'
--   Found gio-2.0, version 2.52.3
-- Checking for module 'giomm-2.4>=2.44'
--   Found giomm-2.4, version 2.50.1
-- Checking for module 'gthread-2.0>=2.44'
--   Found gthread-2.0, version 2.52.3
-- Checking for module 'gobject-2.0>=2.44'
--   Found gobject-2.0, version 2.52.3
-- Checking for module 'sigc++-2.0>=2.3.1'
--   Found sigc++-2.0, version 2.10.0
-- Checking for module 'lensfun>=0.2'
--   Found lensfun, version 0.3.2.0
-- Checking for module 'lcms2>=2.6'
--   Found lcms2, version 2.8
-- Checking for module 'expat>=2.1'
--   Found expat, version 2.2.1
-- Checking for module 'fftw3f'
--   Found fftw3f, version 3.3.4
-- Checking for module 'libiptcdata'
--   Found libiptcdata, version 1.0.4
-- Found JPEG: /usr/lib64/libjpeg.so  
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.32+apng") 
-- Found TIFF: /usr/lib64/libtiff.so (found version "4.0.8") 
-- Checking for module 'libcanberra-gtk3'
--   Found libcanberra-gtk3, version 0.30
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenMP.cmake:179 (if):
  if given arguments:

    "TRUE"

  An argument named "TRUE" appears in a conditional statement.  Policy
  CMP0012 is not set: if() recognizes numbers and boolean constants.  Run
  "cmake --help-policy CMP0012" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindOpenMP.cmake:224 (_OPENMP_GET_SPEC_DATE)
  CMakeLists.txt:333 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenMP.cmake:179 (if):
  if given arguments:

    "TRUE"

  An argument named "TRUE" appears in a conditional statement.  Policy
  CMP0012 is not set: if() recognizes numbers and boolean constants.  Run
  "cmake --help-policy CMP0012" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindOpenMP.cmake:266 (_OPENMP_GET_SPEC_DATE)
  CMakeLists.txt:333 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenMP: -fopenmp  
-- Performing Test LENSFUN_HAS_LOAD_DIRECTORY
-- Performing Test LENSFUN_HAS_LOAD_DIRECTORY - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/morgan/programs/code-rawtherapee/build
Scanning dependencies of target UpdateInfo
[  0%] Creating AboutThisBuild.txt and other version-dependent files
-- git command found: /usr/bin/git
-- Git checkout information:
--      Commit description:     5.3-rc1
--      Branch:                 releases
--      Commit:                 1494cdf5
--      Commit date:            2017-09-25
--      Commits since tag:      0
--      Commits since branch:   0
--      Version (unreliable):   5.3.0
-- CACHE_NAME_SUFFIX is ""
[  0%] Built target UpdateInfo
Scanning dependencies of target rtexif
[  0%] Building CXX object rtexif/CMakeFiles/rtexif.dir/nikonattribs.cc.o
[  1%] Building CXX object rtexif/CMakeFiles/rtexif.dir/rtexif.cc.o
[  1%] Building CXX object rtexif/CMakeFiles/rtexif.dir/stdattribs.cc.o
(...)

After deleting the options file and running RT, it contains:
DBDirectory=/home/morgan/programs/code-rawtherapee/build/release

The lensfun camera and lens comboboxes are empty.

If I then close RT, edit the options file and change it to
DBDirectory=
then the comboboxes are populated.

Version: 5.3-rc1
Branch: releases
Commit: 1494cdf5
Commit date: 2017-09-25
Compiler: cc 4.9.3
Processor: Intel(R)\ Core(TM)\ m3-6Y30\ CPU\ @\ 0.90GHz
System: Linux
Bit depth: 64 bits
Gtkmm: V3.22.1
Lensfun: V0.3.2.0
Build type: release
Build flags:  -std=c++11 -march=native -Werror=unused-label -fopenmp -Werror=unknown-pragmas -Wall -Wno-unused-result -Wno-deprecated-declarations -O3 -DNDEBUG
Link flags:  -march=native
OpenMP support: ON
MMAP support: ON

GCC-4.9.3, cmake-3.7.2, lensfun-0.3.2

The assumption is that when RT is compiled and lensfun is installed it should "just work" when starting with no options file - currently it does not as I have to manually edit the options file. So to test, simply delete your options file, compile RT, run RT, and see if the comboboxes are populated. I tested in Sabayon Linux. @heckflosse reproduced as well, though I did not ask which OS.

Let me know if there's any more info I can provide.

@Beep6581 your info is good, thanks! I'll have a look asap

@Beep6581 can you try this patch?

diff --git a/rtgui/main.cc b/rtgui/main.cc
--- a/rtgui/main.cc
+++ b/rtgui/main.cc
@@ -529,7 +529,7 @@
         licensePath = Glib::build_filename (exePath, LICENCE_SEARCH_PATH);
     }

-    if (Glib::path_is_absolute (LENSFUN_DB_PATH)) {
+    if (strlen(LENSFUN_DB_PATH) == 0 || Glib::path_is_absolute (LENSFUN_DB_PATH)) {
         options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;
     } else {
         options.rtSettings.lensfunDbDirectory = Glib::build_filename (exePath, LENSFUN_DB_PATH);

@agriggio tested without setting -DLENSFUNDBDIR during compilation, it works! Now lensfun in RT works out of the box on a "clean" system.

If you confirm, I will update RawPedia with the following:

  • Lensfun is required as of 5.3.
  • To use the system lensfun DB, do not set -DLENSFUNDBDIR
  • To use a custom lensfun DB, set -DLENSFUNDBDIR=/absolute/path/to/lensfun @agriggio is a relative path allowed? Relative to what?

@Beep6581 great, I've just pushed the patch. Regarding your last question, LENSFUNDBDIR can be relative; in that case:

  • if BUILD_BUNDLE is set, it is relative to the bundle top directory
  • otherwise, it is relative to DATADIR, i.e. "${CMAKE_INSTALL_PREFIX}/share/rawtherapee"

However, I suggest to use a relative LENSFUNDBDIR only when building bundles

@agriggio
With 5.3-RC1 patched, using a relative path for DB, I notice that when the lensfun paragraph in option file is absent, the lensfun path is filled with an absolute path.
So when you install a new version it cannot work.(e.g. 5.3 after 5.3-RC1)
a relative path or empty field seems mandatory with bundle builds.

@Beep6581 I think you should differentiate bundle builds and unbundle builds (mainly windows, apple versus Linux). On windows, there is not such thing as a system lensfun DB. Each app install somewhere its own DB compatible with the lensfun version used.

I just compiled lenfun from source on Windows (in MSYS2). Interestingly, it installed the database in C:/ProgramData/lensfun/version_1. Which means that it becomes a somewhat system-wide install of the database, even if the dll's are installed in /mingw64/bin.
I'm building an RT bundle right now, trying to get this up-to-date lensfun binary/database included in the installer.

With 5.3-RC1 patched, using a relative path for DB, I notice that when the lensfun paragraph in option file is absent, the lensfun path is filled with an absolute path.
So when you install a new version it cannot work.(e.g. 5.3 after 5.3-RC1)

Oh, ok, now I think I understand. I'll work on a fix.

a relative path or empty field seems mandatory with bundle builds.

I'll go for a relative path in options when building a bundle.

@agriggio I agree with @gaaned92 . I don't see how this can work if you are creating a build for deployment. My suggestion is to either create an environment variable for the lensfun database, or default it to expath/share/lensfun/version_1

@Partha1b isn't that what I just wrote above? :wink:

@sguyader what did you built? How you know DB is up to date?Is it version1 or version 2 data?
At build time you can change DB location with -DDATAROOTDIR =what/you/want.

@Partha1b @agriggio
On windows, one of lensfun path search is %localappdata%lensfun.
If I put DB in %appdata%lensfun/version_1 it is not found.
It is why I think it's better to put DB directly in expath/share/lensfun.

@agriggio relative path : yes thank you

@agriggio Ahh, OK if by relative path you mean absolute path relative to expath. 馃槃

@Partha1b yes that's what I meant :smile:

@gaaned92 yes, version_1 is not added automatically. The database is searched in exactly the directory you specify.

Anyway, can you please try this patch? (remember to delete the options file first). If everything works as expected, the entry in options should be a relative dir, and if BUILD_BUNDLE is true, this will be interpreted relative to the bundle directory

EDIT: sorry, the previous version of the patch was buggy. This is the correct one

diff --git a/rtengine/init.cc b/rtengine/init.cc
--- a/rtengine/init.cc
+++ b/rtengine/init.cc
@@ -51,7 +51,11 @@
     Color::init ();
     PerceptualToneCurve::init ();
     RawImageSource::init ();
-    LFDatabase::init(s->lensfunDbDirectory);
+    if (s->lensfunDbDirectory.empty() || Glib::path_is_absolute(s->lensfunDbDirectory)) {
+        LFDatabase::init(s->lensfunDbDirectory);
+    } else {
+        LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbDirectory));
+    }
     delete lcmsMutex;
     lcmsMutex = new MyMutex;
     dfm.init( s->darkFramesPath );
diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc
--- a/rtgui/main-cli.cc
+++ b/rtgui/main-cli.cc
@@ -145,11 +145,7 @@
         licensePath = Glib::build_filename (exePath, LICENCE_SEARCH_PATH);
     }

-    if (Glib::path_is_absolute(LENSFUN_DB_PATH)) {
-        options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;
-    } else {
-        options.rtSettings.lensfunDbDirectory = Glib::build_filename(exePath, LENSFUN_DB_PATH);
-    }
+    options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;

 #else
     argv0 = DATA_SEARCH_PATH;
diff --git a/rtgui/main.cc b/rtgui/main.cc
--- a/rtgui/main.cc
+++ b/rtgui/main.cc
@@ -529,11 +529,7 @@
         licensePath = Glib::build_filename (exePath, LICENCE_SEARCH_PATH);
     }

-    if (strlen(LENSFUN_DB_PATH) == 0 || Glib::path_is_absolute (LENSFUN_DB_PATH)) {
-        options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;
-    } else {
-        options.rtSettings.lensfunDbDirectory = Glib::build_filename (exePath, LENSFUN_DB_PATH);
-    }
+    options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;

 #else
     argv0 = DATA_SEARCH_PATH;

@gaaned92 un order to build lensfun from got source, I pretty much followed the instructions at http://lensfun.sourceforge.net/development/

From the binary install in MSYS2, I get an old database from 2015, which doesn't support my camera (Fuji X-T2) and only partially supports my lenses. The database provided after source compilation actually supports my camera and provides full support of my lenses.

@agriggio the latest patch still works fine here when I test using the cmake parameters I pasted above - -DBUILD_BUNDLE="ON" and no -DLENSFUNDBDIR.

@gaaned92 one more note, despite the database folder being named "version_1", when I look at the xml files within they have a <lensdatabase version="2"> header which is not there in the older version installed from pacman in MSYS.
Edit: the timestamp.txt file says "1506164944".

So here's how I managed to compile lensfun in MSYS2:

  1. Uninstalling the previously installed version lensfun from pacman:
pacman -Rdd mingw-w64-x86_64-lensfun

(I had to use the -Rdd switch because the I have mingw-w64-x86_64-gimpinstalled in this environment, which requires mingw-w64-x86_64-gegl, which in turn requires mingw-w64-x86_64-lensfun.)

  1. Cloning the lensfun code repo:
git clone http://git.code.sf.net/p/lensfun/code lensfun-code
  1. Setup and compilation:
cd lensfun-code
mkdir build
cd build
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw64 -DCMAKE_BUILD_TYPE=Release ../
make
make install

And voil脿, the liblensfun.dll goes into \mingw64\bin, and the database to C:\ProgramData\lensfun\version_1

@sguyader The way lensfun creates the location of the database folder is as follows:
main_dirname = g_build_filename (CONF_DATADIR, DATABASE_SUBDIR, NULL);

The CONF_DATADIR is set to share/lensfun and DATABASE_SUBDIR is set to "version_${LENSFUN_DB_VERSION}" and finally in the CMakeLists.txt, LENSFUN_DB_VERSION is set to 1.

So, it's not relevant what's in the xml file itself but how lenfuns locates the database. 馃槃

@sguyader Thank you. I did the same (it was documented in the lensfun PR). I thought you got a stable release. Instead of you I installed lensfun in a specific installdir and not in MSYS2.
-DCMAKE_INSTALL_PREFIX=/my/own/installdir/
Then in RT build, before calling CMAKE I append the path
PKG_CONFIG_PATH="/my/own/path/lib/pkgconfig:"$PKG_CONFIG_PATH

Those version-2 are not compatible with the old MSYS2 lensfun.

@agriggio patch is ok. permits to execute different builds with own lensfun DB

@agriggio In trying to get a bundled lensfun database on a macOS build... no success in the release candidate as is...so I'm testing the dev branch at this point, since testing my 5.3-rc1 bundle didn't show any cameras or lenses on my clean machine.
Works fine on my build machine, with the data in /opt/local/share/lensfun, but on a clean machine I haven't gotten the data in the right place to be seen by lensfun.
Should I also set -DLENSFUNDBDIR="./share/lensfun" and copy the /opt/local/share/lensfun data folder manually into the package?

Should I also set -DLENSFUNDBDIR="./share/lensfun" and copy the /opt/local/share/lensfun data folder manually into the package?

Yes, exactly. Sorry if that was unclear. to be more precise:

$ mkdir -p /path/to/bundle/share/lensfun
$ cp /opt/local/share/lensfun/version_1/* /path/to/bundle/share/lensfun/

Ok. I still had the version_1 folder in there. Let me try again.

@agriggio Another thing I'm thinking is for mac the executable binary is in a subfolder of the bundle package, so should I set -DLENSFUNDBDIR="../share/lensfun" instead of -DLENSFUNDBDIR="./share/lensfun"

@Benitoite I don't know for sure, but if you run with verbosity on you should see the (absolute) directory searched printed on stdout. hopefully with that you should be able to set the right default (and maybe document the process on rawpedia...)

@agriggio Thanks, I was successful with the double-dot. Here's what I had to do to the macosx_bundle.sh: https://github.com/Beep6581/RawTherapee/pull/4107

@agriggio Zounds! My repackage was not successful on my clean machine... I believe the single dot is correct because its relative to the mac packages Resources directory.
So for mac too we would need to add -DLENSFUNDBDIR="./share/lensfun" to our cmake command to bundle.

I added two sections to the Linux article: BUILD_BUNDLE and LENSFUNDBDIR. Feel free to correct any mistakes.
http://rawpedia.rawtherapee.com/Linux#Compile_RawTherapee

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elecprog picture elecprog  路  5Comments

heckflosse picture heckflosse  路  5Comments

Beep6581 picture Beep6581  路  5Comments

agriggio picture agriggio  路  4Comments

heckflosse picture heckflosse  路  3Comments