Linux: Difference between revisions

From RawPedia
Jump to navigation Jump to search
No edit summary
(9 intermediate revisions by the same user not shown)
Line 7: Line 7:


{| class="wikitable sortable"
{| class="wikitable sortable"
|+ Build-time dependencies for RawTherapee 4 and 5.0.
|+ Build-time dependencies for RawTherapee:
! GTK+      !! Package      !! Version            !! Gentoo                !! Debian/Ubuntu        !! URL
! GTK+      !! Package      !! Version            !! Gentoo                !! Debian/Ubuntu        !! URL
|-
|-
Line 38: Line 38:
| GTK2, GTK3 || LCMS2        || lcms>=2.6          || media-libs/lcms        || liblcms2-dev        || http://www.littlecms.com/
| GTK2, GTK3 || LCMS2        || lcms>=2.6          || media-libs/lcms        || liblcms2-dev        || http://www.littlecms.com/
|-
|-
| GTK3      || LENSFUN      || lensfun>=0.2      || ??                    || liblensfun-dev      || http://lensfun.sourceforge.net/
| GTK3      || LENSFUN      || lensfun>=0.2      || media-libs/lensfun    || liblensfun-dev      || http://lensfun.sourceforge.net/
|-
|-
| GTK2, GTK3 || LIBCANBERRA  || libcanberra>=0.29  || media-libs/libcanberra || libcanberra-gtk3-dev || http://0pointer.de/lennart/projects/libcanberra/ (Linux only)
| GTK2, GTK3 || LIBCANBERRA  || libcanberra>=0.29  || media-libs/libcanberra || libcanberra-gtk3-dev || http://0pointer.de/lennart/projects/libcanberra/ (Linux only)
Line 53: Line 53:
|}
|}


To compile the outdated RawTherapee 3 you will need these:
To compile the obsolete RawTherapee version 3, you will need these:


{| class="wikitable"
{| class="wikitable"
|+ Build-time dependencies for RawTherapee 3
|+ Build-time dependencies for the obsolete RawTherapee 3:
! Package  !! Version    !! Gentoo          !! Debian/Ubuntu  !! URL
! Package  !! Version    !! Gentoo          !! Debian/Ubuntu  !! URL
|-
|-
Line 62: Line 62:
|}
|}


In order to install all these dependencies, you will need to open a console and paste the code from the appropriate section into the console. Note that these code snippets include the GTK3 dependencies if available, so if you want to compile the legacy "gtk2" branch which uses GTK2 then replace the GTK3 dependencies with GTK2 ones as described in the list above.
In order to install all these dependencies, you will need to open a console and paste the code from the appropriate section into the console.


=== Arch ===
These code snippets list dependencies for the latest RawTherapee code which requires GTK3. We dropped support for GTK2 with release "5.0-r1-gtk2" in February 2017. If you use a modern distribution, just copy and paste the code snippets as they are. If you're on an old distribution without the required GTK3 support, then replace the GTK3 dependencies with the GTK2 ones from the table above, then checkout and compile the obsolete <code>5.0-r1-gtk2</code> tag.
The latest Arch supports GTK3, use the <code>dev</code> branch (or checkout a "gtk3" release tag). The dependencies below are only for GTK3.
 
<pre style="white-space: pre-wrap">sudo pacman -S bzip2 exiv2 expat fftw glib2 glibmm gtk3 gtkmm3 lcms2 lensfun libcanberra libiptcdata libjpeg-turbo libpng libsigc++ libtiff zlib</pre>
=== Arch/Manjaro ===
Current Arch supports GTK3, and Manjaro has supported GTK3 since release 17.1.2, so use the <code>dev</code> branch.
 
<pre style="white-space: pre-wrap">sudo pacman -S --needed bzip2 cmake exiv2 expat fftw glib2 glibmm gtk3 gtkmm3 lcms2 lensfun libcanberra libiptcdata libjpeg-turbo libpng libsigc++ libtiff zlib</pre>
 
Proceed to [[Linux#Two_ways_to_continue|compilation]].
 
=== CentOS ===
CentOS does not support a recent-enough version of GTK3, so you can only compile the obsolete GTK2 version - [[Linux#Choose_a_branch|checkout tag]] <code>5.0-r1-gtk2</code>.
 
As CentOS does not seem to have the Clearlooks GTK2 theme engine, you will either need to install some other GTK2 theme engine, or after installing RawTherapee go to "Preferences > General > Default Theme" and enable "Use system theme".


=== CentOS 7.1 ===
CentOS 7.1 does not support a recent enough version of GTK3, so you can only compile the <code>gtk2</code> branch.
As CentOS 7.1 does not seem to have the Clearlooks GTK2 theme engine, you will either need to install some other GTK2 theme engine, or after installing RawTherapee go to "Preferences > General > Default Theme" and enable "Use system theme".
<pre style="white-space: pre-wrap">sudo yum install bzip2-devel cmake curl exiv2-devel expat-devel fftw-devel gcc-c++ git glibmm24-devel gtk2-devel gtkmm24-devel lcms2-devel libjpeg-turbo-devel libcanberra-devel libiptcdata-devel libpng-devel libtiff-devel sigc++20-devel zlib-devel</pre>
<pre style="white-space: pre-wrap">sudo yum install bzip2-devel cmake curl exiv2-devel expat-devel fftw-devel gcc-c++ git glibmm24-devel gtk2-devel gtkmm24-devel lcms2-devel libjpeg-turbo-devel libcanberra-devel libiptcdata-devel libpng-devel libtiff-devel sigc++20-devel zlib-devel</pre>
Proceed to [[Linux#Two_ways_to_continue|compilation]].


=== Fedora ===
=== Fedora ===
Fedora supports GTK3 from version 22, use the <code>dev</code> branch (or checkout a "gtk3" release tag). The dependencies below are only for GTK3.
Fedora supports GTK3 from version 22, use the <code>dev</code> branch.
If you are using Fedora version 21 or older, use the legacy <code>gtk2</code> branch.
 
If you are using Fedora version 21 or older, use the obsolete GTK2 version - [[Linux#Choose_a_branch|checkout tag]] <code>5.0-r1-gtk2</code>.
 
<pre style="white-space: pre-wrap">sudo dnf install bzip2-devel cmake exiv2-devel expat-devel fftw-devel gcc-c++ glib2-devel glibmm24-devel gtk3-devel gtkmm30-devel lcms2-devel lensfun-devel libcanberra-devel libiptcdata-devel libjpeg-turbo-devel libpng-devel libsigc++20-devel libtiff-devel zlib-devel</pre>
<pre style="white-space: pre-wrap">sudo dnf install bzip2-devel cmake exiv2-devel expat-devel fftw-devel gcc-c++ glib2-devel glibmm24-devel gtk3-devel gtkmm30-devel lcms2-devel lensfun-devel libcanberra-devel libiptcdata-devel libjpeg-turbo-devel libpng-devel libsigc++20-devel libtiff-devel zlib-devel</pre>
Proceed to [[Linux#Two_ways_to_continue|compilation]].


=== Gentoo ===
=== Gentoo ===
Gentoo supports GTK3, use the <code>dev</code> branch (or checkout a "gtk3" release tag). The dependencies below are only for GTK3.
Gentoo supports GTK3, use the <code>dev</code> branch.
<pre style="white-space: pre-wrap">sudo emerge -uva app-arch/bzip2 dev-cpp/gtkmm:3.0 dev-libs/expat media-gfx/exiv2 media-libs/lcms media-libs/libcanberra media-libs/libiptcdata media-libs/libjpeg-turbo media-libs/libpng media-libs/tiff net-misc/curl sci-libs/fftw sys-libs/zlib x11-libs/gtk+:3</pre>
 
<pre style="white-space: pre-wrap">sudo emerge -uva app-arch/bzip2 dev-cpp/gtkmm:3.0 dev-libs/expat media-gfx/exiv2 media-libs/lcms media-libs/lensfun media-libs/libcanberra media-libs/libiptcdata media-libs/libjpeg-turbo media-libs/libpng media-libs/tiff net-misc/curl sci-libs/fftw sys-libs/zlib x11-libs/gtk+:3</pre>
 
Proceed to [[Linux#Two_ways_to_continue|compilation]].


=== openSUSE ===
=== openSUSE ===
openSUSE 42.2 and Tumbleweed support GTK3, use the <code>dev</code> branch (or checkout a "gtk3" release tag). The dependencies below are only for GTK3.
openSUSE 42.2 and Tumbleweed support GTK3, use the <code>dev</code> branch.
Note: openSUSE 42.1 supports GTK+ 3.16.7 but compilation fails as the sigc++-2.0>=2.4 requirement is not met.
 
If you are using openSUSE version 42.1 or older, use the legacy <code>gtk2</code> branch.
openSUSE 42.1 supports GTK+ 3.16.7 but compilation fails as the sigc++-2.0>=2.4 requirement is not met. If you are using openSUSE version 42.1 or older, use the obsolete GTK2 version - [[Linux#Choose_a_branch|checkout tag]] <code>5.0-r1-gtk2</code>.
 
<pre style="white-space: pre-wrap">sudo zypper in cmake fftw3-devel gcc-c++ glib2-devel glibmm2-devel gtk3-devel gtkmm3-devel libbz2-devel libcanberra-devel libexpat-devel libiptcdata-devel libjpeg-devel liblcms2-devel libpng-devel libsigc++2-devel libtiff-devel zlib-devel</pre>
<pre style="white-space: pre-wrap">sudo zypper in cmake fftw3-devel gcc-c++ glib2-devel glibmm2-devel gtk3-devel gtkmm3-devel libbz2-devel libcanberra-devel libexpat-devel libiptcdata-devel libjpeg-devel liblcms2-devel libpng-devel libsigc++2-devel libtiff-devel zlib-devel</pre>
Proceed to [[Linux#Two_ways_to_continue|compilation]].


=== Sabayon ===
=== Sabayon ===
Sabayon supports GTK3, use the <code>dev</code> branch (or checkout a "gtk3" release tag). The dependencies below are only for GTK3.
Sabayon supports GTK3, use the <code>dev</code> branch.
 
<pre style="white-space: pre-wrap">sudo equo install app-arch/bzip2 dev-cpp/gtkmm:3.0 dev-libs/expat dev-util/cmake media-gfx/exiv2 media-libs/lcms media-libs/libcanberra media-libs/libiptcdata media-libs/libjpeg-turbo media-libs/libpng media-libs/tiff net-misc/curl sci-libs/fftw sys-libs/zlib x11-libs/gtk+:3</pre>
<pre style="white-space: pre-wrap">sudo equo install app-arch/bzip2 dev-cpp/gtkmm:3.0 dev-libs/expat dev-util/cmake media-gfx/exiv2 media-libs/lcms media-libs/libcanberra media-libs/libiptcdata media-libs/libjpeg-turbo media-libs/libpng media-libs/tiff net-misc/curl sci-libs/fftw sys-libs/zlib x11-libs/gtk+:3</pre>


=== Ubuntu ===
Proceed to [[Linux#Two_ways_to_continue|compilation]].
Ubuntu as of version 15.10 (Wily Werewolf) supports GTK3, use the <code>dev</code> branch (or checkout a "gtk3" release tag). The dependencies below are only for GTK3.
 
Older versions of Ubuntu either do not support GTK3 at all, or the version of GTK3 they ship is not recent enough (RawTherapee GTK3 support requires GTK3 version 3.16 or newer), meaning you must use the legacy <code>gtk2</code> branch which uses GTK2.
=== Ubuntu/Mint/elementary OS ===
Ubuntu as of version 15.10 (Wily Werewolf) supports GTK3, use the <code>dev</code> branch.
 
Older versions of Ubuntu either do not support GTK3 at all, or the version of GTK3 they ship is not recent enough (RawTherapee currently requires GTK3 version 3.16 or newer), meaning you must use the obsolete GTK2 version - [[Linux#Choose_a_branch|checkout tag]] <code>5.0-r1-gtk2</code>.
 
==== Ubuntu 17.10, 17.04 and 16.10, Mint 18.3, elementary OS 0.4.1 ====
Use the <code>dev</code> branch.


==== Ubuntu 17.04 and 16.10 ====
Use the <code>dev</code> branch (or checkout a "gtk3" release tag). The dependencies below are only for GTK3.
<pre style="white-space: pre-wrap">sudo apt update
<pre style="white-space: pre-wrap">sudo apt update
sudo apt install build-essential cmake curl git libcanberra-gtk3-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk-3-dev libgtkmm-3.0-dev libiptcdata0-dev libjpeg-dev liblcms2-dev liblensfun-dev libpng-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev</pre>
sudo apt install build-essential cmake curl git libcanberra-gtk3-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk-3-dev libgtkmm-3.0-dev libiptcdata0-dev libjpeg-dev liblcms2-dev liblensfun-dev libpng-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev</pre>
Proceed to [[Linux#Two_ways_to_continue|compilation]].


==== Ubuntu 16.04 LTS and 15.10 ====
==== Ubuntu 16.04 LTS and 15.10 ====
Use the <code>dev</code> branch (or checkout a "gtk3" release tag). The dependencies below are only for GTK3.
Use the <code>dev</code> branch.
 
<pre style="white-space: pre-wrap">sudo apt-get update
<pre style="white-space: pre-wrap">sudo apt-get update
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk3-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk-3-dev libgtkmm-3.0-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev liblensfun-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev</pre>
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk3-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk-3-dev libgtkmm-3.0-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev liblensfun-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev</pre>
Proceed to [[Linux#Two_ways_to_continue|compilation]].


==== Ubuntu 15.04, 14.10, 14.04 LTS ====
==== Ubuntu 15.04, 14.10, 14.04 LTS ====
Use the legacy <code>gtk2</code> branch. The dependencies below are only for the <code>gtk2</code> branch.
Use the obsolete GTK2 version - [[Linux#Choose_a_branch|checkout tag]] <code>5.0-r1-gtk2</code>. The dependencies below are for GTK2.
 
<pre style="white-space: pre-wrap">sudo apt-get update
<pre style="white-space: pre-wrap">sudo apt-get update
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev</pre>
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev</pre>


RawTherapee requires GCC version 4.9 or higher. Ubuntu 14.04 LTS ships with GCC version 4.8.2 which is too old - to get 4.9, follow these steps: http://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu-14-04
RawTherapee requires GCC version 4.9 or higher. Ubuntu 14.04 LTS ships with GCC version 4.8.2 which is too old - to get 4.9, follow these steps: http://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu-14-04
Proceed to [[Linux#Two_ways_to_continue|compilation]].


==== Ubuntu 13.10, 13.04, 12.10, 12.04 LTS, 11.10 ====
==== Ubuntu 13.10, 13.04, 12.10, 12.04 LTS, 11.10 ====
Line 117: Line 149:


As these versions of Ubuntu only support GCC-4.8.1 and older, the latest commit you will be able to compile is [https://github.com/Beep6581/RawTherapee/commit/b343b9a7 commit b343b9a7] from 2015-12-29 - newer versions will not compile.
As these versions of Ubuntu only support GCC-4.8.1 and older, the latest commit you will be able to compile is [https://github.com/Beep6581/RawTherapee/commit/b343b9a7 commit b343b9a7] from 2015-12-29 - newer versions will not compile.
<pre style="white-space: pre-wrap">sudo apt-get update
<pre style="white-space: pre-wrap">sudo apt-get update
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev</pre>
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev</pre>
Proceed to [[Linux#Two_ways_to_continue|compilation]].


==== Ubuntu 10.10 and 11.04 ====
==== Ubuntu 10.10 and 11.04 ====
Line 127: Line 162:
sudo apt-get install cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg62 liblcms2-dev libnm-glib2 libpng12-dev libsigc++-2.0-dev libtiff4-dev zlib1g-dev</pre>
sudo apt-get install cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg62 liblcms2-dev libnm-glib2 libpng12-dev libsigc++-2.0-dev libtiff4-dev zlib1g-dev</pre>


<!--
Proceed to [[Linux#Two_ways_to_continue|compilation]].
 
=== Two ways to continue ===
=== Two ways to continue ===
There are two ways you can now continue: either use the automated script as described in [[Linux#Compiling:_The_Automatic_Way | Compiling: The Automatic Way]], designed to make your life easier or your money back guaranteed, or if you have no better way to spend the rest of your evening then do it manually, as described in [[Linux#Compiling:_The_Manual_Way | Compiling: The Manual Way]].
There are two ways you can now continue: either use the [[Linux#Compiling: The Automatic Way|automatic]] Bash script which compiles RawTherapee for you (recommended), or do so [[Linux#Compiling: The Manual Way|manually]].


== Compiling: The Automatic Way ==
== Compiling: The Automatic Way ==
<span style="color: red;">The buildRT script is currently outdated and won't work with Git. We are working on a new one. In the meanwhile, ignore the rest of this section and skip to the manual method. - 2015-11-22</span>
This is the recommended way of compiling RawTherapee as it is fast, simple and fool-proof. It relies on a Bash script which downloads the latest RawTherapee source code and compiles it in a way which is optimized for your CPU. The compiled builds are ready for use. The script does not check for build-time dependencies, so be sure to read the [[Linux#Dependencies | Dependencies]] section before using the script. The compiled builds are standalone, meaning that you can keep several versions of RawTherapee at the same time simply by renaming the build folders so that creating a new build does not overwrite the previous build, which happens by default.


'''GET THE AUTOMATIC SCRIPT HERE:''' http://rawtherapee.googlecode.com/hg/tools/buildRT
Run the script as a normal user, not as root!
 
This is a Bash script to automatically clone the RawTherapee source code repository, present the user with a list of available branches (e.g. "default") and build types ("release" and "debug"), and then to automatically compile the chosen branches and build types and create a ZIP archive of every finished build. The compiled builds are ready to be used. buildRT does '''not''' check for build-time dependencies, so be sure to read the [[Linux#Dependencies | Dependencies]] section before using this script.
 
Run it as a normal user, not as root!


Open a terminal, get the script, make it executable, and run it:
Open a terminal, get the script, make it executable, and run it:
<pre style="white-space: pre-wrap">cd ~
<pre style="white-space: pre-wrap">cd ~
wget http://rawtherapee.googlecode.com/hg/tools/buildRT
wget https://raw.githubusercontent.com/Beep6581/RawTherapee/dev/tools/build-rawtherapee
chmod +x ~/buildRT
chmod +x build-rawtherapee
./buildRT</pre>
./build-rawtherapee</pre>


Most people will want to compile the "default" branch, using the "release" build type, or the "debug" build type if you want to have RawTherapee spit out more errors which are useful in debugging, at the cost of running more slowly.
If everything goes well, the script will terminate with the message, "To run rawtherapee type: ...".


Pay attention to what the script says, it will tell you exactly where your compiled Rawtherapee is, and how to run it. That's it, you are done!
To update RawTherapee if you previously compiled it using this script, just re-run the script. That's it.


Run <code>./buildRT -h</code> to see a list and description of all the options which buildRT supports.
You have finished, RawTherapee is ready for use.


buildRT's version number and date are written in the header (the first few lines). It is updated every two months on average, so check for a newer version about once every two months. Also be sure to check for a newer version if compilation fails, as the newer version is likely to address the issue. You can check for a newer version by running <code>./buildRT -u</code>
-->
== Compiling: The Manual Way ==
== Compiling: The Manual Way ==
This section describes compiling RawTherapee manually<!-- - i.e. not using the automated script above-->.
The recommended way of compiling RawTherapee is by using the script - see [[Linux#Compiling:_The_Automatic_Way | Compiling: The Automatic Way]]. If you want to learn how to compile manually, read on.
 
In order to keep your "home" folder clean when manually compiling multiple programs (i.e. when not using your distribution's package manager) and for this manual compilation tutorial to maintain compatibility with the automatic compilation script, you will create the folder <code>~/programs/</code> which will contain all RawTherapee-related source code in the <code>~/programs/code-rawtherapee</code> folder, and the compiled build in the <code>~/programs/rawtherapee</code> folder. You can use the same scheme when compiling other programs.


=== Clone the source ===
=== Clone the source ===
First, you need to clone RawTherapee's source code repository. Bring up your console and run this:
First, you need to clone RawTherapee's source code repository. Bring up your console and run this:


<pre style="white-space: pre-wrap">git clone https://github.com/Beep6581/RawTherapee ~/repo-rt
<pre style="white-space: pre-wrap">mkdir -p ~/programs
cd ~/repo-rt</pre>
git clone https://github.com/Beep6581/RawTherapee ~/programs/code-rawtherapee
cd ~/programs/code-rawtherapee</pre>


=== Choose a branch ===
=== Choose a branch ===
* Features are developed on their own feature branches.
* Features are developed on their own feature branches.
* Development happens on the <code>dev</code> branch. Feature branches are merged into the <code>dev</code> branch when they're ready. The <code>dev</code> branch is unstable.
* Development happens in the <code>dev</code> branch. Feature branches are merged into the <code>dev</code> branch when they're ready. The <code>dev</code> branch is unstable.
* Releases are tagged on the <code>releases</code> branch.
* Releases are tagged in the <code>releases</code> branch.


Checkout the latest tag if you want the most stable code. To see all available tags, type:
Checkout the latest tag if you want the most stable code. To see all available tags, type:
Line 182: Line 215:


=== Compile RawTherapee ===
=== Compile RawTherapee ===
Now you will make an out-of-source compilation of RawTherapee, it will be built into the ~/repo-rt/build/release folder, and then you will move this folder to your home directory and rename it to "rt", so make sure there is no ~/rt folder already!
Now you will make an out-of-source compilation of RawTherapee, it will be built into the <code>~/programs/code-rawtherapee/build/release</code> folder, and then you will move this folder to <code>~/programs/rawtherapee</code>


There are a few compilation settings you need to be aware of, you will pass these to CMake using the -D option as described below:
==== CMake ====
There are a few compilation settings you need to be aware of, you will pass these to CMake using the <code>-D</code> option as described below:


; BUILD_TYPE
; BUILD_TYPE
: You must specify the <code>BUILD_TYPE</code> when building RawTherapee. You can set the <code>BUILD_TYPE</code> value to "<code>debug</code>", "<code>relwithdebinfo</code>" or "<code>release</code>". The "debug" and "relwithdebinfo" builds will let you [[How_to_write_useful_bug_reports | get a useful stack-backtrace]] if RawTherapee crashes while running through GDB which you can then submit to us so we can find the problem and fix it. The "debug" build is the slowest but generates the most detailed information. The "relwithdebinfo" build is almost as fast as a "release" build and generates often sufficient information, though not as detiled as a "debug" build. The "release" build will not provide any useful information when it crashes, but does contain many speed optimizations resulting in a program that works many times faster than the "debug" version would. For normal use, make a "release" or "relwithdebinfo" build. If you find a reproducible bug, then make a "debug" build and send us a stack-backtrace (or fix it yourself and send us the patch!). Alternatively use a "relwithdebinfo" build, and hope that it's detailed enough.
: One of: <code>release</code> (default), <code>relwithdebinfo</code> or <code>debug</code>.
:: To make a "release" type build, write: <code>-DCMAKE_BUILD_TYPE="release"</code>
: This controls whether the build will favor faster execution time or more verbose debugging output.
:: Replace "release" by "debug" or "relwithdebinfo" as needed.
: The "debug" and "relwithdebinfo" builds will let you [[How_to_write_useful_bug_reports | get a useful stack-backtrace]] if RawTherapee crashes while running through GDB which you can then submit to us so we can find the problem and fix it. The "debug" build is the slowest but generates the most detailed information. The "relwithdebinfo" build is almost as fast as a "release" build and generates often sufficient information, though not as detailed as a "debug" build. The "release" build will not provide any useful information when it crashes, but does contain many speed optimizations resulting in a program that works several times faster than the "debug" build would. For normal use, make a "release" or "relwithdebinfo" build. If you find a reproducible bug, then make a "debug" build and send us a stack-backtrace (or fix it yourself and send us the patch!). We prefer stack backtraces from debug builds than from relwithdebinfo ones.
:: To make a "release" type build, set: <code>-DCMAKE_BUILD_TYPE="release"</code>


; USE_OLD_CXX_ABI
; USE_OLD_CXX_ABI
: When compiling a program, one must use the same conventions as those used by the libraries which that program relies upon, otherwise compilation (linking) will fail. Generally one does not need to concern oneself with this, but we are now at a time when GCC4 is being phased out by GCC5, each by default uses a convention incompatible with the other, and so this issue is relevant. If the libraries on your system have been compiled using GCC5, they probably use a standard called C++11. This means that your RawTherapee build must use the same standard, which is the case by default. However if despite using GCC5 your libraries were built using the older C++03 standard, then RawTherapee must be set to use the same, and this is when you would set "USE_OLD_CXX_ABI" to "ON":
: <code>ON</code> or <code>OFF</code> (default).
:: To enable USE_OLD_CXX_ABI, write: <code>-DUSE_OLD_CXX_ABI="ON"</code>
: When compiling a program, one must use the same conventions as those used by the libraries which that program relies upon, otherwise compilation (linking) will fail. Generally one does not need to concern oneself with this, but we are now at a time when GCC4 is being phased out by GCC5, each by default using a convention incompatible with the other, and so this issue is relevant. If the libraries on your system have been compiled using GCC5, they probably use a standard called C++11. This means that your RawTherapee build must use the same standard, which is the case by default. However, if despite using GCC5 your libraries were built using the older C++03 standard, then RawTherapee must be set to use the same, and this is when you would set "USE_OLD_CXX_ABI" to "ON".
:: To enable USE_OLD_CXX_ABI, set: <code>-DUSE_OLD_CXX_ABI="ON"</code>


; CACHE_NAME_SUFFIX
; CACHE_NAME_SUFFIX
: The CACHE_NAME_SUFFIX options dictates the suffix of the cache and config folder names the compiled RawTherapee build will use.
: The CACHE_NAME_SUFFIX options sets the suffix of the cache and config folder names the compiled RawTherapee build will use. See the [[File Paths]] article for an explanation of what those are.
: See the [[File Paths]] article for a full explanation, or just use "5-dev".
: For stable releases (if you checkout the "releases" branch) use <code>-DCACHE_NAME_SUFFIX=""</code>
: For development builds (if you checkout the "dev" branch or any branch other than "releases") use <code>-DCACHE_NAME_SUFFIX="5-dev"</code>


; PROC_TARGET_NUMBER
; PROC_TARGET_NUMBER
: The PROC_TARGET_NUMBER option sets which CPU type to optimize for. "2" is a safe choice because it means "native", so the optimizations will be automatically detected for your CPU.
: From <code>0</code> (default) to <code>9</code>.
: The PROC_TARGET_NUMBER option sets which CPU type to optimize for.
: If building for yourself, use "2". It means "native", so the optimizations will be automatically detected for your CPU and RawTherapee will perform as fast as possible on your CPU. It might not run at all on older or other CPU architectures.
: If building for distribution (for other people), use "1". It means "generic", so only optimizations supported by most CPUs will be used, meaning the build can be downloaded and used by anyone, though it won't benefit from the best optimizations possible for the user's CPU.
: For more info, see the file "ProcessorTargets.cmake" in the cloned repository.
: For more info, see the file "ProcessorTargets.cmake" in the cloned repository.
:: To make a build using "native" optimizations, write: <code>-DPROC_TARGET_NUMBER="2"</code>
:: To make a build using "native" optimizations, set: <code>-DPROC_TARGET_NUMBER="2"</code>
 
; BUILD_BUNDLE
: <code>ON</code> or <code>OFF</code>.
: Forced to "ON" for Windows and macOS. Optional in Linux where it is "OFF" by default.
: If set to ON, the program will be built into the <code>DATADIR</code> folder, otherwise it will be installed relative to <code>CMAKE_INSTALL_PREFIX</code> which would typically be system-wide.
 
; BUNDLE_BASE_INSTALL_DIR
: Use an absolute path.
: The program will be built into this folder.
: For example, set it to: <code>-DBUNDLE_BASE_INSTALL_DIR="$HOME/programs/rawtherapee"</code>
: If it is not set, the default is to use <code>${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}</code>


; LENSFUNDBDIR
; LENSFUNDBDIR
: The LENSFUNDBDIR option permits to locate the lensfun data base in the specified directory i.e. <code>.\share\lensfun</code>`
: Unset by default.
: The <code>LENSFUNDBDIR</code> option permits to locate the lensfun database in the specified directory. It can be unset, absolute or relative.
: When unset, Lensfun uses its own logic to find the database. This is the recommended option if you have Lensfun installed system-wide and want to use it.
: You can set it to a relative or absolute path if you want to use a custom lensfun database.
: If building a bundle, it is relative to the bundle's root folder, otherwise it is relative to <code>DATADIR</code>, i.e. <code>${CMAKE_INSTALL_PREFIX}/share/rawtherapee</code>


Finally, you need to find out how many threads your CPU supports. This will make compilation faster but it will have no effect on the speed of running RawTherapee.
; OPTION_OMP
; Threads
: <code>ON</code> (default) or <code>OFF</code>.
: To find out how many threads your CPU supports, run:
: Build with OpenMP support when enabled, which enables multithreading and makes RawTherapee much faster.
: <code>grep -c processor /proc/cpuinfo</code>
: Then replace the number in "-j8" below with this number.


; WITH_LTO
: <code>ON</code> or <code>OFF</code> (default).
: Build with link-time optimizations when enabled, which may make RawTherapee run a little faster.


Now you are ready to compile:
; WITH_PROF
<pre style="white-space: pre-wrap">cd ~/repo-rt
: <code>ON</code> or <code>OFF</code> (default).
: For debugging purposes. Generate extra code to write profile information suitable for the analysis program gprof.
 
; WITH_SAN
: <code>OFF</code> (default) or one of various other options.
: For debugging purposes. Allows enabling various sanitizers to help detect program issues.
: See GCC manual's [https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html Program Instrumentation Options] chapter for more information.
 
; WITH_SYSTEM_KLT
: <code>ON</code> or <code>OFF</code> (default).
: Build using system KLT library when ON, otherwise use KLT files bundled with RawTherapee.
: The Kanade–Lucas–Tomasi (KLT) feature tracker is used by the [[Lens/Geometry#Distortion_Correction|Auto Distortion Correction]] tool.
 
; WITH_BENCHMARK
: <code>ON</code> or <code>OFF</code> (default).
: Build with timing functions enabled to benchmark performance.
 
==== Make ====
 
Find out how many threads your CPU supports. This only influences the compilation speed, it has no influence over how fast the compiled RawTherapee build runs. To find out how many threads your CPU supports, run this in a terminal:
<pre style="white-space: pre-wrap">nproc --all</pre>
It will return a number. Use this number for the <code>--jobs</code> parameter below.
 
Compile:
<pre style="white-space: pre-wrap">cd ~/programs/code-rawtherapee
rm -rf build
rm -rf build
mkdir build && cd build
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE="release" \
 
      -DPROC_TARGET_NUMBER="2" \
cmake \
      -DBUILD_BUNDLE="ON" \
    -DCMAKE_BUILD_TYPE="release"  \
      -DCACHE_NAME_SUFFIX="5-dev" \
    -DCACHE_NAME_SUFFIX="5-dev" \
      -DWITH_LTO="OFF" \
    -DPROC_TARGET_NUMBER="2" \
      ..
    -DBUILD_BUNDLE="ON" \
make -j4 install
    -DBUNDLE_BASE_INSTALL_DIR="$HOME/programs/rawtherapee" \
mv release ~/rt</pre>
    -DOPTION_OMP="ON" \
    -DWITH_LTO="OFF" \
    -DWITH_PROF="OFF" \
    -DWITH_SAN="OFF" \
    -DWITH_SYSTEM_KLT="OFF" \
    ..
 
make --jobs=4
make install
</pre>


=== Run RawTherapee ===
=== Run RawTherapee ===
To run RawTherapee:
To run RawTherapee:
<pre style="white-space: pre-wrap">~/rt/rawtherapee</pre>
<pre style="white-space: pre-wrap">~/programs/rawtherapee/rawtherapee</pre>
Or to run the CLI version:
<pre style="white-space: pre-wrap">~/programs/rawtherapee/rawtherapee-cli</pre>


The source code repository is in <code>~/repo-rt</code> and the compiled program is in <code>~/rt</code>
The source code repository is in <code>~/programs/code-rawtherapee</code> and the compiled program is in <code>~/programs/rawtherapee</code>


You can safely delete <code>~/repo-rt</code> if you so wish. The compiled program will still work, but then you will have to redo all the above steps if you want to update. Rather, leave the repository intact so that you can do the next step in a week or a month's time.
You can safely delete <code>~/programs/code-rawtherapee</code> if you so wish. The compiled program will still work, but then you will have to redo all the above steps if you want to update. Rather, leave the repository intact so that you can do the next step in a week or a month's time when you want to update.


=== Update RawTherapee ===
=== Update RawTherapee ===
Every time you want to update your RawTherapee to the latest code available, just do the following:
Every time you want to update RawTherapee to the latest code available, just do the following:
<pre style="white-space: pre-wrap">cd ~/repo-rt
<pre style="white-space: pre-wrap">cd ~/programs/code-rawtherapee
git pull</pre>
git pull</pre>


Then repeat the [[Linux#Compile RawTherapee | Compile RawTherapee]] step above.
Then repeat the [[Linux#Make|Make]] step above.

Revision as of 00:04, 2 February 2018

This page details instructions for compiling RawTherapee on GNU/Linux systems. There are also instructions for compiling on Windows and OS X.

When in doubt, join us on IRC and ask a human!

Dependencies

To compile RawTherapee your system will need a set of tools. They are called dependencies, and here is a list of dependencies for both GTK2 and GTK3 versions of RawTherapee:

Build-time dependencies for RawTherapee:
GTK+ Package Version Gentoo Debian/Ubuntu URL
GTK2, GTK3 BZIP2 bzip2>-1.0.4 app-arch/bzip2 libbz2-dev http://www.bzip.org/
GTK2, GTK3 EXIV2 exiv2>=0.19 media-gfx/exiv2 libexiv2-dev http://www.exiv2.org/
GTK2, GTK3 EXPAT expat>=2.1.0 dev-libs/expat libexpat-dev http://expat.sourceforge.net/
GTK2, GTK3 FFTW3 fftw>=3.2.2 sci-libs/fftw fftw-dev http://fftw.org/
GTK2, GTK3 GCC gcc>=4.9 sys-devel/gcc build-essential http://gcc.gnu.org/
GTK2, GTK3 GLIB2 glib-2.0>=2.24 dev-libs/glib libglib2.0-dev http://www.gtk.org/
GTK2, GTK3 GLIBMM glibmm-2.4>=2.24 dev-cpp/glibmm libglibmm-2.4-dev http://www.gtkmm.org
GTK2 GTK+ gtk+-2.0>=2.24.18 x11-libs/gtk+ libgtk2.0-dev http://www.gtk.org/
GTK3 GTK+ gtk+-3.16 x11-libs/gtk+ libgtk-3-dev http://www.gtk.org/
GTK2 GTK2-Engines gtk-engines-2.20.2 x11-themes/gtk-engines gtk2-engines http://www.gtk.org/
GTK2 GTKMM gtkmm-2.4>=2.22 dev-cpp/gtkmm libgtkmm-2.4-dev http://www.gtkmm.org
GTK3 GTKMM gtkmm-3.16 dev-cpp/gtkmm libgtkmm-3.0-dev http://www.gtkmm.org
GTK2, GTK3 JPEG libjpeg>=6b media-libs/jpeg libjpeg-dev http://libjpeg-turbo.virtualgl.org/ http://jpegclub.org/ http://www.ijg.org/
GTK2, GTK3 LCMS2 lcms>=2.6 media-libs/lcms liblcms2-dev http://www.littlecms.com/
GTK3 LENSFUN lensfun>=0.2 media-libs/lensfun liblensfun-dev http://lensfun.sourceforge.net/
GTK2, GTK3 LIBCANBERRA libcanberra>=0.29 media-libs/libcanberra libcanberra-gtk3-dev http://0pointer.de/lennart/projects/libcanberra/ (Linux only)
GTK2, GTK3 LIBIPTCDATA libiptcdata>=1.0.2 media-libs/libiptcdata libiptcdata-dev http://libiptcdata.sourceforge.net
GTK2, GTK3 PNG libpng>=1.2.44 media-libs/libpng libpng-dev http://www.libpng.org/
GTK2, GTK3 SIGC sigc++-2.0 dev-libs/libsigc++ libsigc++-2.0-dev http://libsigc.sourceforge.net/
GTK2, GTK3 TIFF libtiff>=3.9.4 media-libs/tiff libtiff-dev http://www.remotesensing.org/libtiff/
GTK2, GTK3 ZLIB zlib>=1.2.3 sys-libs/zlib zlib1g-dev http://www.zlib.net/

To compile the obsolete RawTherapee version 3, you will need these:

Build-time dependencies for the obsolete RawTherapee 3:
Package Version Gentoo Debian/Ubuntu URL
LCMS1 lcms<=1.99 media-libs/lcms liblcms1-dev http://www.littlecms.com/

In order to install all these dependencies, you will need to open a console and paste the code from the appropriate section into the console.

These code snippets list dependencies for the latest RawTherapee code which requires GTK3. We dropped support for GTK2 with release "5.0-r1-gtk2" in February 2017. If you use a modern distribution, just copy and paste the code snippets as they are. If you're on an old distribution without the required GTK3 support, then replace the GTK3 dependencies with the GTK2 ones from the table above, then checkout and compile the obsolete 5.0-r1-gtk2 tag.

Arch/Manjaro

Current Arch supports GTK3, and Manjaro has supported GTK3 since release 17.1.2, so use the dev branch.

sudo pacman -S --needed bzip2 cmake exiv2 expat fftw glib2 glibmm gtk3 gtkmm3 lcms2 lensfun libcanberra libiptcdata libjpeg-turbo libpng libsigc++ libtiff zlib

Proceed to compilation.

CentOS

CentOS does not support a recent-enough version of GTK3, so you can only compile the obsolete GTK2 version - checkout tag 5.0-r1-gtk2.

As CentOS does not seem to have the Clearlooks GTK2 theme engine, you will either need to install some other GTK2 theme engine, or after installing RawTherapee go to "Preferences > General > Default Theme" and enable "Use system theme".

sudo yum install bzip2-devel cmake curl exiv2-devel expat-devel fftw-devel gcc-c++ git glibmm24-devel gtk2-devel gtkmm24-devel lcms2-devel libjpeg-turbo-devel libcanberra-devel libiptcdata-devel libpng-devel libtiff-devel sigc++20-devel zlib-devel

Proceed to compilation.

Fedora

Fedora supports GTK3 from version 22, use the dev branch.

If you are using Fedora version 21 or older, use the obsolete GTK2 version - checkout tag 5.0-r1-gtk2.

sudo dnf install bzip2-devel cmake exiv2-devel expat-devel fftw-devel gcc-c++ glib2-devel glibmm24-devel gtk3-devel gtkmm30-devel lcms2-devel lensfun-devel libcanberra-devel libiptcdata-devel libjpeg-turbo-devel libpng-devel libsigc++20-devel libtiff-devel zlib-devel

Proceed to compilation.

Gentoo

Gentoo supports GTK3, use the dev branch.

sudo emerge -uva app-arch/bzip2 dev-cpp/gtkmm:3.0 dev-libs/expat media-gfx/exiv2 media-libs/lcms media-libs/lensfun media-libs/libcanberra media-libs/libiptcdata media-libs/libjpeg-turbo media-libs/libpng media-libs/tiff net-misc/curl sci-libs/fftw sys-libs/zlib x11-libs/gtk+:3

Proceed to compilation.

openSUSE

openSUSE 42.2 and Tumbleweed support GTK3, use the dev branch.

openSUSE 42.1 supports GTK+ 3.16.7 but compilation fails as the sigc++-2.0>=2.4 requirement is not met. If you are using openSUSE version 42.1 or older, use the obsolete GTK2 version - checkout tag 5.0-r1-gtk2.

sudo zypper in cmake fftw3-devel gcc-c++ glib2-devel glibmm2-devel gtk3-devel gtkmm3-devel libbz2-devel libcanberra-devel libexpat-devel libiptcdata-devel libjpeg-devel liblcms2-devel libpng-devel libsigc++2-devel libtiff-devel zlib-devel

Proceed to compilation.

Sabayon

Sabayon supports GTK3, use the dev branch.

sudo equo install app-arch/bzip2 dev-cpp/gtkmm:3.0 dev-libs/expat dev-util/cmake media-gfx/exiv2 media-libs/lcms media-libs/libcanberra media-libs/libiptcdata media-libs/libjpeg-turbo media-libs/libpng media-libs/tiff net-misc/curl sci-libs/fftw sys-libs/zlib x11-libs/gtk+:3

Proceed to compilation.

Ubuntu/Mint/elementary OS

Ubuntu as of version 15.10 (Wily Werewolf) supports GTK3, use the dev branch.

Older versions of Ubuntu either do not support GTK3 at all, or the version of GTK3 they ship is not recent enough (RawTherapee currently requires GTK3 version 3.16 or newer), meaning you must use the obsolete GTK2 version - checkout tag 5.0-r1-gtk2.

Ubuntu 17.10, 17.04 and 16.10, Mint 18.3, elementary OS 0.4.1

Use the dev branch.

sudo apt update
sudo apt install build-essential cmake curl git libcanberra-gtk3-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk-3-dev libgtkmm-3.0-dev libiptcdata0-dev libjpeg-dev liblcms2-dev liblensfun-dev libpng-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev

Proceed to compilation.

Ubuntu 16.04 LTS and 15.10

Use the dev branch.

sudo apt-get update
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk3-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk-3-dev libgtkmm-3.0-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev liblensfun-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev

Proceed to compilation.

Ubuntu 15.04, 14.10, 14.04 LTS

Use the obsolete GTK2 version - checkout tag 5.0-r1-gtk2. The dependencies below are for GTK2.

sudo apt-get update
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev

RawTherapee requires GCC version 4.9 or higher. Ubuntu 14.04 LTS ships with GCC version 4.8.2 which is too old - to get 4.9, follow these steps: http://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu-14-04

Proceed to compilation.

Ubuntu 13.10, 13.04, 12.10, 12.04 LTS, 11.10

These versions of Ubuntu are badly outdated. The code below used to work but it may stop working at any moment. Upgrade your operating system.

As these versions of Ubuntu only support GCC-4.8.1 and older, the latest commit you will be able to compile is commit b343b9a7 from 2015-12-29 - newer versions will not compile.

sudo apt-get update
sudo apt-get install build-essential cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libfftw3-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg8-dev liblcms2-dev libpng12-dev libsigc++-2.0-dev libtiff5-dev zlib1g-dev

Proceed to compilation.

Ubuntu 10.10 and 11.04

These versions of Ubuntu are badly outdated. The code below used to work but it may stop working at any moment. Upgrade your operating system.

sudo apt-add-repository ppa:dasprid/rawtherapee
sudo apt-get update
sudo apt-get install cmake curl git libbz2-dev libcanberra-gtk-dev libexiv2-dev libexpat-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libiptcdata0-dev libjpeg62 liblcms2-dev libnm-glib2 libpng12-dev libsigc++-2.0-dev libtiff4-dev zlib1g-dev

Proceed to compilation.

Two ways to continue

There are two ways you can now continue: either use the automatic Bash script which compiles RawTherapee for you (recommended), or do so manually.

Compiling: The Automatic Way

This is the recommended way of compiling RawTherapee as it is fast, simple and fool-proof. It relies on a Bash script which downloads the latest RawTherapee source code and compiles it in a way which is optimized for your CPU. The compiled builds are ready for use. The script does not check for build-time dependencies, so be sure to read the Dependencies section before using the script. The compiled builds are standalone, meaning that you can keep several versions of RawTherapee at the same time simply by renaming the build folders so that creating a new build does not overwrite the previous build, which happens by default.

Run the script as a normal user, not as root!

Open a terminal, get the script, make it executable, and run it:

cd ~
wget https://raw.githubusercontent.com/Beep6581/RawTherapee/dev/tools/build-rawtherapee
chmod +x build-rawtherapee
./build-rawtherapee

If everything goes well, the script will terminate with the message, "To run rawtherapee type: ...".

To update RawTherapee if you previously compiled it using this script, just re-run the script. That's it.

You have finished, RawTherapee is ready for use.

Compiling: The Manual Way

The recommended way of compiling RawTherapee is by using the script - see Compiling: The Automatic Way. If you want to learn how to compile manually, read on.

In order to keep your "home" folder clean when manually compiling multiple programs (i.e. when not using your distribution's package manager) and for this manual compilation tutorial to maintain compatibility with the automatic compilation script, you will create the folder ~/programs/ which will contain all RawTherapee-related source code in the ~/programs/code-rawtherapee folder, and the compiled build in the ~/programs/rawtherapee folder. You can use the same scheme when compiling other programs.

Clone the source

First, you need to clone RawTherapee's source code repository. Bring up your console and run this:

mkdir -p ~/programs
git clone https://github.com/Beep6581/RawTherapee ~/programs/code-rawtherapee
cd ~/programs/code-rawtherapee

Choose a branch

  • Features are developed on their own feature branches.
  • Development happens in the dev branch. Feature branches are merged into the dev branch when they're ready. The dev branch is unstable.
  • Releases are tagged in the releases branch.

Checkout the latest tag if you want the most stable code. To see all available tags, type:

git tag

Checkout the dev branch or some other feature branch if you want to test the latest bleeding-edge code. To see all available branches, type:

git branch -a

Checking out is done via the "git checkout" command. To checkout a tag or a branch, type:

git checkout <tag or branch>

RawTherapee uses GTK+ for the user interface and requires GTK+ version 3.16 or newer. If your system does not support version 3.16 or newer then you must checkout the 5.0-r1-gtk2 tag. Our GTK2 support has officially ended on 2 February 2017 - update your system.

Note: Compiling old versions of RawTherapee will fail on a modern system, as you will be missing the old dependencies.

Compile RawTherapee

Now you will make an out-of-source compilation of RawTherapee, it will be built into the ~/programs/code-rawtherapee/build/release folder, and then you will move this folder to ~/programs/rawtherapee

CMake

There are a few compilation settings you need to be aware of, you will pass these to CMake using the -D option as described below:

BUILD_TYPE
One of: release (default), relwithdebinfo or debug.
This controls whether the build will favor faster execution time or more verbose debugging output.
The "debug" and "relwithdebinfo" builds will let you get a useful stack-backtrace if RawTherapee crashes while running through GDB which you can then submit to us so we can find the problem and fix it. The "debug" build is the slowest but generates the most detailed information. The "relwithdebinfo" build is almost as fast as a "release" build and generates often sufficient information, though not as detailed as a "debug" build. The "release" build will not provide any useful information when it crashes, but does contain many speed optimizations resulting in a program that works several times faster than the "debug" build would. For normal use, make a "release" or "relwithdebinfo" build. If you find a reproducible bug, then make a "debug" build and send us a stack-backtrace (or fix it yourself and send us the patch!). We prefer stack backtraces from debug builds than from relwithdebinfo ones.
To make a "release" type build, set: -DCMAKE_BUILD_TYPE="release"
USE_OLD_CXX_ABI
ON or OFF (default).
When compiling a program, one must use the same conventions as those used by the libraries which that program relies upon, otherwise compilation (linking) will fail. Generally one does not need to concern oneself with this, but we are now at a time when GCC4 is being phased out by GCC5, each by default using a convention incompatible with the other, and so this issue is relevant. If the libraries on your system have been compiled using GCC5, they probably use a standard called C++11. This means that your RawTherapee build must use the same standard, which is the case by default. However, if despite using GCC5 your libraries were built using the older C++03 standard, then RawTherapee must be set to use the same, and this is when you would set "USE_OLD_CXX_ABI" to "ON".
To enable USE_OLD_CXX_ABI, set: -DUSE_OLD_CXX_ABI="ON"
CACHE_NAME_SUFFIX
The CACHE_NAME_SUFFIX options sets the suffix of the cache and config folder names the compiled RawTherapee build will use. See the File Paths article for an explanation of what those are.
For stable releases (if you checkout the "releases" branch) use -DCACHE_NAME_SUFFIX=""
For development builds (if you checkout the "dev" branch or any branch other than "releases") use -DCACHE_NAME_SUFFIX="5-dev"
PROC_TARGET_NUMBER
From 0 (default) to 9.
The PROC_TARGET_NUMBER option sets which CPU type to optimize for.
If building for yourself, use "2". It means "native", so the optimizations will be automatically detected for your CPU and RawTherapee will perform as fast as possible on your CPU. It might not run at all on older or other CPU architectures.
If building for distribution (for other people), use "1". It means "generic", so only optimizations supported by most CPUs will be used, meaning the build can be downloaded and used by anyone, though it won't benefit from the best optimizations possible for the user's CPU.
For more info, see the file "ProcessorTargets.cmake" in the cloned repository.
To make a build using "native" optimizations, set: -DPROC_TARGET_NUMBER="2"
BUILD_BUNDLE
ON or OFF.
Forced to "ON" for Windows and macOS. Optional in Linux where it is "OFF" by default.
If set to ON, the program will be built into the DATADIR folder, otherwise it will be installed relative to CMAKE_INSTALL_PREFIX which would typically be system-wide.
BUNDLE_BASE_INSTALL_DIR
Use an absolute path.
The program will be built into this folder.
For example, set it to: -DBUNDLE_BASE_INSTALL_DIR="$HOME/programs/rawtherapee"
If it is not set, the default is to use ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}
LENSFUNDBDIR
Unset by default.
The LENSFUNDBDIR option permits to locate the lensfun database in the specified directory. It can be unset, absolute or relative.
When unset, Lensfun uses its own logic to find the database. This is the recommended option if you have Lensfun installed system-wide and want to use it.
You can set it to a relative or absolute path if you want to use a custom lensfun database.
If building a bundle, it is relative to the bundle's root folder, otherwise it is relative to DATADIR, i.e. ${CMAKE_INSTALL_PREFIX}/share/rawtherapee
OPTION_OMP
ON (default) or OFF.
Build with OpenMP support when enabled, which enables multithreading and makes RawTherapee much faster.
WITH_LTO
ON or OFF (default).
Build with link-time optimizations when enabled, which may make RawTherapee run a little faster.
WITH_PROF
ON or OFF (default).
For debugging purposes. Generate extra code to write profile information suitable for the analysis program gprof.
WITH_SAN
OFF (default) or one of various other options.
For debugging purposes. Allows enabling various sanitizers to help detect program issues.
See GCC manual's Program Instrumentation Options chapter for more information.
WITH_SYSTEM_KLT
ON or OFF (default).
Build using system KLT library when ON, otherwise use KLT files bundled with RawTherapee.
The Kanade–Lucas–Tomasi (KLT) feature tracker is used by the Auto Distortion Correction tool.
WITH_BENCHMARK
ON or OFF (default).
Build with timing functions enabled to benchmark performance.

Make

Find out how many threads your CPU supports. This only influences the compilation speed, it has no influence over how fast the compiled RawTherapee build runs. To find out how many threads your CPU supports, run this in a terminal:

nproc --all

It will return a number. Use this number for the --jobs parameter below.

Compile:

cd ~/programs/code-rawtherapee
rm -rf build
mkdir build && cd build

cmake \
    -DCMAKE_BUILD_TYPE="release"  \
    -DCACHE_NAME_SUFFIX="5-dev" \
    -DPROC_TARGET_NUMBER="2" \
    -DBUILD_BUNDLE="ON" \
    -DBUNDLE_BASE_INSTALL_DIR="$HOME/programs/rawtherapee" \
    -DOPTION_OMP="ON" \
    -DWITH_LTO="OFF" \
    -DWITH_PROF="OFF" \
    -DWITH_SAN="OFF" \
    -DWITH_SYSTEM_KLT="OFF" \
    ..

make --jobs=4
make install

Run RawTherapee

To run RawTherapee:

~/programs/rawtherapee/rawtherapee

Or to run the CLI version:

~/programs/rawtherapee/rawtherapee-cli

The source code repository is in ~/programs/code-rawtherapee and the compiled program is in ~/programs/rawtherapee

You can safely delete ~/programs/code-rawtherapee if you so wish. The compiled program will still work, but then you will have to redo all the above steps if you want to update. Rather, leave the repository intact so that you can do the next step in a week or a month's time when you want to update.

Update RawTherapee

Every time you want to update RawTherapee to the latest code available, just do the following:

cd ~/programs/code-rawtherapee
git pull

Then repeat the Make step above.