Compiling Domoticz on MacOS -- update for 10.12.3 Sierra

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
bellyd
Posts: 8
Joined: Sunday 11 January 2015 12:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Compiling Domoticz on MacOS -- update for 10.12.3 Sierra

Post by bellyd »

Building on trixwood’s clear instructions to compile Domoticz for MacOS (http://www.domoticz.com/wiki/Mac_OS_X), 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.
---
RPi 4B 4GB -- Oregon Scientific sensors -- KAKU switches -- MoreSense CO2 sensor --
zwaveJS2mqtt/z-wave.me UZB1 USB stick (z-wave+)/Aeotec Smart Switch 6/Fibaro FGWPEF-102 Switches
trixwood

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

Post by trixwood »

Could you add this to the wiki? Make an sierra section :-)
osks
Posts: 1
Joined: Wednesday 15 November 2017 21:22
Target OS: OS X
Domoticz version:
Contact:

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

Post by osks »

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.
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

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

Post by febalci »

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...
Sarcas
Posts: 86
Joined: Wednesday 11 October 2017 8:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1ß
Location: Friesland
Contact:

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

Post by Sarcas »

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...
--

Domoticz on rPi4 - RFXCOM RFXtrx433 USB - ZW090 Z-Stick Gen5 EU - IKEA Tradfri - Philips HUE - YouLess meter - SolarEdge
Infern0
Posts: 1
Joined: Monday 23 July 2018 17:28
Target OS: OS X
Domoticz version:
Contact:

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

Post by Infern0 »

febalci wrote: Thursday 11 January 2018 20: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...
See here:
https://github.com/domoticz/domoticz/issues/2589
sion
Posts: 113
Joined: Friday 08 January 2016 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by sion »

hi all.
just wondering if anyone has domoticz running on mac os high sierra, with plugins?

i followed the instructions to Compile Domoticz, but i keep getting:

Code: Select all

fatal error: 
      'Python.h' file not found
#include <Python.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/domoticz.dir/main/EventSystem.cpp.o] Error 1
make[1]: *** [CMakeFiles/domoticz.dir/all] Error 2
make: *** [all] Error 2
jsut wanted to check before i keep trying :)

Thanks,
Sion.
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.

Next: harmony hub.
Jespertheend
Posts: 1
Joined: Saturday 17 August 2019 23:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Jespertheend »

sion wrote: Saturday 19 January 2019 2:54 i followed the instructions to Compile Domoticz, but i keep getting:

Code: Select all

fatal error: 
      'Python.h' file not found
#include <Python.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/domoticz.dir/main/EventSystem.cpp.o] Error 1
make[1]: *** [CMakeFiles/domoticz.dir/all] Error 2
make: *** [all] Error 2
I had this same issue, but it turned out the python location provided in my cmake command was incorrect.

Code: Select all

cmake -DCMAKE_BUILD_TYPE=Release  -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/Headers -DPYTHON_LIBRARY=/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib CMakeLists.txt
fixed it for me but it depends on what python version you have installed.
FredWst
Posts: 1
Joined: Tuesday 01 October 2019 18:31
Target OS: OS X
Domoticz version:
Contact:

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

Post by FredWst »

Hi

I compile with this option :

cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -DCMAKE_BUILD_TYPE=Release -DPYTHON_INCLUDE_DIR=/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Headers -DPYTHON_LIBRARY=/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib CMakeLists.txt

Fred
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest