The build times are terrible because each and every binary recompiles and links as an object gmic.cpp - which is not only big, but includes the huge header CImg.h. The solution would be to convince upstream to allow linking against libgmic.
I started to implement myself the use of the shared library for all binaries that currently link the object statically and I’ll contribute it upstream when I’m done.
The patches were sent upstream, but upstream does not understand why I would want to do that instead of compiling and installing that common code for each and every one of those six binaries
For instance, it is desirable for the cli interface to have all the input/output format support enabled for JPEG, PNG, TIFF, etc… This is not desirable for the plug-in. The plug-in gets image data mainly from the host software and it doesn’t have to know how to read float-valued TIFF files.
Making the plug-in depend on a commonlibgmic that would be used for all interface means adding a lot of dependencies for the users of the plug-in only.
We already have issues with users complaining about the high number of needed .dll files on Windows, or mismatching library versions when using the linux executable provided on the web page. I don’t want to manage useless extra-dependencies for the users of the plug-in.
I understand that if you want to install all G’MIC interfaces together (which is apparently what the Gentoo packager wants to do), then it is useless to compile gmic.cpp multiple times, but this is not the common use case. On other distros, packagers split the different G’MIC interfaces into several packages, so that people who wish to get the plug-in installed only are free to do so.
So, definitely I won’t make a shared libgmic library file shared amongst all the G’MIC interfaces the default. But I repeat what I already said : this is currently quite easy to compile a shared libgmic and use it for all the G’MIC interfaces (plug-in, cli,…). The packager can do it.
I’d be glad to help if anybody ask, except the packager we are talking about who is clearly too rude and unmannerly.
The changes I’ve made have unfortunately broken the cmakefile we provided in the past, so I’ve removed it. I’m really not familiar enough with cmake to create a new working CMakeFiles.
But if someone wants to put his hands in this (and is ok to maintain it!!), he is welcome, of course.
Maybe another thing : the patch submitted by the packager who complains was not accepted at time of submission, and is now not compatible with current version of git master.
It seems he was a bit upset about that so I doubt he’ll try to contribute again on the CMakefile, but that how life goes. I prefer to have less friendly contributors than more rude ones.
So after thinking about it a bit and seeing that said developer already has pretty much everything in place to make a cmake-based build work again (gentoo-overlay/media-gfx/gmic at master · stefantalpalaru/gentoo-overlay · GitHub) I thought I could perhaps act as some kind of mediator to get this into the official gmic repository again. Bear in mind, I will initially just copy (while giving credits obviously) work already done by the Gentoo developer. So I hope you’re ok with that
After that, I’ll do my best to keep it working as gmic progresses. My reasoning for doing this is simple, I’m a Gentoo user and I’d like to get the most recent version of gmic in the gentoo package repository.
Also, I’m a (professional) software developer. So I know what I’m doing, kind of anyway…
Is this something that could work from your perspective? If so, I’ll try to contact the Gentoo dev…
I’ve done some necessary modifications in the Makefile to reflect changes that was made on the G’MIC source code, and added a new Makefile entry allshared allowing the OP to fulfill his request.
The pull request proposed by the OP was not good enough to be included. And the modifications I made broke that pull request. After that, I got a really bad feedback from the OP despite the fact he was able to build G’MIC as he asked, with a shared library (he probably didn’t want to try my way, I don’t know why).
I’m not using cmake at all, I think it is not really useful for a small project like G’MIC, and anyway I’m not familiar enough with this tool to create and maintain a working CMakeList.
I like when people contribute, but what I’m asking is they also maintain their contributions when I’m not able to do it myself. We had a working CMakeList for the project for a while, but I think it is not working anymore, and nobody took the time to update it to make it work with the latest version.
I’d be happy to hear someone is OK to deal with it, as long as he also says he promise to maintain the CMakeList in the future, in case of changes.
Yeah, it’s basically a single file containing most (all?) of the source code. So the build process can’t take advantage of multiple cores which makes it slow to compile on modern processors.