Bug 372659

Summary: eigen-3.3 and ilm-base-2.2.0: "half" type collision
Product: [Applications] krita Reporter: Enno Boland <g>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: demm, halla
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Enno Boland 2016-11-19 12:49:08 UTC
both eigen-3.3 (https://bitbucket.org/eigen/eigen/) and ilmbase (http://www.openexr.com/downloads.html) define a type half. When building the calligra suite, krita fails with the following error:

    ...

    Scanning dependencies of target kritanormalize
    [ 79%] Building CXX object krita/plugins/filters/normalize/CMakeFiles/kritanormalize.dir/kritanormalize_automoc.cpp.o
    [ 79%] Building CXX object krita/plugins/filters/normalize/CMakeFiles/kritanormalize.dir/kis_normalize.cpp.o
    In file included from /builddir/calligra-2.9.11/libs/pigment/KoColorSpaceMaths.h:117:0,
                     from /builddir/calligra-2.9.11/libs/pigment/KoColorSpaceTraits.h:26,
                     from /builddir/calligra-2.9.11/krita/plugins/filters/unsharp/kis_unsharp_filter.cpp:38:
    /usr/include/OpenEXR/half.h:229:64: error: reference to 'half' is ambiguous
     HALF_EXPORT std::ostream &      operator << (std::ostream &os, half  h);
                                                                    ^
    /usr/include/OpenEXR/half.h:91:7: note: candidates are: class half
     class half
           ^
    In file included from /usr/include/eigen3/Eigen/Core:386:0,
                     from /builddir/calligra-2.9.11/krita/image/kis_convolution_kernel.h:23,
                     from /builddir/calligra-2.9.11/krita/plugins/filters/unsharp/kis_unsharp_filter.cpp:25:
    /usr/include/eigen3/Eigen/src/Core/arch/CUDA/Half.h:76:8: note:                 struct Eigen::half
     struct half : public half_impl::half_base {
            ^
    In file included from /builddir/calligra-2.9.11/libs/pigment/KoColorSpaceMaths.h:117:0,
                     from /builddir/calligra-2.9.11/libs/pigment/KoColorSpaceTraits.h:26,
                     from /builddir/calligra-2.9.11/krita/plugins/filters/unsharp/kis_unsharp_filter.cpp:38:
    /usr/include/OpenEXR/half.h:229:64: error: 'half' has not been declared
     HALF_EXPORT std::ostream &      operator << (std::ostream &os, half  h);
                                                                    ^
    /usr/include/OpenEXR/half.h:230:64: error: reference to 'half' is ambiguous
     HALF_EXPORT std::istream &      operator >> (std::istream &is, half &h);
                                                                    ^
    /usr/include/OpenEXR/half.h:91:7: note: candidates are: class half
     class half
           ^
    In file included from /usr/include/eigen3/Eigen/Core:386:0,
                     from /builddir/calligra-2.9.11/krita/image/kis_convolution_kernel.h:23,
                     from /builddir/calligra-2.9.11/krita/plugins/filters/unsharp/kis_unsharp_filter.cpp:25:
    /usr/include/eigen3/Eigen/src/Core/arch/CUDA/Half.h:76:8: note:                 struct Eigen::half
     struct half : public half_impl::half_base {
            ^
    ...

With eigen-3.2 the build worked fine.

Also see https://github.com/voidlinux/void-packages/issues/5174 for the downstream Void Linux bug.
Comment 1 Halla Rempt 2016-11-19 13:12:45 UTC
Krita 2.9 is no longer being maintained, there will be no new 2.9.x releases. Build Krita 3.0.1.1 or the latest 3.1 beta instead. If you must build Krita 2.9, build it with the appropriate library versions.
Comment 2 demm 2016-12-12 17:55:24 UTC
Issue is the same for Krita 3.0.1.1, build fails with the same output as above when Eigen 3.3.1 is used, no such problems with Eigen 3.2.10.