c-koi/gmic-qt

[Krita plugin] Missing Linux (and Mac OSX) packages, no compiling instructions

Closed this issue · 29 comments

Hi,

I wanted to test G'mic Krita plugin with Krita 3.2 RC, but on this page, only Debian and Windows packages are available.
I know the project is young, but I can't test it with an Archlinux distribution, and I suppose Ubuntu and Fedora should be supported too. Or you can provide a generic static Linux packages, or an Appimage as Krita do.
If you don't have the time to do that, please at least provides some compiling instructions for beginners.

I'm sorry I don't have the necessary skills to help with this, but with some compiling instructions I can try to create a PKGBUILD for AUR and the Archlinux community.

The build instructions are in the README.md:

git clone https://github.com/dtschump/gmic.git
git clone https://github.com/c-koi/gmic-qt.git
make -C gmic/src CImg.h gmic_stdlib.h
cd gmic-qt
qmake [HOST=none|gimp]
make

Isn't that for compiling for Gimp ?
If I try, at this line
qmake [HOST=none|gimp]
i get
bash: gimp] : command not found
despite Gimp is installed

I also tried with the method explained at the end of the download page, and it successfully compiled, but in Krita 3.2 RC, even linking with the correct gmic_krita_qt file, G'mic never start

use HOST=krita

EDIT : our answer crossed, I'll try to compile again with the README method.
For the download page method I get this:

More precisely, I can start the Gmic Krita plugin alone but it doesn't found Krita:

[nylnook@nylnook-home gmic-qt]$ ./gmic_krita_qt 
gmic-qt: socket Key: "gmic-krita"
Could not connect to the Krita instance.
Could not connect to the Krita instance.
	gmic-qt: empty answer!
Could not connect to the Krita instance.
	gmic-qt: empty answer!

And in Krita, despite I provided the correct path in Krita configuration:
capture d ecran de 2017-08-10 11-32-00

the menu is still grey:
capture du 2017-08-10 11-32-27

I don't know if it's a compilation error (resulting in a incorrect gmic version for Krita) or a bug in Krita 3.2 RC...

I'm compiling with HOST=krita, here is the message I get

[nylnook@nylnook-home gmic-qt]$ qmake [HOST=krita]
Info: creating stash file /home/nylnook/gmic-qt/.qmake.stash
Project MESSAGE: GMIC PATH ../gmic/src
Project MESSAGE: Prerelease date is 170810
Project MESSAGE: Linux platform
Project MESSAGE: Target host software is GIMP
Project MESSAGE: OpenMP enabled
Project MESSAGE: Release build

Project MESSAGE: Target host software is GIMP ????
And I obtain "gmic_gimp_qt" file...

So, I'm sorry to say I confirm there is no compiling instructions...

Why do you want to put the brackets ?

$ qmake HOST=krita

is the way to go. When the plug-in is compiled, you don't have to run it by yourself, it will be done by Krita, if your specified path to the binary plug-in is correct.
Last : you need to have at least one image opened in Krita so that the G'MIC menu becomes available from Krita

Because I'm an illustrator, not a programmer, putting brackets or not is not obvious, I never used qmake before... Anyway, thanks for you answer David.
And the precision that I need to open an image in Krita to be able to launch the Gmic plugin is useful, I didn't expected that, it should be mentioned in the README with the correct compilation code.

It's now compiling correctly:
Project MESSAGE: Target host software is Krita

but even loading an image in Krita, the button is now white, but it won't start, here what I get with Krita 3.2 RC appimage run in the terminal, whatever the compilation method:

stateChanged QProcess::ProcessState(Starting)
stateChanged QProcess::ProcessState(Running)
Plugin started true QProcess::ProcessState(Running)
/home/nylnook/gmic-qt/gmic_krita_qt: ./lib/libQt5Core.so.5: version `Qt_5.9' not found (required by /home/nylnook/gmic-qt/gmic_krita_qt)
/home/nylnook/gmic-qt/gmic_krita_qt: ./lib/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib/libpng16.so.16)
stateChanged QProcess::ProcessState(NotRunning)
pluginFinished 1 QProcess::ExitStatus(NormalExit)

my "qt5-base" and other qt5 packages are version 5.9.1, and "zlib" package is 1.2.11 ...
looking in the "lib" directory, "libQt5Core.so.5" and "libz.so.1" are both symlinks to the latest versions...

So I suppose my system package are slightly too recent ? Can't G'mic be happy with "Qt5.9 or greater" and "Zlib 1.2.9 or greater" ?

Anyway, this is far from obvious, as you already know, packages and instructions are needed for beginners...

Because I'm an illustrator, not a programmer, putting brackets or not is not obvious, I never used qmake before... Anyway, thanks for you answer David.

I see. So, maybe I have to mention that the current G'MIC plug-in for Krita should be still considered as 'experimental', as it has been developed only a few weeks ago. @boudewijnrempt has done a hard work on the implementation but packaging to make it easy to use for everyone is still another effort we have to do. Sorry about that.

So I suppose my system package are slightly too recent ? Can't G'mic be happy with "Qt5.9 or greater" and "Zlib 1.2.9 or greater" ?

Yes, it should be happy with that. What is surprising is your compilation of gmic_krita_qt apparently is using other versions of these libraries. If there are the libs installed by default on your system, I don't see why it doesn't work flawlessly.

Anyway, this is far from obvious, as you already know, packages and instructions are needed for beginners...

Right, this is far from obvious. Right now, we have put a lot of efforts developing the new G'MIC plug-in for Krita. Didn't have the time to package it cleanly, as said before.

Ok, thanks to both of you for your work.
The best I can do to contribute is to offer to write a beginner documentation on how to compile and install the plugin... but I need to make it run for that ;)
Please ping me when needed, or I'll try again when Krita 3.2 will be released.

Any contribution is welcome btw. Do not hesitate to share your experience with the Krita plug-in, it's really only a beginning :)

I just successfully compiled with Cmake... after many tries, the correct line is:
cmake .. -DGMIC_QT_HOST=krita -DGMIC_PATH=/path/to/gmic/src -DCMAKE_BUILD_TYPE=Release

But I've got the same issue once running, the G'mic Krita plugin won't start:

stateChanged QProcess::ProcessState(Starting)
stateChanged QProcess::ProcessState(Running)
Plugin started true QProcess::ProcessState(Running)
/home/nylnook/gmic-qt/build/gmic_krita_qt: ./lib/libQt5Core.so.5: version `Qt_5.9' not found (required by /home/nylnook/gmic-qt/build/gmic_krita_qt)
/home/nylnook/gmic-qt/build/gmic_krita_qt: ./lib/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib/libpng16.so.16)
stateChanged QProcess::ProcessState(NotRunning)
pluginFinished 1 QProcess::ExitStatus(NormalExit)

I'll be happy to write a tutorial, but I need to make it run for that ;)

That still sounds like the qt you built gmic-qt against isn't found when you're finally starting the plugin. Can you start the plugin manually, on the command line, like ./gmic_krita_qt ?

I haven't been able to make OSX builds that run yet, but for me, on windows and linux, everything seems to work fine...

Works fine when I start it alone, except it obviously don't find Krita:

[nylnook@nylnook-home build]$ ./gmic_krita_qt
gmic-qt: socket Key: "gmic-krita"
Could not connect to the Krita instance.
Could not connect to the Krita instance.
	gmic-qt: empty answer!
Could not connect to the Krita instance.
	gmic-qt: empty answer!

Am I supposed to build gmic-qt as root in a system path instead of building it as an user in my home directory ?

No... That shouldn't matter. But you probably should be sure that Krita and gmic-qt are built with the same instance and version of Qt.

So I'll try to compile Krita 3.2 RC instead of using the appimage ;)

The appimage I made this weekend does include gmic-qt and it does work -- at least for me, on opensuse and neon.

I just tried with 3.2 RC3 downloaded here : https://download.kde.org/unstable/krita/3.2.0-rc.3/
and it still ask for a path to gmic-qt:
capture d ecran de 2017-08-14 11-28-25
How can I say to Krita appimage to use the appimage as the path to Gmic-qt ?

I'm compiling Krita in the meantime...

If you remove the existing gmic path entry in the kritarc, krita should detect the one installed next to it.

I'm sorry this is not working, even after restarting Krita appimage...
I may need to delete some config in my user Krita config dir ?

yes, that's what I said: you need to remove the gmic_qt_plugin_path entry in the kritarc config file. You will find that in $HOME/.config

Sorry, I didn't read correctly 'kritarc'... I was looking in $HOME/.kde4/share/apps/krita/krita.rc file, which contained a line about Gmic, but without path.

So ok, its works with the appimage of Krita 3.2 RC3 !
I will wait to see if it also works with a just compiled Krita...

Ok, I accidentally build Krita 4.0 pre-alpha, but its works with my compiled version of the Krita G'mic plugin... !
Congrats for the work !

As far as I know, only MacOS package or compilation instructions are now missing.

Should I write my tutorial in the Krita wiki, or elsewhere to publish it of the G'mic website ?

I haven't managed to build on OSX yet; someone else did and reported on irc today. However, that needed the X11 libraries and he ran into a problem where OSX only allows shared memory segments of 40mb, which is too small.

I really fear that the networked model with shared memory just isn't going to work for us, and that I will need to hack up another way to integrate :-(

I can't test on OSX (do not own any)... But isn't Qt supposed to work without X11 on OSX ? Will that remove the memory limit of 40 mb ? I suppose the Qt plugin for Gimp isn't... maybe the Gimp packager can help ?

So I will wait for your green light before writing an installation tutorial, supposedly here : https://docs.krita.org/GMIC_filter_plugin

gmic-qt uses qt, but gmic library has its own gui components, and those are only implemented in X11 and gdi; those are used, for instance, for the interactive colorize function. On OSX, without X11, those won't work.

ok...

Zack Emmert made an AUR package/script for Archlinux: https://aur.archlinux.org/packages/krita-plugin-gmic-git
It's based on qmake and it works for me with Krita 3.2.1
Thanks to him ;)

I tried the above solution, but it throws an error at the end.
@boudewijnrempt

screenshot from 2018-11-27 01-00-12

And what do you think the error means?