system
(system)
December 22, 2017, 1:48pm
1
darktable has been software of my choice for raw photo development for quite some time now, I’ve occasionally submitted bug reports and patches and kept an eye on current development by using git master version. My main operating system is Linux, which is the priority target of darktable support, but recently I bought MacBook Air to take with me on trips and such. Also my current project at work consists of porting a library to OS X, so this presented to me as a great opportunity to contribute to one of my favorite open-source projects and make darktable work reliably on Macs.
This is a companion discussion topic for the original entry at https://www.darktable.org/2012/08/bringing-current-darktable-to-os-x/
adcox
(Andrew Cox)
January 18, 2018, 2:45am
2
A few notes:
You need to run git submodule init
and git submodule update
before building and installing.
I also had to install the pugixml
package with MacPorts
I haven’t got it running (a slew of GLX, GLib errors…), but I’ll file a bug report and see what the devs think.
HIRAM
(Richard E Barber)
January 18, 2018, 7:09pm
3
To compile openmp enabled rawtherapee I use clang 3 9 1 (MacPorts); it is compatible and ships with libomp
, and I go a step further and uninstall libomp
and build libiomp5
in its stead. libomp
might work ok for dt though. To get openmp support, I set in the environment variables the compilers to clang-mp-3.9
and clang++-mp-3.9
EsTaF
(Дмитрий)
May 20, 2022, 7:26am
4
I like the two dots after “cmake” ))
Thanks all the same.
the current description ist darktable/BUILD.txt at master · darktable-org/darktable · GitHub
if you want to build for m1 then have a look at
opened 10:09PM - 07 Dec 21 UTC
scope: usermanual
This is primarily a request for help to find an easy and working way for newbies… to build a full grown darktable from sources on macOS by providing dependencies via homebrew. If this is not considered off-topic at this place, I would propose to close it as soon as everything has been clarified.
For reasons of simplicity, I would like to limit this at the beginning to Intel-based (i386) Macs in contrast to M1-based (arm) Macs. Note that there is a dedicated issue to make this work for M1: https://github.com/darktable-org/darktable/issues/7564
In my case I am doing this on macOS 12.0.1 (Monterey).
When building for this platform you are basically left with two options:
- Using macports as described within this file: https://github.com/darktable-org/darktable/blob/master/packaging/macosx/BUILD.txt
- Using homebrew as described here: https://github.com/darktable-org/darktable/issues/7564#issuecomment-752679349
The macOS community of darktable has put a tremendous effort in making it built and providing a very well-working DMG image based on macports. Thanks a lot, really highly appreciated!
Still, as newbie I am slightly overwhelmed by the number of steps to take and all the diffs that must be applied. In addition if you are used to a different package manager than macports, you normally do not want to switch (back).
I recently discovered that there is also the opportunity to build on basis of homebrew which I want to detail out subsequently.
1. Assuming that you have homebrew up and running, you first want to doublecheck if you have the latest packages installed:
```
brew update && brew upgrade
```
2. You then need to install all the dependencies of darktable:
```
brew install adwaita-icon-theme cmake desktop-file-utils exiv2 gettext git glib gmic gphoto2 graphicsmagick gtk+3 gtk-mac-integration icu4c intltool iso-codes json-glib lensfun libavif libheif librsvg libsecret libsoup@2 little-cms2 lua libomp ninja openexr openjpeg osm-gps-map portmidi pugixml sdl2 cmocka curl perl jpeg llvm po4a
```
3. You then go to the root of the cloned darktable repository and build it. In my case I decided to put the binaries into ~/bin/darktable-dev:
```
./build.sh --install --build-type RelWithDebInfo --prefix ~/bin/darktable-dev
```
4. If the built completed without any issue - like in my case - the final step is to run it. As I do not want to mess with my stable/productive darktable environment, I am passing dedicated/separate config and cache directories which are residing within the same directory:
```
~/bin/darktable-dev/bin/darktable --configdir ~/bin/darktable-dev/.config/darktable/ --cachedir ~/bin/darktable-dev/.cache/darktable/
```
Great! That was easy. I just did some basic tests and it seems to work.
Still I discovered some things where I am not sure how to take them or what they mean in the end = do I need them for the perfect darktable experience?
When reviewing the build log, I see the following messages:
```
-- The following OPTIONAL packages have not been found:
* LLVM (required version >= 3.9)
* LibSoup2
* ICU
* OSMGpsMap
* Colord
```
That is strange. Beside Colord, homebrew includes these packages. Why have they not been found? I suspect that I need to somehow pass the correct library location to the build procedure. How do I do that?
When running `darktable --version` I also realize the following:
```
ImageMagick support disabled
```
Again, strange. Homebrew also offers imagemagick. Same question as above.
or
darktable-org:master
← apfelkraut:master
opened 07:54PM - 20 Apr 22 UTC
These proposed changes should help to build a darktable dmg image for macOS usin… g Homebrew and independent of the chip architecture.
It is based on the discussion around building darktable on macOS using Homebrew, for details see https://github.com/darktable-org/darktable/issues/10583.
It allows building darktable for M1 (arm64), creating a darktable application bundle, and a dmg image as requested/discussed here https://github.com/darktable-org/darktable/issues/7564. It allows building the same for Intel (i386).
It was developed and tested on macOS 12.3.1 ("Monterey") running on a M1 MacbookAir.
For details see the included BUILD_hb.txt.
LIMITATIONS
- Created DMG will only be compatible to the macOS version it was created upon (and potentially any later version).
- Naturally the libraries that darktable is built upon will be as good as its currently provided homebrew packages. You might want to use "$ brew pin <package>" to lock your working/verified setup.
- As of today homebrew ships lensfun 0.3.3 that is the successor of the last stable release 0.3.2. It is expected to be compatible and should not break existing edits based on 0.3.2 or before.
- For now additional darktable tools like darktable-curve-tool or darktable-noiseprofile are not part of the default application bundle.
MACOS SECURITY
- The DMG is not notarized with/at Apple by using this approach. If it is still required see the official BUILD.txt for further instructions.
- As the DMG is not notarized and the app bundle may not even be properly signed, it is still possible to install/run darktable at your own risk. To do so make sure to run "$ xattr -d com.apple.quarantine <darktable-app>.dmg" on the DMG before installing.
NOTES
- It will be automatically build for the architecture you are currently on, either Apple Silicon (arm64) or Intel (i386).
- If you want to build for i386 on arm64 see https://stackoverflow.com/questions/64951024/how-can-i-run-two-isolated-installations-of-homebrew/68443301#68443301 about how to handle both enviroments in parallel.
- After creating the darktable application bundle (step 3) you can directly run the result by executing:
$ package/darktable.app/Contents/MacOS/darktable --configdir .config/darktable/ --cachedir .cache/darktable/
REFERENCES
This approach is heavily based on and inspired by:
- The official BUILD.txt instructions (MacPorts-based) by the darktable community
- http://clarkkromenaker.com/post/library-dynamic-loading-mac/
- https://gitlab.gnome.org/GNOME/gtk-mac-bundler
- https://github.com/auriamg/macdylibbundler/
EsTaF
(Дмитрий)
May 20, 2022, 10:08am
7
Is the glib library something of a non-hombrew installation?
brew update && brew upgrade
brew install adwaita-icon-theme cmake desktop-file-utils exiv2 gettext git glib gmic gphoto2 graphicsmagick gtk+3 gtk-mac-integration icu4c intltool iso-codes json-glib lensfun libavif libheif librsvg libsecret libsoup@2 little-cms2 lua libomp ninja openexr openjpeg osm-gps-map portmidi pugixml sdl2 cmocka curl perl jpeg llvm po4a
mkdir ~/src
cd ~/src
git clone --recurse-submodules https://github.com/darktable-org/darktable.git
cd darktable
$ ./build.sh --install --build-type RelWithDebInfo --prefix ~/bin/darktable-dev
…
– Checking for -std=c++14 support - works
CMake Error at cmake/modules/LibFindMacros.cmake:272 (message):
REQUIRED PACKAGE NOT FOUND
We could not find development headers for Glib. Do you have the necessary
dev package installed? This package is REQUIRED and you need to install it
or adjust CMake configuration in order to continue building darktable.
Relevant CMake configuration variables:
Glib_INCLUDE_DIR=<not found>
GlibConfig_INCLUDE_DIR=<not found>
Glib_LIBRARY=<not found>
You may use CMake GUI, cmake -D or ccmake to modify the values. Delete
CMakeCache.txt to discard all values and force full re-detection if
necessary.
Call Stack (most recent call first):
cmake/modules/FindGlib.cmake:40 (libfind_process)
src/CMakeLists.txt:296 (find_package)
How to change this configuration in cmake, nobody knows?