Update krita to compile against Vc >= 1.0.0
ClosedPublic

Authored by zachmann on Apr 6 2016, 4:30 AM.

Details

Reviewers
dkazakov
rempt
Summary

This updates krita to work with Vc version 1.0.0 and above. Some changes to the build system were needed
as the compile options are now set differently. The compile flags are set on the lib which uses the
functionality. This is needed in a non packager build only. Compile the KisCompositionBenchmark against the
current available Vc optimization.

Thanks to Vir for all his help.

Test Plan

Tested packager and non packager build. Run the and compared the output of ./KisCompositionBenchmark.shell.
The speed is nearly the same. For avx a different code path is used when avx2 is not available which makes
it tick slower but correct in all cases according to Vir.

Compiled and tested against vc 1.0.0 and vc 1.2.0.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
zachmann updated this revision to Diff 3149.Apr 6 2016, 4:30 AM
zachmann retitled this revision from to Update krita to compile against Vc >= 1.0.0.
zachmann updated this object.
zachmann edited the test plan for this revision. (Show Details)
zachmann added reviewers: rempt, dkazakov.
zachmann set the repository for this revision to R37 Krita.
zachmann added a project: Krita.
Restricted Application added a subscriber: woltherav. · View Herald TranscriptApr 6 2016, 4:30 AM
rempt edited edge metadata.Apr 6 2016, 6:18 AM

Hm, we do have a problem here. It looks like setting some flags breaks building on OSX:

[ 0%] Built target kritaplugin_automoc
[ 0%] Building CXX object libs/koplugin/CMakeFiles/kritaplugin.dir/KoPluginLoader.cpp.o
In file included from /Users/boud/dev/krita/libs/koplugin/KoPluginLoader.cpp:20:
In file included from /Users/boud/dev/krita/libs/koplugin/KoPluginLoader.h:23:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/QObject:1:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qobject.h:41:
/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:756:55: error: no type named 'u16string' in namespace 'std'

static inline QString fromStdU16String(const std::u16string &s);
                                             ~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:757:17: error: no type named 'u16string' in namespace 'std'

inline std::u16string toStdU16String() const;
       ~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:758:55: error: no type named 'u32string' in namespace 'std'

static inline QString fromStdU32String(const std::u32string &s);
                                             ~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:759:17: error: no type named 'u32string' in namespace 'std'

inline std::u32string toStdU32String() const;
       ~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1319:53: error: no type named 'u16string' in namespace 'std'
inline QString QString::fromStdU16String(const std::u16string &s)

~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1322:13: error: no type named 'u16string' in namespace 'std'
inline std::u16string QString::toStdU16String() const

~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1323:15: error: no member named 'u16string' in namespace 'std'
{ return std::u16string(reinterpret_cast<const char16_t*>(utf16()), length()); }

~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1325:53: error: no type named 'u32string' in namespace 'std'
inline QString QString::fromStdU32String(const std::u32string &s)

~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1328:13: error: no type named 'u32string' in namespace 'std'
inline std::u32string QString::toStdU32String() const

~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1330:19: error: expected ';' after expression

std::u32string u32str(length(), char32_t(0));
              ^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1330:10: error: no member named 'u32string' in namespace 'std'

std::u32string u32str(length(), char32_t(0));
~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1330:20: error: use of undeclared identifier 'u32str'

std::u32string u32str(length(), char32_t(0));
               ^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1331:75: error: use of undeclared identifier 'u32str'

int len = toUcs4_helper(d->data(), length(), reinterpret_cast<uint*>(&u32str[0]));
                                                                      ^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1332:5: error: use of undeclared identifier 'u32str'

u32str.resize(len);
^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qstring.h:1333:12: error: use of undeclared identifier 'u32str'

return u32str;
       ^

In file included from /Users/boud/dev/krita/libs/koplugin/KoPluginLoader.cpp:20:
In file included from /Users/boud/dev/krita/libs/koplugin/KoPluginLoader.h:23:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/QObject:1:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qobject.h:43:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qlist.h:41:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qhashfunctions.h:39:
/Users/boud/dev/i/lib/QtCore.framework/Headers/qpair.h:62:44: error: no member named 'declval' in namespace 'std'

Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<T1&>() = p.first) && noexcept(std::declval<T2&>() = p.second))
                              ~~~~~^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qcompilerdetection.h:1036:43: note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'

define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)

^

In file included from /Users/boud/dev/krita/libs/koplugin/KoPluginLoader.cpp:20:
In file included from /Users/boud/dev/krita/libs/koplugin/KoPluginLoader.h:23:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/QObject:1:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qobject.h:43:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qlist.h:41:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qhashfunctions.h:39:
/Users/boud/dev/i/lib/QtCore.framework/Headers/qpair.h:62:52: error: 'T1' does not refer to a value

Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<T1&>() = p.first) && noexcept(std::declval<T2&>() = p.second))
                                           ^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qcompilerdetection.h:1036:43: note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'

define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)

^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qpair.h:42:17: note: declared here
template <class T1, class T2>

^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qpair.h:62:55: error: expected expression

Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<T1&>() = p.first) && noexcept(std::declval<T2&>() = p.second))
                                              ^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qcompilerdetection.h:1036:43: note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'

define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)

^

In file included from /Users/boud/dev/krita/libs/koplugin/KoPluginLoader.cpp:20:
In file included from /Users/boud/dev/krita/libs/koplugin/KoPluginLoader.h:23:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/QObject:1:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qobject.h:43:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qlist.h:41:
In file included from /Users/boud/dev/i/lib/QtCore.framework/Headers/qhashfunctions.h:39:
/Users/boud/dev/i/lib/QtCore.framework/Headers/qpair.h:62:57: error: expected expression

Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<T1&>() = p.first) && noexcept(std::declval<T2&>() = p.second))
                                                ^

/Users/boud/dev/i/lib/QtCore.framework/Headers/qcompilerdetection.h:1036:43: note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'

define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)

^

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

rempt added a comment.Apr 6 2016, 6:38 AM

Okay, that is fixed: we had some old flags set when building on OSX, which breaks now that Vc needs real C++11. I've also got a version of the patch that add Vc 1.2 to the 3rdparty folder.

dkazakov updated this object.Apr 6 2016, 12:39 PM
dkazakov edited edge metadata.
zachmann updated this revision to Diff 3162.Apr 6 2016, 1:47 PM
zachmann removed R37 Krita as the repository for this revision.

Remove no longer vc version checks < 1.0.0

rempt accepted this revision.Apr 7 2016, 6:45 AM
rempt edited edge metadata.

Tested on OSX where it works fine.

This revision is now accepted and ready to land.Apr 7 2016, 6:45 AM
zachmann closed this revision.Apr 7 2016, 6:31 PM