The source code of G'MIC is shared between several git repositories with public access.
Accessing it via git ensures you get the latest code available, and will ease the
source updates as well. Here are the instructions to compile G'MIC on a fresh installation of Debian (or Ubuntu).
It should not be much harder for other distros. First you need to install all the required tools and libraries:
$ sudo apt install git build-essential libgimp2.0-dev libcurl4-openssl-dev libfftw3-dev libtiff-dev libjpeg-dev libopenexr-dev qtbase5-dev qttools5-dev-tools
Then, get the G'MIC source from the different repositories:
You are now ready to compile all G'MIC interfaces:
- gmic (command-line tool),
- gmic_gimp_qt (plug-in for GIMP),
- ZArt and
- libgmic (G'MIC C++ library).
Just pick your choice:
$ cd gmic/src
$ make cli # Compile command-line interface
$ make gimp # Compile plug-in for GIMP
$ make lib # Compile G'MIC library files
$ make zart # Compile ZArt
$ make all # Compile all of the G'MIC interfaces
and go out for a long drink (the compilation takes time).
Note that compiling issues (compiler segfault) may happen with older versions of g++ (4.8.1 and 4.8.2).
If you encounter this kind of errors, you probably have to disable the support of OpenMP
in G'MIC to make it work, by compiling it with:
make OPENMP_CFLAGS="" OPENMP_LIBS=""
Also, please remember that the source code in the git repository
is constantly under development and may be a bit unstable, so do not hesitate to report bugs if you encounter any.
On Windows, compiling executables of the different G'MIC interfaces is not that hard.
It requires the following steps:
- Set up of the compiling environment:
- Install MSYS2, from https://www.msys2.org/.
- Launch MSYS terminal (MSYS2 MinGW 64-bit), then update default installed packages with:
$ pacman -Syu
- Install required additional packages (beware, it will take a lot of time and disk space, around 3GB):
$ pacman -Sy mingw64/mingw-w64-x86_64-qt5 mingw64/mingw-w64-x86_64-gimp mingw64/mingw-w64-x86_64-pkgconf mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-fftw make git
- Create a link for pkg-config.exe in folder /mingw64/bin:
$ cd /mingw64/bin && ln -s pkgconf.exe pkg-config.exe
- Add /mingw64/bin to $PATH,
by adding following line in file $HOME/.bash_profile:
PATH="/mingw64/bin:${PATH}"
- Close terminal, and relaunch it. Now all required tools to compile are avalaible from the terminal.
- Retrieve source code of G'MIC interfaces:
- Compilation of gmic (CLI interface):
- Compilation of gmic_qt (stand-alone Qt-based interface):
- Go to gmic-qt/ source folder:
$ cd gmic-qt/
- Generate Makefile with qmake:
$ qmake HOST=none
For an unknown reason, qmake sometimes takes a lot of time to end, hanging 5 minutes or so without displaying any messages.
But at the end, it just works, so be patient!
- Compile with generated Makefile:
$ make -j4 release
- When compilation succeeds, G'MIC-Qt executable can be found in directory release/gmic_qt.exe.
- Copy needded DLL for the gmic_qt.exe executable:
$ cd /mingw64/bin/ && cp libgcc_s_seh-1.dll libwinpthread-1.dll libgomp-1.dll libstdc++-6.dll libcurl-4.dll libbrotlidec.dll libbrotlicommon.dll libcrypto-1_1-x64.dll libidn2-0.dll libiconv-2.dll libintl-8.dll libunistring-2.dll libnghttp2-14.dll libpsl-5.dll libssh2-1.dll zlib1.dll libssl-1_1-x64.dll libzstd.dll libfftw3-3.dll libpng16-16.dll Qt5Core.dll libdouble-conversion.dll libicuin67.dll libicuuc67.dll libicudt67.dll libpcre2-16-0.dll Qt5Gui.dll libharfbuzz-0.dll libgraphite2.dll libfreetype-6.dll libbz2-1.dll libglib-2.0-0.dll libpcre-1.dll Qt5Network.dll Qt5Widgets.dll PATH_TO_EXE/
- Copy required Qt platform files:
$ cp -rf /mingw64/share/qt5/plugins/platforms PATH_TO_EXE/
- Compilation of gmic_gimp_qt (plug-in for GIMP):
Same as above, but invoke qmake with:
$ qmake HOST=gimp
- Compilation of gmic_paintdotnet_qt (plug-in for Paint.NET):
Same as above, but invoke qmake with:
$ qmake HOST=paintdotnet