MacOS: Difference between revisions

From RawPedia
Jump to navigation Jump to search
(→‎Run and Share RawTherapee: run note added regarding macOS 10.15 Catalina filesystem access control changes.)
m (clarify tested-on range)
 
(41 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div class="pagetitle">MacOS</div>
This page details instructions for compiling RawTherapee on '''macOS''' systems. There are also separate pages with instructions for compiling on [[Linux]] and [[Windows]]. This guide details the '''what''' and '''how''' parts of compilation. For the '''why''' and explanations of these commands, for a list of dependencies, CMake options and other information, please refer to the detailed [[Linux]] article.
This page details instructions for compiling RawTherapee on '''macOS''' systems. There are also separate pages with instructions for compiling on [[Linux]] and [[Windows]]. This guide details the '''what''' and '''how''' parts of compilation. For the '''why''' and explanations of these commands, for a list of dependencies, CMake options and other information, please refer to the detailed [[Linux]] article.


Line 6: Line 8:


== Dependencies ==
== Dependencies ==
See the list of dependencies in the [[Linux#Dependencies|Compiling in Linux]] article.
See the list of dependencies in the [[Linux#Dependencies|Compiling in Linux]] article.


=== Homebrew ===
=== Homebrew ===
The following command installs dependencies for RawTherapee:
The following command installs dependencies for RawTherapee:
<code>
<code>
brew install gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++ little-cms2 libiptcdata fftw lensfun wget llvm cmake expat pkgconfig libomp
brew install gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++ little-cms2 libiptcdata fftw lensfun wget llvm cmake expat pkgconfig shared-mime-info
</code>
</code>
* '''Configuring the homebrew build environment for Apple Silicon "M1"'''
: To your <code>cmake</code> command add the following flags:
:: <code>-DLOCAL_PREFIX:STRING="/opt/homebrew"</code>
:: <code>-DCMAKE_OSX_ARCHITECTURES=arm64</code>


=== MacPorts ===
=== MacPorts ===
Tested on OS X 10.9 and newer.
 
* '''Prerequisites:'''
{{warning|1=If you want to use Homebrew to manage prerequisite libraries, do not use MacPorts or issue any <code>sudo port</code> commands.}}
** Apple's Xcode Developer Tools
 
** Apple's Command Line Tools
Tested on OS X 10.9-12.
* '''Prerequisites'''
** Xcode Developer Tools & Command Line Tools
** MacPorts
** MacPorts
*** Detailed instructions on setting up MacPorts and the developer tools are available on the MacPorts website.
*** Detailed instructions on setting up MacPorts and the developer tools are available on the [https://www.macports.org MacPorts website].
*** The native system compiler provided by Apple is badly outdated and does not support OpenMP. Don't use it. Use the latest stable compiler from MacPorts - RawTherapee will run faster.
* '''Configure MacPorts:'''  
* '''Configure MacPorts:'''  
: Add the following line to /opt/local/etc/macports/variants.conf
: Add the following line to /opt/local/etc/macports/variants.conf
:: <code>+quartz -x11 -gnome</code>
:: <code>+quartz -x11 -gnome +openmp</code>


* '''Dependencies:'''
* '''Dependencies'''
: To install the dependencies, run from the terminal:
: To install the dependencies, run from the terminal:
:: <code>sudo port install git clang-3.9 gtk3 gtkmm3 gtk-osx-application-gtk3 adwaita-icon-theme libsigcxx2 lcms2 libiptcdata fftw-3-single lensfun</code>
:: <code>sudo port install git cmake clang-11 libomp gtk3 gtkmm3 gtk-osx-application-gtk3 adwaita-icon-theme libsigcxx2 lcms2 libiptcdata fftw-3-single lensfun</code>
: If compiling on Xcode 9.2 you will also need to do:
: If compiling on Xcode 9.2 you will also need to do:
:: <code>sudo port instal ld64 +ld64_xcode</code>
:: <code>sudo port install ld64 +ld64_xcode</code>


=== libiconv patch ===
* '''Configuring compile system for MacPorts'''
libiconv.2.dylib must be patched, otherwise RawTherapee will crash on startup. The patch is available in [https://github.com/Beep6581/RawTherapee/blob/dev/tools/osx/libiconv_1.15_rt.patch `tools/osx/libiconv_1.15_rt.patch`]
: To your <code>cmake</code> command add the following flag:
:: <code>-DLOCAL_PREFIX:STRING="/opt/local"</code>


libiconv patching and compilation instructions:
== Compiling ==
<pre style="white-space: pre-wrap">
 
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
See the [[Linux#Compiling:_The_Manual_Way|Compiling in Linux]] article for instructions on how to '''clone''' the source code, choose a '''branch''' and how to configure '''CMake'''. Ignore the '''''Now you are ready to compile''''' code on that page and follow the code on this page.
tar xf libiconv-1.15.tar.gz
 
cd libiconv-1.15
RawTherapee is compiled by the '''clang''' compiler. It may come with XCode or be installed as a part of '''llvm'''. Be advised that Apple uses a versioning scheme for '''Apple clang''' which is inconsistent with '''llvm clang'''. To figure out which compiler to use, check your system compiler first:
wget https://raw.githubusercontent.com/Beep6581/RawTherapee/dev/tools/osx/libiconv_1.15_rt.patch
patch -p1 < libiconv_1.15_rt.patch
mkdir build
cd build
buildDir="$(pwd)"
../configure --prefix=/opt/local --disable-static 'CFLAGS=-arch x86_64 -mmacosx-version-min=10.9' 'LDFLAGS=-arch x86_64 -mmacosx-version-min=10.9' CXXFLAGS="-arch x86_64 -mmacosx-version-min=10.9"
make
make DESTDIR="$buildDir" install
cd /opt/local/lib
sudo cp ./libiconv.2.dylib ./libiconv.2.dylib.backup # backup MacPorts dylib
sudo cp "${buildDir}/opt/local/lib/libiconv.2.dylib" /opt/local/lib/libiconv.2.dylib
</pre>


=== Distribution Bundle Framework Library Versions in 5.5-dev ===
<div style="margin-left: 2em;"><pre>
-> which clang
/usr/bin/clang


{| class="wikitable"
-> /usr/bin/clang --version
|-
Apple clang version 11.0.0 (clang-1100.0.33.17)
! package
Target: x86_64-apple-darwin18.7.0
! 5.5 version
Thread model: posix
! status
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
! 5.6 version
</pre>
! status
</div>
! 5.6-dev version
! status
|-
|gtk+
| 3.22.26-168-g63f534f4b3
| on branch gtk-3-22
| 3.22.30
| prev. 3.24.0
| 3.24.8
|
|-
|gtkmacintegration-gtk3
| 2.0.8
|
|
|
| 2.1.3-6-g3e1d4a3
|
|-
|gdk-pixbuf
|2.36.11
|
|
|
|2.38.0-115-g0b959ad2e
|
|-
|cairo
| 1.14.8
|PATCHED[https://github.com/Beep6581/RawTherapee/issues/3882#issuecomment-311703141]
|
|
| 1.17.2
| patch applies
|-
|cairomm
| 1.12.2
|
|
|
| cairomm-1-14
|
|-
|cairo-gobject
| 1.14.10
|
|
|
| 1.17.2
|
|-
|pango
| 1.40.12
|
| 1.42.4
|
| 1.43.0
|
|-
|pangomm
| 2.40.1
|
|
|
| 2.42.0
|
|-
|gtkmm
| 3.22.2
|
|
|
| 3.24.1
|
|-
|atk
| 2.26.1
|
|
|
| ATK_2_31_92-5-ga2bff76
| master
|-
|atkmm
| 2.24.2
|
|
|
|
|
|-
|glib/gio
| 2.54.2
|
|
|
| 2.59.3
|
|-
|glibmm/giomm
| 2.54.1-15-ge9330a8e
| On branch `glibmm-2-54`
|
|
| 2.56.1
|
|-
|libsigc++-2.0
| 2.10.0
|
|
|
| 2.10.1
|
|-
|TIFF
| 4.0.9
|
|
|
|
|
|-
|pixman
| 0.34.0
|
|
|
| `pixman-0.38.4`
|
|-
|PNG
| `1.6.33`
|
|
|
| `1.6.37`
|
|-
|expat
| `2.2.4`
|
|
|
| R_2_2_6-61-g5e2859f
| `master`
|-
|lcms2
| `2.8`
|
|
|
| lcms2.9rc1-45-g65c63bf
| `master`
|-
|JPEG
| `9b`
|
|
|
| `8.4.0-4-g6c0fcb8`
| master
|-
|harfbuzz
| 1.4.7
|
|
|
| 2.4.0-3-gb292772e
|
|-
|epoxy
| 1.4.3
|
|
|
| 1.5.3-4-gd536f78
|
|-
|pcre
| 8.4.1
|
|
|
| 8.4.2
| master
|-
|lensfun
| 0.3.2.0
|
|
|
| v0.3.95-221-g8de8fbb7
| master
|-
|libiconv2
| 1.15
| [[#libiconv_patch|PATCHED]]
|
|
|
|
|-
|iptcdata
| 1.0.4
|
|
|
|
|
|-
|fontconfig
| 2.12.4
|
|
|
| 2.13.1-81-gfd2e155
| master
|-
|freetype2
| 20.0.14
|
|
|
| VER-2-10-0-15-gd74106e23
| master
|-
|libz
| 1.2.11
|
|
|
| system libz
|
|-
|graphite2
| 1.3.0.1
|
|
|
| 1.3.13
|
|-
|fftw
| 3.3.7
|
|
|
|
|
|-
|libffi
| 3.2.1
|
|
|
| v3.3-rc0-36-gd1e9b4b
|
|-
|libiomp5
| 20160808_oss[https://github.com/Beep6581/RawTherapee/issues/3971#issuecomment-315643878]
| REPLACES libomp from clang [https://github.com/Beep6581/RawTherapee/issues/3971]
|
|
|
|
|}


== Compiling ==
If you see '''Apple clang''' mentioned in the top line of the '''clang''' version output, note the version number it specifies and refer to [https://en.wikipedia.org/wiki/Xcode#Xcode_7.0_-_12.x_(since_Free_On-Device_Development) this Wikipeda table] for the mapping between '''Apple clang''' and '''llvm clang''' versions. This knowledge may be useful when tracing any compilation errors.
See the [[Linux#Compiling:_The_Manual_Way|Compiling in Linux]] article for instructions on how to '''clone''' the source code, choose a '''branch''' and how to configure '''CMake'''. Ignore the "Now you are ready to compile" code on that page and follow the code on this page.


If you want to upload a build or otherwise share it with others, you must use
If you want to upload a generic `x86_64` build or otherwise share it with others, you must use
: <code>-DPROC_TARGET_NUMBER="1"</code>
: <code>-DPROC_TARGET_NUMBER="1"</code>
and set the processor label manually by setting
and set the processor label manually by setting
: <code>-DPROC_LABEL="generic processor"</code>
: <code>-DPROC_LABEL="generic processor"</code>


If you want to compile for yourself only, then use
If you want to compile a CPU-optimized for yourself only, or build for the Apple `M1`, then use
: <code>-DPROC_TARGET_NUMBER="2"</code>
: <code>-DPROC_TARGET_NUMBER="2"</code>
and then the processor label would be irrelevant, you could skip it.
and then the processor label would be irrelevant, you could skip it.


If you wish to [https://developer.apple.com/support/code-signing/ codesign] your build, add your details to the CMake command:
If you wish to [https://developer.apple.com/support/code-signing/ codesign] your build, add your details to the CMake command:
: <code>-DCODESIGNID:STRING="Developer ID Application: Firstname Lastname (XXXXXXXXXX)"</code>
: <code>-DCODESIGNID="Developer ID Application: Firstname Lastname (XXXXXXXXXX)"</code>
The app and the generated <code>dmg</code> will be codesigned.
The app and the generated dmg (Apple Disk Image) will be codesigned.


To [https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution/customizing_the_notarization_workflow?language=objc notarize] your codesigned build, include your app-specific notarial credential in the CMake command:
To [https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution/customizing_the_notarization_workflow?language=objc notarize] your codesigned build, include your app-specific notarial credential in the CMake command:
: <code>-DNOTARY:STRING="--username user@mail.com --password abcd-efgh-ijkl-mnop"</code>
: <code>-DNOTARY="--username user@mail.com --password abcd-efgh-ijkl-mnop"</code>
The app and dmg will be notarized (scanned for malware) and stapled (have the notarization ticket attached).
The app and dmg will be notarized (scanned for malware) and stapled (have the notarization ticket attached).


=== Compile RawTherapee ===
=== Compile RawTherapee ===
Now you are ready to compile:
Now you are ready to compile:
<pre style="white-space: pre-wrap">cd ~/repo-rt
<pre style="white-space: pre-wrap">cd ~/repo-rt
rm -rf build
rm -rf build
mkdir build && cd build
mkdir build && cd build
lensfun-update-data
cmake -DCMAKE_BUILD_TYPE="release" \
cmake -DCMAKE_BUILD_TYPE="release" \
       -DPROC_TARGET_NUMBER="1" \
       -DPROC_TARGET_NUMBER="1" \
       -DPROC_LABEL="generic processor" \
       -DPROC_LABEL="generic processor" \
       -DCACHE_NAME_SUFFIX="5-dev" \
       -DCACHE_NAME_SUFFIX="5-dev" \
       -DCMAKE_C_COMPILER="clang-mp-3.9" \
       -DCMAKE_C_COMPILER="clang" \
       -DCMAKE_CXX_COMPILER="clang++-mp-3.9" \
       -DCMAKE_CXX_COMPILER="clang++" \
       -DWITH_LTO="OFF" \
       -DWITH_LTO="OFF" \
       -DLENSFUNDBDIR="./share/lensfun" \
       -DLENSFUNDBDIR="share/lensfun" \
      -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
       ..
       ..
make -j4 install
make -j$(sysctl -n hw.ncpu) install
make macosx_bundle
sudo make macosx_bundle
</pre>
</pre>
<hr>
 
If you are compiling with homebrew dependencies w/llvm clang 8, use the following cmake command:
To compile RawTherapee with a specific llvm '''clang''' version (e.g. installed via homebrew), use the following '''cmake''' command. When doing so, make sure these settings point to the appropriate paths:
<pre style="white-space: pre-wrap">
 
* Using llvm 10 from homebrew:
 
<div style="margin-left: 2em;"><pre>
  -DCMAKE_C_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang"
  -DCMAKE_CXX_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang++"
  -DCMAKE_AR="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ar"
  -DCMAKE_RANLIB="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ranlib"
</pre></div>
 
* The '''cmake''' command:
 
<div style="margin-left: 2em;"><pre>
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig && \
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig && \
cmake  .. -DCMAKE_BUILD_TYPE="release" \
cmake  .. -DCMAKE_BUILD_TYPE="release" \
           -DPROC_TARGET_NUMBER="2" \
           -DPROC_TARGET_NUMBER="2" \
           -DCACHE_NAME_SUFFIX="5.6-dev" \
           -DCACHE_NAME_SUFFIX="5.8-dev" \
           -DCMAKE_C_COMPILER="clang"\
           -DCMAKE_C_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang" \
           -DCMAKE_CXX_COMPILER="clang++" \
           -DCMAKE_CXX_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang++" \
           -DWITH_LTO="ON" \
           -DWITH_LTO="ON" \
           -DLENSFUNDBDIR="./share/lensfun" \
           -DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \
           -DCMAKE_BUILD_TYPE=Release \
           -DCMAKE_BUILD_TYPE=Release \
           -DOpenMP_C_FLAGS=-fopenmp=libomp \
           -DOpenMP_C_FLAGS=-fopenmp=libomp \
Line 384: Line 132:
           -DOpenMP_CXX_LIB_NAMES="libomp" \
           -DOpenMP_CXX_LIB_NAMES="libomp" \
           -DOpenMP_libomp_LIBRARY="/usr/local/lib/libomp.dylib" \
           -DOpenMP_libomp_LIBRARY="/usr/local/lib/libomp.dylib" \
           -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include" \
           -DOpenMP_CXX_FLAGS="-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include" \
           -DOpenMP_CXX_LIB_NAMES="libomp" \
           -DOpenMP_CXX_LIB_NAMES="libomp" \
           -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include" \
           -DOpenMP_C_FLAGS="-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include" \
           -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
           -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
           -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/opt/libffi/lib -L/usr/local/lib" \
           -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/opt/libffi/lib -L/usr/local/lib" \
           -DCMAKE_AR="/usr/local/Cellar/llvm/8.0.0/bin/llvm-ar" \
           -DCMAKE_AR="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ar" \
           -DCMAKE_RANLIB="/usr/local/Cellar/llvm/8.0.0/bin/llvm-ranlib"
           -DCMAKE_RANLIB="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ranlib" \
</pre>
          -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
</pre></div>


=== From-Scratch Method ===
=== From-Scratch Method ===
* This [https://raw.githubusercontent.com/Benitoite/RTdeps/master/macbuildRT.sh] complete list of commands may optionally be used to perform a from-scratch build of RawTherapee and its dependencies on macOS 10.14.5 / Xcode 10.2.
 
* A JDK[https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html] must be installed.
* This [https://raw.githubusercontent.com/Benitoite/RTdeps/master/macbuildRT.sh] complete list of commands may optionally be used to perform a from-scratch build of RawTherapee and its dependencies on macOS 10.15.3 / Xcode 11.
* Xcode 10.2 [https://developer.apple.com/xcode] must be installed
* A JDK[https://www.oracle.com/technetwork/java/javase/downloads/jdk13-downloads-5672538.html] must be installed.
<hr>
* Xcode 11.1+ [https://developer.apple.com/xcode] must be installed


=== Run and Share RawTherapee ===
=== Run and Share RawTherapee ===
You will find a disk image in the build directory; this is the distribution release and can be run on any machine which meets the architecture requirements you specified in variants.conf earlier.
You will find a disk image in the build directory; this is the distribution release and can be run on any machine which meets the architecture requirements you specified in variants.conf earlier.


To provide the RawTherapee project with your build, please zip the .dmg and AboutThisBuild.txt files together. Name the zip file according to this template:
The generated zip file is named according to this template:
: RawTherapee_OSX_'''<minimum supported macOS version>'''_64_'''<RawTherapee version>'''.zip
: RawTherapee_OSX_'''<minimum supported macOS version>'''_64_'''<RawTherapee version>'''.dmg.zip  
for example if your build is made for macOS 10.12 and the version of RawTherapee is 5.2-dev-g1a2b3c4d, name it:
: RawTherapee_OSX_10.9_64_5.8-94-g4dbbc4053.dmg.zip
: RawTherapee_OSX_10.12_64_5.2-dev-g1a2b3c4d.zip
 
Upload the zip archive to http://filebin.net/ and [https://github.com/Beep6581/RawTherapee/issues/new open a new issue on our GitHub page] with the link so that we can upload it to the website.
Upload the zip archive to http://filebin.net/ and [https://github.com/Beep6581/RawTherapee/issues/new open a new issue on our GitHub page] with the link so that we can upload it to the website.


==== macOS 10.15 ====
== macOS installation ==
* To run RawTherapee on macOS 10.15 ''Catalina'' you must:
 
** Copy app to and run from the <code>/Applications</code> folder
To install the RawTherapee application, open the .dmg and drag the RawTherapee app onto the <code>/Applications</code> folder.
** Add <code>/bin/sh</code> to ''System Preferences''>''Security&Privacy''>''Privacy''>''Full Disk Access''
 
*** You will be prompted to automatically add <code>/bin/sh</code> into the ''Security&Privacy'' settings the first time you run the program.
To use the optional rawtherapee-cli command line interface, move rawtherapee-cli into a folder in your $PATH and install the RawTherapee app as above.
 
If the workspace is too small to read, you must change the HiDPI settings in RawTherapee:
Preferences > General, then enable pseudo HiDPI mode. [https://rawpedia.rawtherapee.com/Preferences#Appearance]

Latest revision as of 22:34, 12 February 2024

MacOS

This page details instructions for compiling RawTherapee on macOS systems. There are also separate pages with instructions for compiling on Linux and Windows. This guide details the what and how parts of compilation. For the why and explanations of these commands, for a list of dependencies, CMake options and other information, please refer to the detailed Linux article.

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

For instructions on cloning the source, choosing branches, configuring CMake and doing the actual compilation, see these sections in the Linux guide. The information below is in addition to that.

Dependencies

See the list of dependencies in the Compiling in Linux article.

Homebrew

The following command installs dependencies for RawTherapee: brew install gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++ little-cms2 libiptcdata fftw lensfun wget llvm cmake expat pkgconfig shared-mime-info

  • Configuring the homebrew build environment for Apple Silicon "M1"
To your cmake command add the following flags:
-DLOCAL_PREFIX:STRING="/opt/homebrew"
-DCMAKE_OSX_ARCHITECTURES=arm64

MacPorts

Warning Warning: If you want to use Homebrew to manage prerequisite libraries, do not use MacPorts or issue any sudo port commands.

Tested on OS X 10.9-12.

  • Prerequisites
    • Xcode Developer Tools & Command Line Tools
    • MacPorts
      • Detailed instructions on setting up MacPorts and the developer tools are available on the MacPorts website.
  • Configure MacPorts:
Add the following line to /opt/local/etc/macports/variants.conf
+quartz -x11 -gnome +openmp
  • Dependencies
To install the dependencies, run from the terminal:
sudo port install git cmake clang-11 libomp gtk3 gtkmm3 gtk-osx-application-gtk3 adwaita-icon-theme libsigcxx2 lcms2 libiptcdata fftw-3-single lensfun
If compiling on Xcode 9.2 you will also need to do:
sudo port install ld64 +ld64_xcode
  • Configuring compile system for MacPorts
To your cmake command add the following flag:
-DLOCAL_PREFIX:STRING="/opt/local"

Compiling

See the Compiling in Linux article for instructions on how to clone the source code, choose a branch and how to configure CMake. Ignore the Now you are ready to compile code on that page and follow the code on this page.

RawTherapee is compiled by the clang compiler. It may come with XCode or be installed as a part of llvm. Be advised that Apple uses a versioning scheme for Apple clang which is inconsistent with llvm clang. To figure out which compiler to use, check your system compiler first:

-> which clang
/usr/bin/clang

-> /usr/bin/clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

If you see Apple clang mentioned in the top line of the clang version output, note the version number it specifies and refer to this Wikipeda table for the mapping between Apple clang and llvm clang versions. This knowledge may be useful when tracing any compilation errors.

If you want to upload a generic `x86_64` build or otherwise share it with others, you must use

-DPROC_TARGET_NUMBER="1"

and set the processor label manually by setting

-DPROC_LABEL="generic processor"

If you want to compile a CPU-optimized for yourself only, or build for the Apple `M1`, then use

-DPROC_TARGET_NUMBER="2"

and then the processor label would be irrelevant, you could skip it.

If you wish to codesign your build, add your details to the CMake command:

-DCODESIGNID="Developer ID Application: Firstname Lastname (XXXXXXXXXX)"

The app and the generated dmg (Apple Disk Image) will be codesigned.

To notarize your codesigned build, include your app-specific notarial credential in the CMake command:

-DNOTARY="--username user@mail.com --password abcd-efgh-ijkl-mnop"

The app and dmg will be notarized (scanned for malware) and stapled (have the notarization ticket attached).

Compile RawTherapee

Now you are ready to compile:

cd ~/repo-rt
rm -rf build
mkdir build && cd build
lensfun-update-data
cmake -DCMAKE_BUILD_TYPE="release" \
      -DPROC_TARGET_NUMBER="1" \
      -DPROC_LABEL="generic processor" \
      -DCACHE_NAME_SUFFIX="5-dev" \
      -DCMAKE_C_COMPILER="clang" \
      -DCMAKE_CXX_COMPILER="clang++" \
      -DWITH_LTO="OFF" \
      -DLENSFUNDBDIR="share/lensfun" \
      -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
      ..
make -j$(sysctl -n hw.ncpu) install
sudo make macosx_bundle

To compile RawTherapee with a specific llvm clang version (e.g. installed via homebrew), use the following cmake command. When doing so, make sure these settings point to the appropriate paths:

  • Using llvm 10 from homebrew:
  -DCMAKE_C_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang"
  -DCMAKE_CXX_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang++"
  -DCMAKE_AR="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ar"
  -DCMAKE_RANLIB="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ranlib"
  • The cmake command:
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig && \
cmake  .. -DCMAKE_BUILD_TYPE="release" \
          -DPROC_TARGET_NUMBER="2" \
          -DCACHE_NAME_SUFFIX="5.8-dev" \
          -DCMAKE_C_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang" \
          -DCMAKE_CXX_COMPILER="/usr/local/Cellar/llvm/10.0.1_1/bin/clang++" \
          -DWITH_LTO="ON" \
          -DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \
          -DCMAKE_BUILD_TYPE=Release \
          -DOpenMP_C_FLAGS=-fopenmp=libomp \
          -DOpenMP_CXX_FLAGS=-fopenmp=libomp \
          -DOpenMP_C_LIB_NAMES="libomp" \
          -DOpenMP_CXX_LIB_NAMES="libomp" \
          -DOpenMP_libomp_LIBRARY="/usr/local/lib/libomp.dylib" \
          -DOpenMP_CXX_FLAGS="-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include" \
          -DOpenMP_CXX_LIB_NAMES="libomp" \
          -DOpenMP_C_FLAGS="-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include" \
          -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
          -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/opt/libffi/lib -L/usr/local/lib" \
          -DCMAKE_AR="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ar" \
          -DCMAKE_RANLIB="/usr/local/Cellar/llvm/10.0.1_1/bin/llvm-ranlib" \
          -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15

From-Scratch Method

  • This [1] complete list of commands may optionally be used to perform a from-scratch build of RawTherapee and its dependencies on macOS 10.15.3 / Xcode 11.
  • A JDK[2] must be installed.
  • Xcode 11.1+ [3] must be installed

Run and Share RawTherapee

You will find a disk image in the build directory; this is the distribution release and can be run on any machine which meets the architecture requirements you specified in variants.conf earlier.

The generated zip file is named according to this template:

RawTherapee_OSX_<minimum supported macOS version>_64_<RawTherapee version>.dmg.zip
RawTherapee_OSX_10.9_64_5.8-94-g4dbbc4053.dmg.zip

Upload the zip archive to http://filebin.net/ and open a new issue on our GitHub page with the link so that we can upload it to the website.

macOS installation

To install the RawTherapee application, open the .dmg and drag the RawTherapee app onto the /Applications folder.

To use the optional rawtherapee-cli command line interface, move rawtherapee-cli into a folder in your $PATH and install the RawTherapee app as above.

If the workspace is too small to read, you must change the HiDPI settings in RawTherapee: Preferences > General, then enable pseudo HiDPI mode. [4]