Building dependencies for RT 5.7 on MacOS

Hello all. I’ve been a RawTherapee user for years on Linux and have recently bought a Mac. I’ve been having some issues building the dependencies for RT on MacOS, in at least getting them correct so I can compile RT from source and run it on my new macbook pro 16 (2019).
I’m using Homebrew and followed the instructions on rawpedia

I am able to run the pre-built 5.7 image from the RT website and do some image manipulation. There are some performance issues though which have been discussed on here already, and I have also been chatting about these these with @blj and some others. I don’t think RT on a Hi DPI Mac screen will be usable until those issues are solved.

Performance issues aside, when running the pre-built RT image the UI looks slightly odd in that the fonts seem slightly blurry and out of alignment (looks like anti-aliasing has gone haywire), so I am thinking there is something missing in my environment. After installing the dependencies using homebrew (making sure that my clang had support for openmp - which it does - I can compile a test program), I compiled RT from source (5.7 release from git) but that build of RT doesn’t run, and crashes with SIGABRT. Looks like this:

(rawtherapee-bin:687): GLib-GObject-WARNING **: 08:18:30.265: invalid cast from ‘GtkMenuBar’ to ‘GtkWindow’

(rawtherapee-bin:687): Gtk-CRITICAL **: 08:18:30.265: gtk_window_add_accel_group: assertion ‘GTK_IS_WINDOW (window)’ failed

(rawtherapee-bin:687): Gtk-WARNING **: 08:18:32.744: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/check-symbolic.svg.
This may indicate that pixbuf loaders or the mime database could not be found.

(rawtherapee-bin:687): Gtk-WARNING **: 08:18:33.747: Could not find the icon ‘list-remove-symbolic-ltr’. The ‘hicolor’ theme
was not found either, perhaps you need to install it.
You can get a copy from:
Index of /releases
**
Gtk:ERROR:…/gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognised image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:…/gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognised image file format (gdk-pixbuf-error-quark, 3)
zsh: abort ./RawTherapee.app/Contents/MacOS/rawtherapee

So with the same environment, the pre-built image from RT runs ok (looks bad) but the image that I built does not boot.

@blj suggested that this could be because of missing files in Homebrew installation phase. I would be very interested to know if the instructions on RawPedia for Homebrew have been used by others for a successful build and install of RT, or if MacPorts has had more success.

I believe @blj has had more success with MacPorts. Maybe you could post your configure + build settings and I can see how this goes with Catalina and MacPorts.

Any suggestions are welcome :slight_smile:
Cheers

Interestingly, I tried to run the RT app that I built without copying all the dimg into /Applications. By doing this I can get a UI in which fonts looks crisp and clear, but nothing works - no buttons, no boxs or dialogues, etc (not surprising as it is essentially an incomplete install). But there is some text and it certainly appears as though what I’ve built RT against on my system makes it look visually correct compared to how the pre-built looks when running on the same system. I don’t know where it’s expecting to load /org/gtk/libgtk/icons/16x16/status/image-missing.png from. This seems the cause of my crash. I see this file it in two theme directories. I don’t what governs RT to look for this file and in which location(s). If somebody has a working build and install image that they generated themselves, I would be very grateful to see the layout with respect to the gtk icons, etc, so compare with my own. Thanks.

Hi.

I will do my best to explain how I build with Macports. At work so typing on my phone.

All of the steps match rawpedia for Macports but some minor changes.

  1. Make sure like the rawpedia states that you add +quartz -x11 -gnome to the Macports variants.conf
  2. When installing the listed deps replace clang-3.9 with clang-9.0 and add cmake to the list. (Clang 3.9) does not run on newer versions of MacOS.)
  3. Make sure you do the libiconv patch step.
  4. When running cmake I use what is listed on the wiki but I use -DPROC_TARGET_NUMBER=“2”. Remove -DPROC_LABEL as it is no longer needed. Finally change the compilers to clang-mp-9.0 and clang++ -mp-9.0 respectively. Make sure LTO stays set to OFF.

Note if you can’t remove Homebrew make it will be easier to make a new user on your machine and install Macports there to build instead of trying to work around all the conflicts with Homebrew.

Hi. Thanks a lot for that. I will persevere with Homebrew for the time being and fall back to Macports if that road leads to a dead end. If you have time, I’d be very grateful if you could list where your gtk icons reside (eg image-missing.png) in your environment as this will likely help me figure out what has been missed from homebrew (maybe there is an additional package required). Presumably, somebody wrote the rawpedia page and had it working on MacOS with Homebrew, but I’m not sure what version of MacOS was used, or if they (still) frequent this forum. Cheers.

For example, in addition to hicolor-icon-theme, I am wondering if gnome-icon-theme is also required these days.

I will poke around in my Macports directory to see where it is located when I get home from work. By reading your error it makes me wonder if the Homebrew Adwaita package is messed up or if the bundler is looking in the wrong place. Not sure which. Those assets get copied into the app bundle along with the dylibs.

I believe hicolor is a fallback theme.

Thanks. Much appreciated. Looking on homebrew, I see that adwaita-icon-theme is also known as gnome-icon-theme, and I have adwaita-icon-theme installed already. I will have a poke around in this area anyway, as I think this is where my problem is.