Bug 510760 - Could NOT find Eigen3 5.0.0
Summary: Could NOT find Eigen3 5.0.0
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Editor-Sharpen (other bugs)
Version First Reported In: 8.8.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-18 17:51 UTC by nucleo
Modified: 2025-12-25 10:53 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 9.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nucleo 2025-10-18 17:51:13 UTC
SUMMARY
Eigen3 5.0.0 could not be found 

STEPS TO REPRODUCE
1.  Try to compile with eigen3 5.0.0
2. 
3. 

OBSERVED RESULT
-- Eigen3 version .. found in /usr/include/eigen3, but at least version 2.91.0 is required
-- Could NOT find Eigen3 (missing: EIGEN3_VERSION_OK) (Required is at least version "2.91.0")
--  libeigen3 found.......................... NO  (optional)
--  digiKam will be compiled without Refocus tool support.
--  Please install the libeigen3 (version >= 3.0.0) development package.


EXPECTED RESULT
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0")

SOFTWARE/OS VERSIONS
Fedora 44
Comment 1 Maik Qualmann 2025-10-18 19:23:52 UTC
Eigen 5.0.0, released on October 9, 2025, may not yet be compatible with digiKam. Use Eigen 3.4.x.

Maik
Comment 2 Antonio Rojas 2025-10-18 19:54:13 UTC
DigiKam finds Eigen 5 and builds just fine if using Eigen's upstream cmake config, but DigiKam's own FindEigen module (which is not compatible with Eigen 5) gets in the way.

Just rm core/cmake/modules/FindEigen3.cmake and pass -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3 to cmake as a workaround
Comment 3 Robert 2025-11-30 16:21:45 UTC
Currently, Digikam's `../core/cmake/modules/FindEigen3.cmake` has a macro defined ( `_eigen3_check_version` ) which rely on being able to find the following defines:
```
#define EIGEN_WORLD_VERSION 3
#define EIGEN_MAJOR_VERSION 4
#define EIGEN_MINOR_VERSION 1
```
by looking for them in a file from Eigen  project called `../core/cmake/modules/FindEigen3.cmake`.
This used to work for Eigen versions up to and including version 3.4.1.

Starting with version 5 the Eigen project did the sensible thing and adopted semantic versioning, while at same time moving the definitions to a different file `Eigen/Version`:
```
#ifndef EIGEN_VERSION_H
#define EIGEN_VERSION_H

// The "WORLD" version will forever remain "3" for the "Eigen3" library.
#define EIGEN_WORLD_VERSION 3
// As of Eigen3 5.0.0, we have moved to Semantic Versioning (semver.org).
#define EIGEN_MAJOR_VERSION 5
#define EIGEN_MINOR_VERSION 0
#define EIGEN_PATCH_VERSION 1
#define EIGEN_PRERELEASE_VERSION "dev"
#define EIGEN_BUILD_VERSION "master"
#define EIGEN_VERSION_STRING "5.0.1-dev+master"

#endif  // EIGEN_VERSION_H
```

The cmake find module should be amended to parse the definitions from the new file (and possibly as a fallback from the previous file).
Comment 4 Robert 2025-11-30 16:32:09 UTC
Correction:

> Currently, Digikam's `../core/cmake/modules/FindEigen3.cmake` has a macro defined ( `_eigen3_check_version` ) which rely on being able to find the following defines:
> ...
> by looking for them in a file from Eigen  project called `../core/cmake/modules/FindEigen3.cmake`.
> This used to work for Eigen versions up to and including version 3.4.1.

The above should read:

by looking for them in a file from Eigen  project called `../Eigen/src/Core/util/Macros.h`.
Comment 5 Antonio Rojas 2025-11-30 16:34:30 UTC
Again, the cmake module should just be removed in favor of the upstream one.
Comment 6 Robert 2025-11-30 16:48:45 UTC
On 30/11/2025 16:34, Antonio Rojas wrote:
> https://bugs.kde.org/show_bug.cgi?id=510760
>
> --- Comment #5 from Antonio Rojas <arojas@archlinux.org> ---
> Again, the cmake module should just be removed in favor of the upstream one.

Agree, this would be the most appropriate solution ...
Comment 7 caulier.gilles 2025-12-01 06:56:03 UTC
As i can see here on my Kubuntu 24.04 LTS, the Eigen3 version 3.5.0 is already ported to Cmake and configuration are shared on the system. This want mean that we can drop the findeigen3.cmake script at all and set the minimum dependency to 3.5.0

Note: on the gihub mirror, Eigen3 version 3.2.0 is already ported to cmake, but i don't know if cmake configuration have been already shared on the system.
Comment 8 caulier.gilles 2025-12-01 07:10:38 UTC
Git commit e7d4be62f8a523cf9a07fa7af39f439df3d93ea5 by Gilles Caulier.
Committed on 01/12/2025 at 07:09.
Pushed by cgilles into branch 'master'.

Use Eigen3 cmake configuration shared on the system.
FIXED-IN: 8.9.0

M  +2    -2    NEWS
M  +1    -1    core/app/utils/digikam_config.h.cmake.in
D  +0    -83   core/cmake/modules/FindEigen3.cmake

https://invent.kde.org/graphics/digikam/-/commit/e7d4be62f8a523cf9a07fa7af39f439df3d93ea5
Comment 9 Antonio Rojas 2025-12-01 07:48:39 UTC
Note that this is not ennogh to build with eigen 5.x, since the EIGEN3_INCLUDE_DIRS variable is removed in that version. See https://invent.kde.org/graphics/digikam/-/merge_requests/377
Comment 10 Robert 2025-12-09 23:18:14 UTC
Thank you for fixing this, as of today the flatpack version is built with Eigen 5.0.1 and the Refocus tool is working again:
```
          ID: org.kde.digikam
         Ref: app/org.kde.digikam/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 8.8.0
     License: GPL-2.0+
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 670.3 MB
     Runtime: org.kde.Platform/x86_64/6.10
         Sdk: org.kde.Sdk/x86_64/6.10

      Commit: 42b2eb64a4297b01f45e7bc085a70889b1129ed10757eb474e3b3d56f8f3d41d
      Parent: 8fd5c75ba795d5b69c6917e8973aa28274609ab2779c381ed4e618817c285ef0
     Subject: Merge pull request #277 from flathub/fix-eigen3 (2fe609cb1e1f)
        Date: 2025-12-09 16:06:12 +0000
```