building darktable on MacOS

Hi,

I have an user who would like to build darktable master on Mac OS but doesn’t find a comprehensive list of commands and operations to do so. I have never used Mac OS myself so I’m of little help.

I know @MStraeten builds on Win/Mac fluently, would you mind posting a short guide to get him started ? Thanks !

There is a guide in the source code that was updated semi recently.

darktable/BUILD.txt at master · darktable-org/darktable · GitHub can be used as a step by step instruction

2 Likes

Thanks ! Forwarding…

I did a brew formula some time ago. I’ll look for it and share with you here.

Probably need to be updated.

1 Like

I’ve it in that repository: GitHub - rgo/homebrew-core at darktable-2.2.4

If your friend is not in a hurry, I’ll update it for current darktable and update the documentation with the usage of this formula during the weekend.

@LebedevRI and I tried to include darktable in homebrew but it didn’t “fit” (https://github.com/Homebrew/homebrew-core/pull/13407).

Good night
I’ll keep you informed

1 Like

Thanks ! It will be useful in general to have a full manual/procedure to build for power-users-who-are-still-not-devs.

1 Like

I’ve been working on it a little. First try…


(A lot of noise because debug and verbose is enabled)

Now I’ve to go out, I hope to finish it this night. I’ll tell you :slight_smile:

Updated: It failed. I’m checking the logs.

@LebedevRI @MStraeten Hi, calling for a little help.

I have been updating an old brew formula (for version 2.2.4) but I’ve a problem making osx.mm files:

$ brew install darktable
==> Installing darktable from rgo/darktable
==> Downloading https://raw.pixls.us/getfile.php/1033/nice/homebrew.raw
Already downloaded: /Users/foobar/Library/Caches/Homebrew/downloads/c5d007c5da32ffe4478c81f914e0cab587e5bb14ca893c1b7201264f280b7ade--homebrew.raw
==> Downloading https://github.com/darktable-org/darktable/releases/download/release-3.0.2/darktable-3.0.2.tar.xz
Already downloaded: /Users/foobar/Library/Caches/Homebrew/downloads/bf8e44d1ca1e55a584a08799768b44118464f53305cf6d6a773120fe5520b18d--darktable-3.0.2.tar.xz
==> cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DBINARY_PACKAGE_BUILD=ON -DRAWSPEED_ENABLE_LTO=ON -DBUILD_CURVE_TOOLS=ON -
==> make
Last 15 lines from /Users/foobar/Library/Logs/Homebrew/darktable/02.make:
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSFormCell.h:30:1: error: misplaced '@property' Objective-C++ construct
   30 | @property NSWritingDirection titleBaseWritingDirection;
      | ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:44,
                 from /tmp/darktable-20200628-60562-celo7s/darktable-3.0.2/src/osx/osx.mm:22:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSFormCell.h:39:1: error: misplaced '@property' Objective-C++ construct
   39 | @property CGFloat preferredTextFieldWidth API_AVAILABLE(macos(10.8));
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSFormCell.h:43:35: error: cannot find interface declaration for 'NSFormCell'
   43 | @interface NSFormCell(NSKeyboardUI)
      |                                   ^
make[2]: *** [src/CMakeFiles/lib_darktable.dir/osx/osx.mm.o] Error 1
make[1]: *** [src/CMakeFiles/lib_darktable.dir/all] Error 2
make: *** [all] Error 2

Could it be that it’s trying compile it with the system compiler instead of use brew’s compiler (or vice-versa) or something like that?

Thanks

I didnt use homebrew to build darktable so i doubt i can give any qualified help … and even worse: i’m lost in space if the build environment is not bulletproof :wink:
I’m using the instructions valid for macports - i just followed the steps and it worked fine for me.
Btw: The macports way uses the apple system compiler

Btw: The macports way uses the apple system compiler

That’s a good hint, I’ll review it.
Thanks! :slight_smile:

I have a version that compiles relase 3.0.2

image

I’m going to add head right now and tomorrow or later I’ll document how to user it (a.k.a. 0compile a different branch or commit).

Hi @dterrahe and @Pascal_Obry,

I’m having problems generating introspections from current master:

[ 60%] Generating introspection_levels.c
cd /tmp/darktable-20200629-29562-ek30c2/tools/introspection && /usr/bin/perl /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl /tmp/darktable-20200629-29562-ek30c2/src/iop/../ /tmp/darktable-20200629-29562-ek30c2/src/iop/levels.c /tmp/darktable-20200629-29562-ek30c2/build/src/iop/introspection_levels.c
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}{raw"
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}}"
Compilation failed in require at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
BEGIN failed--compilation aborted at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}{raw"
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}}"
Compilation failed in require at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
BEGIN failed--compilation aborted at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}{raw"
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}}"
Compilation failed in require at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
BEGIN failed--compilation aborted at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}{raw"
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}}"
Compilation failed in require at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
BEGIN failed--compilation aborted at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}{raw"
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}}"
Compilation failed in require at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
BEGIN failed--compilation aborted at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}{raw"
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}}"
Compilation failed in require at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
BEGIN failed--compilation aborted at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}{raw"
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}}"
Compilation failed in require at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
BEGIN failed--compilation aborted at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}{raw"
syntax error at /private/tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pm line 74, near "}}"
Compilation failed in require at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
BEGIN failed--compilation aborted at /tmp/darktable-20200629-29562-ek30c2/tools/introspection/parser.pl line 31.
make[2]: make[2]: *** [src/iop/introspection_negadoctor.c] Error 255
make[2]: *** [src/iop/introspection_toneequal.c] Error 255
*** [src/iop/introspection_lut3d.c] Error 255
make[2]: *** [src/iop/introspection_denoiseprofile.c] Error 255
make[2]: *** [src/iop/introspection_levels.c] Error 255
make[2]: *** [src/iop/introspection_filmic.c] Error 255
make[2]: *** [src/iop/introspection_hazeremoval.c] Error 255
make[1]: *** [src/iop/CMakeFiles/lut3d.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [src/iop/CMakeFiles/denoiseprofile.dir/all] Error 2
make[1]: *** [src/iop/CMakeFiles/levels.dir/all] Error 2
make[1]: *** [src/iop/CMakeFiles/toneequal.dir/all] Error 2
make[2]: *** [src/iop/introspection_finalscale.c] Error 255make[1]:
*** [src/iop/CMakeFiles/negadoctor.dir/all] Error 2
make[1]: *** [src/iop/CMakeFiles/hazeremoval.dir/all] Error 2
make[1]: *** [src/iop/CMakeFiles/filmic.dir/all] Error 2
make[1]: *** [src/iop/CMakeFiles/finalscale.dir/all] Error 2
make: *** [all] Error 2

The conflictive line can be found here: darktable/parser.pm at master · darktable-org/darktable · GitHub
(not changed recently).

Have you got any clue to fix it?

Thanks

PS: Sorry for asking here and IRC but I had to disconnect.

houz is the perl master, but I’m not seeing issues like this.

Are you up-to-date with perl (and libraries)? v5.30.3 runs the code fine here.

I have installed perl 5, version 18, subversion 4 (v5.18.4).
Checking perl.org is from… 2014!!! - Perl 5.18.4 Release Announcement - dev.perl.org :man_facepalming:t2:

This night, I’ll add (up to date)perl as dependency too.

Thanks!

Update: I couldn’t resist and I’m trying it :grimacing:

It worked, yeahhh!!

image

@anon41087856 I think it’s ready to be tested.

You can find it here: GitHub - rgo/homebrew-darktable: Darktable formula to have a manual/procedure to build it for power-users-who-are-still-not-devs.

Now, it’s possible to deploy latest commit (head) or 3.0.2 easily.

I’ll document how to specify branches and commits by hand(FAQ — Homebrew Documentation), and later I’ll try to make it with arguments if it worth the effort.

Bye!

1 Like

Maybe you can also add gmic as a dependency so the 3dlut module can use the gmic luts

1 Like

Thanks, great idea. I’ll add it when I achieve to load some nef files (it’s crashing).

I’m afraid I’ve to review all the macports build process…

It seems to work with master (I tested open raw files and apply LUTs).
Time to sleep.