Skip to content

Build Resynthesizer from source

Adrian Delgado edited this page Jan 28, 2023 · 3 revisions

The build system

The build system is an "automake" build system, using the GNU build tools automake, make, gcc, and so forth. There are also a few scattered cmake files for building the independent Resynthesizer library (See the tool chain and dependencies section)

The "deprecations" branch (the "nightly" or development branch for version 3) also uses the "meson" build system, which is much simpler.

Building on Linux

To build and install a clean distribution to the shared GIMP directories. Run the following command on your shell:

./autogen.sh
make
sudo make install

Attention Ubuntu Users! On Ubuntu, the default installation path is /usr/local/lib/gimp/2.0/plug-ins and you may need to add it manually. To do so, open GIMP and access Edit>Preferences>Folders>Plugins>/usr/local/lib/gimp/2.0/plug-ins to include the plugin path.

Building on other platforms

There are no instructions here, nor build scripts in the repository, to build for Windows or Mac OSX.

(The meson build system in the "deprecations" branch may be more amenable to building on other platforms.)

Dependencies

Tool chain and dependencies

When you run ./autogen.sh, it may complain of missing packages. Please install them by running the following commands:

sudo apt-get update
sudo apt-get install make gcc automake intltool libgimp2.0-dev libpcre3-dev libgegl-dev -y

Explanation

To build Resynthesizer (or any GIMP v2 plugin in the C language) you need these developer packages:

  • build-essential - all the tools to build a Debian package ( gcc and make.)
  • automake
  • intltool
  • libglib2.0-dev, libgimp2.0-dev - libraries that the Resynthesizer engine links to.

Note: The control panel plugin, is written in C and also links to the Gtk-2 library. In the future Resynthesizer version 3, that plugin is written in Python and Gtk-2 will no longer be a compile-time dependency.

Runtime dependencies

Important! A Python interpreter is a run-time dependency. Several Resynthesizer support plugins are written in Python.

As of this writing, the Resynthesizer plugins are written in Python 2. Python 2 has been obsolete since January 2020 and many distributions (e.g. Ubuntu since 19.10) no longer package it. The GIMP organization itself still supports building a Python 2 expressly to support the GIMP app. However, some distributors (e.g. Ubuntu) do not package that Python 2, which was formerly packaged with the name "gimp-python." When your distribution does not have the package "gimp-python", the standard advice is "build GIMP yourself", but that is difficult.

The future version 3 of the GIMP app, and the Resynthesizer, will be Python 3 compatible.

Further Customization

Optimization

The default gcc flags seem to be: "-g -O2 -Wall". To optimize more, pass the CFLAGS (a choice by the builder to alter compilation): "make CFLAGS=-O3"

Configuring Resynthesizer

A file "lib/buildSwitches.h" lets you configure certain features of the Resynthesizer engine. Briefly, without details:

One feature of the engine is "threads." Threading is the default. Threading does NOT help the performance as much as you might expect. Threading makes the engine non-deterministic, i.e. the results are not reproducible from run to run. By default threading uses GLib threads but other people have been able to compile Resynthesizer with POSIX threads.

Another feature is "GLib dependence". Using Glib is the default. GLib is intended to help provide platform independence. There is some conditionally compiled support to NOT using GLib.

Localization

Contributors have localized (internationalized, i18n) the plugins.

To build for another spoken language, you may also need to create a symbolic link to your preferred language file, for example:

sudo ln -s /usr/local/share/locale/fr/LC_MESSAGES/resynthesizer.mo /usr/share/locale/fr/LC_MESSAGES/resynthesizer.mo

History of the Resynthesier build system

Most build files (Makefile.am, configure.ac, etc.) were copied from the gimp-plugin-template 2.2.0, and slightly modified.