Compiling Domoticz on MacOS -- update for 10.12.3 Sierra

On various Hardware and OS systems: pi / windows / routers / nas, etc
Post Reply
Posts: 25
Joined: Sunday 11 January 2015 13:17
Target OS: OS X
Domoticz version:

Compiling Domoticz on MacOS -- update for 10.12.3 Sierra

Post by bellyd » Tuesday 07 February 2017 22:11

Building on trixwood’s clear instructions to compile Domoticz for MacOS (, I’d thought it might be useful for others to see what has changed since last year. Before I edit the Wiki page let me summarize what I found:

0) I executed the compilation on a fresh (‘virgin’) Parallels MacOS 10.12.3 virtual machine (Parallels) using latest brew and Xcode 8.2.1. To get the virtual machine running without SIP see the end of this post.

1) Installing necessary libraries
brew install boost —with-python: the —with-python option doesn’t exist and is ignored. Can be removed from the instructions.
brew install zlib: brew formula doesn’t exist and this install can be ignored (zlib is present in MacOS/Xcode by default?). Remove from instructions.
brew install openssl: comes with lots of warnings and caveats but is still required to compile Domoticz successfully. The export LDFLAGS and CPPFLAGS statements were of no use (I still ended up with Domoticz compile errors caused by openssl). See export commands below which solved the errors.
brew linkapps python3: brew linkapps is no longer a current brew operation though it still works. Not sure what the effect is if you leave it out (as used to be the case).

2) Compile OpenZWave
I would place this instruction in front of downloading the Domoticz source. For newbies this avoids them installing OpenZWave within the Domoticz folder. Please note the way OpenZWave is installed causes brew doctor to report a lot of warnings of ’unbrewed’ OpenZWave dylib and header files)
Also note I had to use sudo make install (combined with turning off SIP) to get the pkgconfig executable (chown 755) and copied into /usr/lib/pkgconfig.

3) Compile Domoticz
First hurdle to take was to get openssl properly recognized. This required export OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ and export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/.
I had to reference Python 3.6 in the cmake options (I’m glad trixwood had clearly signalled this change in the instructions).
Combined with turning off the Python plugins the cmake working for me was: cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/Headers -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib -DUSE_PYTHON_PLUGINS=NO CMakeLists.txt
Perhaps the following cmake may also work if you have no other Python libraries installed: cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PYTHON_PLUGINS=NO CMakeLists.txt

There are still a lot of warnings listed when compiling Domoticz but these don’t prevent you from generating a MacOS executable!

Procedure to turn off SIP on a Parallels virtual machine:
0. Shutdown your macOS VM.
1. Add to its boot flags (VM config -> Hardware -> Boot Order -> Advanced settings -> Boot flags) string "vm.efi.mac_recovery=1" - this forces VM to boot into Recovery mode.
2. Start your VM and it will be in Recovery.
3. Disable SIP.
4. Shutdown VM.
5. Disable Recovery mode setting boot flat value to "0".
6. Start VM - it will boot normally but without SIP.
Mac mini server -- Oregon Scientific sensors -- KAKU switches -- Evohome Wifi with Evoclient --
OpenZWave/ UZB1 USB stick (z-wave+)/Aeotec Smart Switch 6

Posts: 510
Joined: Friday 18 March 2016 8:20
Target OS: -
Domoticz version: Offline

Re: Compiling Domoticz on MacOS -- update for 10.12.3 Sierra

Post by trixwood » Wednesday 08 February 2017 7:06

Could you add this to the wiki? Make an sierra section :-)

Posts: 1
Joined: Wednesday 15 November 2017 22:22
Target OS: OS X
Domoticz version:

Re: Compiling Domoticz on MacOS -- update for 10.12.3 Sierra

Post by osks » Wednesday 15 November 2017 22:36

I noticed that if I install pkgconfig with homebrew (brew install pkgconfig) before I compile OpenZWave, it will not try to install in /usr/lib but instead /usr/local/lib, and then I didn't have to disable SIP protection.

Posts: 309
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:

Re: Compiling Domoticz on MacOS -- update for 10.12.3 Sierra

Post by febalci » Thursday 11 January 2018 21:04

On High Sierra, make gives an error because of boost 1.66 (latest). So i reverted my boost and boost-python versions to 1.59. I also did not include the -DUSE_PYTHON_PLUGINS=NO option since i want to use the Plugin Framework. It compiles and works with boost 1.59, however still no Plugin support...

Posts: 6
Joined: Wednesday 11 October 2017 8:50
Target OS: OS X
Domoticz version:

Re: Compiling Domoticz on MacOS -- update for 10.12.3 Sierra

Post by Sarcas » Saturday 13 January 2018 9:46

I've been trying for days now to compile a version for 10.13.2 with zwave. Seeing the outdated and incomplete info on how to compile I guess it is hardly used for macos? I'll see if downgrading boost fixes stuff...

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests